org.apache.cassandra.locator
Class RackUnawareStrategy

java.lang.Object
  extended by org.apache.cassandra.locator.AbstractReplicationStrategy
      extended by org.apache.cassandra.locator.RackUnawareStrategy

public class RackUnawareStrategy
extends AbstractReplicationStrategy

This class returns the nodes responsible for a given key but does not respect rack awareness. Basically returns the 3 nodes that lie right next to each other on the ring.


Field Summary
 
Fields inherited from class org.apache.cassandra.locator.AbstractReplicationStrategy
logger_, snitch_
 
Constructor Summary
RackUnawareStrategy(TokenMetadata tokenMetadata, IEndPointSnitch snitch)
           
 
Method Summary
 java.util.ArrayList<java.net.InetAddress> getNaturalEndpoints(Token token, TokenMetadata metadata, java.lang.String table)
          get the endpoints that should store the given Token, for the given table.
 
Methods inherited from class org.apache.cassandra.locator.AbstractReplicationStrategy
getAddressRanges, getAddressRanges, getHintedEndpoints, getNaturalEndpoints, getPendingAddressRanges, getRangeAddresses, getWriteEndpoints, getWriteResponseHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RackUnawareStrategy

public RackUnawareStrategy(TokenMetadata tokenMetadata,
                           IEndPointSnitch snitch)
Method Detail

getNaturalEndpoints

public java.util.ArrayList<java.net.InetAddress> getNaturalEndpoints(Token token,
                                                                     TokenMetadata metadata,
                                                                     java.lang.String table)
Description copied from class: AbstractReplicationStrategy
get the endpoints that should store the given Token, for the given table. 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.

Specified by:
getNaturalEndpoints in class AbstractReplicationStrategy


Copyright © 2010 The Apache Software Foundation