|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.locator.AbstractReplicationStrategy
public abstract class AbstractReplicationStrategy
A abstract parent for all replication strategies.
Field Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
configOptions
|
IEndpointSnitch |
snitch
|
java.lang.String |
table
|
Method Summary | |
---|---|
void |
cacheEndpoint(Token t,
java.util.ArrayList<java.net.InetAddress> addr)
|
abstract java.util.List<java.net.InetAddress> |
calculateNaturalEndpoints(Token searchToken,
TokenMetadata tokenMetadata)
calculate the natural endpoints for the given token |
void |
clearEndpointCache()
|
static AbstractReplicationStrategy |
createReplicationStrategy(java.lang.String table,
java.lang.Class<? extends AbstractReplicationStrategy> strategyClass,
TokenMetadata tokenMetadata,
IEndpointSnitch snitch,
java.util.Map<java.lang.String,java.lang.String> strategyOptions)
|
static AbstractReplicationStrategy |
createReplicationStrategy(java.lang.String table,
java.lang.String strategyClassName,
TokenMetadata tokenMetadata,
IEndpointSnitch snitch,
java.util.Map<java.lang.String,java.lang.String> strategyOptions)
|
com.google.common.collect.Multimap<java.net.InetAddress,Range> |
getAddressRanges()
|
com.google.common.collect.Multimap<java.net.InetAddress,Range> |
getAddressRanges(TokenMetadata metadata)
|
java.util.ArrayList<java.net.InetAddress> |
getCachedEndpoints(Token t)
|
static java.lang.Class<AbstractReplicationStrategy> |
getClass(java.lang.String cls)
|
java.util.ArrayList<java.net.InetAddress> |
getNaturalEndpoints(Token searchToken)
get the (possibly cached) endpoints that should store the given Token Note that while the endpoints are conceptually a Set (no duplicates will be included), we return a List to avoid an extra allocation when sorting by proximity later |
java.util.Collection<Range> |
getPendingAddressRanges(TokenMetadata metadata,
Token pendingToken,
java.net.InetAddress pendingAddress)
|
com.google.common.collect.Multimap<Range,java.net.InetAddress> |
getRangeAddresses(TokenMetadata metadata)
|
abstract int |
getReplicationFactor()
calculate the RF based on strategy_options. |
IWriteResponseHandler |
getWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints,
org.apache.cassandra.thrift.ConsistencyLevel consistency_level)
|
void |
invalidateCachedTokenEndpointValues()
|
abstract void |
validateOptions()
|
protected void |
validateReplicationFactor(java.lang.String rf)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String table
public final java.util.Map<java.lang.String,java.lang.String> configOptions
public IEndpointSnitch snitch
Method Detail |
---|
public java.util.ArrayList<java.net.InetAddress> getCachedEndpoints(Token t)
public void cacheEndpoint(Token t, java.util.ArrayList<java.net.InetAddress> addr)
public void clearEndpointCache()
public java.util.ArrayList<java.net.InetAddress> getNaturalEndpoints(Token searchToken)
searchToken
- the token the natural endpoints are requested for
public abstract java.util.List<java.net.InetAddress> calculateNaturalEndpoints(Token searchToken, TokenMetadata tokenMetadata)
searchToken
- the token the natural endpoints are requested for
getNaturalEndpoints(org.apache.cassandra.dht.Token)
public IWriteResponseHandler getWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints, org.apache.cassandra.thrift.ConsistencyLevel consistency_level)
public abstract int getReplicationFactor()
public com.google.common.collect.Multimap<java.net.InetAddress,Range> getAddressRanges(TokenMetadata metadata)
public com.google.common.collect.Multimap<Range,java.net.InetAddress> getRangeAddresses(TokenMetadata metadata)
public com.google.common.collect.Multimap<java.net.InetAddress,Range> getAddressRanges()
public java.util.Collection<Range> getPendingAddressRanges(TokenMetadata metadata, Token pendingToken, java.net.InetAddress pendingAddress)
public void invalidateCachedTokenEndpointValues()
public abstract void validateOptions() throws ConfigurationException
ConfigurationException
public static AbstractReplicationStrategy createReplicationStrategy(java.lang.String table, java.lang.Class<? extends AbstractReplicationStrategy> strategyClass, TokenMetadata tokenMetadata, IEndpointSnitch snitch, java.util.Map<java.lang.String,java.lang.String> strategyOptions) throws ConfigurationException
ConfigurationException
public static AbstractReplicationStrategy createReplicationStrategy(java.lang.String table, java.lang.String strategyClassName, TokenMetadata tokenMetadata, IEndpointSnitch snitch, java.util.Map<java.lang.String,java.lang.String> strategyOptions) throws ConfigurationException
ConfigurationException
public static java.lang.Class<AbstractReplicationStrategy> getClass(java.lang.String cls) throws ConfigurationException
ConfigurationException
protected void validateReplicationFactor(java.lang.String rf) throws ConfigurationException
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |