AbstractNetworkTopologySnitch (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.locator

## Class AbstractNetworkTopologySnitch

- java.lang.Object
- - org.apache.cassandra.locator.AbstractEndpointSnitch
  - - org.apache.cassandra.locator.AbstractNetworkTopologySnitch

- All Implemented Interfaces:
    IEndpointSnitch
  Direct Known Subclasses:
    CloudstackSnitch, Ec2Snitch, GoogleCloudSnitch, GossipingPropertyFileSnitch, PropertyFileSnitch, RackInferringSnitch

      public abstract class AbstractNetworkTopologySnitch
      extends AbstractEndpointSnitch

  An endpoint snitch tells Cassandra information about network topology that it can use to route requests more efficiently.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractNetworkTopologySnitch()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareEndpoints(java.net.InetAddress address, java.net.InetAddress a1, java.net.InetAddress a2)` compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
    `abstract java.lang.String` | `getDatacenter(java.net.InetAddress endpoint)` Return the data center for which an endpoint resides in
    `abstract 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.AbstractEndpointSnitch

      `getSortedListByProximity, gossiperStarting, isWorthMergingForRangeQuery, sortByProximity`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractNetworkTopologySnitch

          public AbstractNetworkTopologySnitch()

  - ### Method Detail

    - #### getRack

          public abstract java.lang.String getRack(java.net.InetAddress endpoint)

      Return the rack for which an endpoint resides in
      Parameters:
        `endpoint` - a specified endpoint
      Returns:
        string of rack

    - #### getDatacenter

          public abstract java.lang.String getDatacenter(java.net.InetAddress endpoint)

      Return the data center for which an endpoint resides in
      Parameters:
        `endpoint` - a specified endpoint
      Returns:
        string of data center

    - #### compareEndpoints

          public int compareEndpoints(java.net.InetAddress address,
                                      java.net.InetAddress a1,
                                      java.net.InetAddress a2)

      Description copied from interface: `IEndpointSnitch`
      compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
      Specified by:
        `compareEndpoints` in interface `IEndpointSnitch`
      Specified by:
        `compareEndpoints` in class `AbstractEndpointSnitch`

Copyright © 2018 The Apache Software Foundation