|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cassandra.locator.AbstractEndpointSnitch org.apache.cassandra.locator.AbstractNetworkTopologySnitch
public abstract class AbstractNetworkTopologySnitch
An endpoint snitch tells Cassandra information about network topology that it can use to route requests more efficiently.
Constructor Summary | |
---|---|
AbstractNetworkTopologySnitch()
|
Method Summary | |
---|---|
int |
compareEndpoints(java.net.InetAddress address,
java.net.InetAddress a1,
java.net.InetAddress a2)
compares two endpoints in relation to the target endpoint, returning as Comparator.compare would |
abstract java.lang.String |
getDatacenter(java.net.InetAddress endpoint)
Return the data center for which an endpoint resides in |
abstract java.lang.String |
getRack(java.net.InetAddress endpoint)
Return the rack for which an endpoint resides in |
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> addresses)
Sorts the Collection of node addresses by proximity to the given address |
void |
sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
Sorts the List of node addresses by proximity to the given address |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractNetworkTopologySnitch()
Method Detail |
---|
public abstract java.lang.String getRack(java.net.InetAddress endpoint)
endpoint
- a specified endpoint
java.net.UnknownHostException
public abstract java.lang.String getDatacenter(java.net.InetAddress endpoint)
endpoint
- a specified endpoint
java.net.UnknownHostException
public java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> addresses)
getSortedListByProximity
in interface IEndpointSnitch
getSortedListByProximity
in class AbstractEndpointSnitch
address
- the address to sort by proximity toaddresses
- the nodes to sort
public void sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
sortByProximity
in interface IEndpointSnitch
sortByProximity
in class AbstractEndpointSnitch
address
- the address to sort the proximity byaddresses
- the nodes to sortpublic int compareEndpoints(java.net.InetAddress address, java.net.InetAddress a1, java.net.InetAddress a2)
IEndpointSnitch
compareEndpoints
in interface IEndpointSnitch
compareEndpoints
in class AbstractEndpointSnitch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |