## 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
`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`

Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
`getSortedListByProximity, gossiperStarting, sortByProximity`

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 © 2013 The Apache Software Foundation