|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 | |
---|---|
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 |
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
isOnSameRack
in interface IEndPointSnitch
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
isInSameDataCenter
in interface IEndPointSnitch
host
- a specified endpointhost2
- another specified endpoint
java.net.UnknownHostException
public abstract java.lang.String getLocation(java.net.InetAddress endpoint) throws java.net.UnknownHostException
getLocation
in interface IEndPointSnitch
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
public int compareEndpoints(java.net.InetAddress target, java.net.InetAddress a1, java.net.InetAddress a2)
IEndPointSnitch
compareEndpoints
in interface IEndPointSnitch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |