|
||||||||||
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 | |
---|---|
java.lang.String |
getLocation(java.net.InetAddress endpoint)
Given endpoints this method will help us know the datacenter name where the node is located at. |
boolean |
isInSameDataCenter(java.net.InetAddress host,
java.net.InetAddress host2)
Helps determine if 2 nodes are in the same data center. |
boolean |
isOnSameRack(java.net.InetAddress host,
java.net.InetAddress host2)
Helps determine if 2 nodes are in the same rack in the data center. |
java.util.List<java.net.InetAddress> |
sortByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> unsortedAddress)
This method will sort the Set |
Method Detail |
---|
boolean isOnSameRack(java.net.InetAddress host, java.net.InetAddress host2) throws java.net.UnknownHostException
host
- a specified endpointhost2
- another specified endpoint
java.net.UnknownHostException
boolean isInSameDataCenter(java.net.InetAddress host, java.net.InetAddress host2) throws java.net.UnknownHostException
host
- a specified endpointhost2
- another specified endpoint
java.net.UnknownHostException
java.lang.String getLocation(java.net.InetAddress endpoint) throws java.net.UnknownHostException
java.net.UnknownHostException
java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> unsortedAddress)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |