Package org.apache.cassandra.locator
Class RackInferringSnitch
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractEndpointSnitch
-
- org.apache.cassandra.locator.AbstractNetworkTopologySnitch
-
- 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
Constructors Constructor Description RackInferringSnitch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDatacenter(InetAddressAndPort endpoint)Return the data center for which an endpoint resides injava.lang.StringgetRack(InetAddressAndPort endpoint)Return the rack for which an endpoint resides in-
Methods inherited from class org.apache.cassandra.locator.AbstractNetworkTopologySnitch
compareEndpoints
-
Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
gossiperStarting, isWorthMergingForRangeQuery, sortedByProximity
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.locator.IEndpointSnitch
getDatacenter, getDatacenter, getLocalDatacenter, getLocalRack, validate
-
-
-
-
Method Detail
-
getRack
public java.lang.String getRack(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitchReturn the rack for which an endpoint resides in- Specified by:
getRackin interfaceIEndpointSnitch- Specified by:
getRackin classAbstractNetworkTopologySnitch- Parameters:
endpoint- a specified endpoint- Returns:
- string of rack
-
getDatacenter
public java.lang.String getDatacenter(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitchReturn the data center for which an endpoint resides in- Specified by:
getDatacenterin interfaceIEndpointSnitch- Specified by:
getDatacenterin classAbstractNetworkTopologySnitch- Parameters:
endpoint- a specified endpoint- Returns:
- string of data center
-
-