org.apache.cassandra.locator
Class RackInferringSnitch

java.lang.Object
  extended by org.apache.cassandra.locator.AbstractEndpointSnitch
      extended by org.apache.cassandra.locator.AbstractRackAwareSnitch
          extended by org.apache.cassandra.locator.RackInferringSnitch
All Implemented Interfaces:
IEndpointSnitch

public class RackInferringSnitch
extends AbstractRackAwareSnitch

A simple endpoint snitch implementation that assumes datacenter and rack information is encoded in the 2nd and 3rd octets of the ip address, respectively.


Field Summary
 
Fields inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
subscribers
 
Constructor Summary
RackInferringSnitch()
           
 
Method Summary
 java.lang.String getDatacenter(java.net.InetAddress endpoint)
          Return the data center for which an endpoint resides in
 java.lang.String getRack(java.net.InetAddress endpoint)
          Return the rack for which an endpoint resides in
 
Methods inherited from class org.apache.cassandra.locator.AbstractRackAwareSnitch
compareEndpoints, getSortedListByProximity, sortByProximity
 
Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
invalidateCachedSnitchValues, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RackInferringSnitch

public RackInferringSnitch()
Method Detail

getRack

public java.lang.String getRack(java.net.InetAddress endpoint)
Description copied from class: AbstractRackAwareSnitch
Return the rack for which an endpoint resides in

Specified by:
getRack in interface IEndpointSnitch
Specified by:
getRack in class AbstractRackAwareSnitch
Parameters:
endpoint - a specified endpoint
Returns:
string of rack

getDatacenter

public java.lang.String getDatacenter(java.net.InetAddress endpoint)
Description copied from class: AbstractRackAwareSnitch
Return the data center for which an endpoint resides in

Specified by:
getDatacenter in interface IEndpointSnitch
Specified by:
getDatacenter in class AbstractRackAwareSnitch
Parameters:
endpoint - a specified endpoint
Returns:
string of data center


Copyright © 2010 The Apache Software Foundation