org.apache.cassandra.locator
Class SimpleStrategy
java.lang.Object
org.apache.cassandra.locator.AbstractReplicationStrategy
org.apache.cassandra.locator.SimpleStrategy
public class SimpleStrategy
- extends AbstractReplicationStrategy
This class returns the nodes responsible for a given
key but does not respect rack awareness. Basically
returns the RF nodes that lie right next to each other
on the ring.
Methods inherited from class org.apache.cassandra.locator.AbstractReplicationStrategy |
cacheEndpoint, clearEndpointCache, createReplicationStrategy, createReplicationStrategy, getAddressRanges, getAddressRanges, getCachedEndpoints, getClass, getNaturalEndpoints, getPendingAddressRanges, getRangeAddresses, getWriteResponseHandler, invalidateCachedTokenEndpointValues, validateReplicationFactor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleStrategy
public SimpleStrategy(java.lang.String table,
TokenMetadata tokenMetadata,
IEndpointSnitch snitch,
java.util.Map<java.lang.String,java.lang.String> configOptions)
calculateNaturalEndpoints
public java.util.List<java.net.InetAddress> calculateNaturalEndpoints(Token token,
TokenMetadata metadata)
- Description copied from class:
AbstractReplicationStrategy
- calculate the natural endpoints for the given token
- Specified by:
calculateNaturalEndpoints
in class AbstractReplicationStrategy
- Parameters:
token
- the token the natural endpoints are requested for
- Returns:
- a copy of the natural endpoints for the given token
- See Also:
AbstractReplicationStrategy.getNaturalEndpoints(org.apache.cassandra.dht.Token)
getReplicationFactor
public int getReplicationFactor()
- Description copied from class:
AbstractReplicationStrategy
- calculate the RF based on strategy_options. When overwriting, ensure that this get()
is FAST, as this is called often.
- Specified by:
getReplicationFactor
in class AbstractReplicationStrategy
- Returns:
- the replication factor
validateOptions
public void validateOptions()
throws ConfigurationException
- Specified by:
validateOptions
in class AbstractReplicationStrategy
- Throws:
ConfigurationException
Copyright © 2011 The Apache Software Foundation