|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
---|---|
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 |
getLocation(java.net.InetAddress endpoint)
|
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> unsortedAddress)
returns a new List |
boolean |
isInSameDataCenter(java.net.InetAddress a1,
java.net.InetAddress a2)
indicates whether two endpoints are in the same datacenter |
boolean |
isOnSameRack(java.net.InetAddress a1,
java.net.InetAddress a2)
indicates whether two endpoints are on the same rack |
java.util.List<java.net.InetAddress> |
sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
This method will sort the List |
Method Detail |
---|
java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> unsortedAddress)
java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
int compareEndpoints(java.net.InetAddress target, java.net.InetAddress a1, java.net.InetAddress a2)
boolean isOnSameRack(java.net.InetAddress a1, java.net.InetAddress a2) throws java.net.UnknownHostException
java.net.UnknownHostException
boolean isInSameDataCenter(java.net.InetAddress a1, java.net.InetAddress a2) throws java.net.UnknownHostException
java.net.UnknownHostException
java.lang.String getLocation(java.net.InetAddress endpoint) throws java.net.UnknownHostException
java.net.UnknownHostException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |