org.apache.cassandra.locator
Class RackInferringSnitch

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

public class RackInferringSnitch
extends AbstractNetworkTopologySnitch

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


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.AbstractNetworkTopologySnitch
compareEndpoints, getSortedListByProximity, sortByProximity
 
Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
gossiperStarting
 
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: AbstractNetworkTopologySnitch
Return the rack for which an endpoint resides in

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

getDatacenter

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

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


Copyright © 2011 The Apache Software Foundation