IEndpointSnitch (apache-cassandra API)
Date: 2012-05-04

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.locator
Interface IEndpointSnitch

All Known Implementing Classes:
  AbstractEndpointSnitch, AbstractNetworkTopologySnitch, DynamicEndpointSnitch, Ec2MultiRegionSnitch, Ec2Snitch, PropertyFileSnitch, RackInferringSnitch, SimpleSnitch

    public interface IEndpointSnitch

This interface helps determine location of node in the data center relative to another node. Give a node A and another node B it can tell if A and B are on the same rack or in the same data center.

Method Summary
`int` | `compareEndpoints(java.net.InetAddress target, java.net.InetAddress a1, java.net.InetAddress a2)` compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
`java.lang.String` | `getDatacenter(java.net.InetAddress endpoint)` returns a String representing the datacenter this endpoint belongs to
`java.lang.String` | `getRack(java.net.InetAddress endpoint)` returns a String repesenting the rack this endpoint belongs to
`java.util.List<java.net.InetAddress>` | `getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> unsortedAddress)` returns a new `List` sorted by proximity to the given endpoint
`void` | `gossiperStarting()` called after Gossiper instance exists immediately before it starts gossiping
`void` | `sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)` This method will sort the `List` by proximity to the given address.

Method Detail

### getRack

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

  returns a String repesenting the rack this endpoint belongs to

### getDatacenter

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

  returns a String representing the datacenter this endpoint belongs to

### getSortedListByProximity

    java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address,
                                                                  java.util.Collection<java.net.InetAddress> unsortedAddress)

  returns a new `List` sorted by proximity to the given endpoint

### sortByProximity

    void sortByProximity(java.net.InetAddress address,
                         java.util.List<java.net.InetAddress> addresses)

  This method will sort the `List` by proximity to the given address.

### compareEndpoints

    int compareEndpoints(java.net.InetAddress target,
                         java.net.InetAddress a1,
                         java.net.InetAddress a2)

  compares two endpoints in relation to the target endpoint, returning as Comparator.compare would

### gossiperStarting

    void gossiperStarting()

  called after Gossiper instance exists immediately before it starts gossiping

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 The Apache Software Foundation