org.apache.cassandra.locator
Interface IEndPointSnitch

All Known Implementing Classes:
AbstractEndpointSnitch, DatacenterEndPointSnitch, EndPointSnitch

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. Not all methods will be germate to all implementations. Throw UnsupportedOperation as necessary.


Method Summary
 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
 java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
          This method will sort the List according to the proximity of the given address.
 

Method Detail

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

java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address,
                                                     java.util.List<java.net.InetAddress> addresses)
This method will sort the List according to the proximity of the given address.



Copyright © 2010 The Apache Software Foundation