|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cassandra.locator.AbstractEndpointSnitch
public abstract class AbstractEndpointSnitch
An endpoint snitch tells Cassandra information about network topology that it can use to route requests more efficiently (with "sortByProximity"). Of the abstract methods, isOnSameRack and isInSameDataCenter are always required; getLocation is only used by DatacenterShardStrategy.
Constructor Summary | |
---|---|
AbstractEndpointSnitch()
|
Method Summary | |
---|---|
abstract java.lang.String |
getLocation(java.net.InetAddress endpoint)
Determines the name of the datacenter this endpoint lives in. |
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> unsortedAddress)
returns a new List |
abstract boolean |
isInSameDataCenter(java.net.InetAddress host,
java.net.InetAddress host2)
Determines if 2 nodes are in the same data center. |
abstract boolean |
isOnSameRack(java.net.InetAddress host,
java.net.InetAddress host2)
Determines 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.List<java.net.InetAddress> addresses)
This method will sort the List |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractEndpointSnitch()
Method Detail |
---|
public abstract boolean isOnSameRack(java.net.InetAddress host, java.net.InetAddress host2) throws java.net.UnknownHostException
host
- a specified endpointhost2
- another specified endpoint
java.net.UnknownHostException
public abstract boolean isInSameDataCenter(java.net.InetAddress host, java.net.InetAddress host2) throws java.net.UnknownHostException
host
- a specified endpointhost2
- another specified endpoint
java.net.UnknownHostException
public abstract java.lang.String getLocation(java.net.InetAddress endpoint) throws java.net.UnknownHostException
endpoint
-
java.net.UnknownHostException
public java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> unsortedAddress)
IEndPointSnitch
getSortedListByProximity
in interface IEndPointSnitch
public java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
IEndPointSnitch
sortByProximity
in interface IEndPointSnitch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |