public class SimpleSnitch extends AbstractEndpointSnitch
| Constructor and Description |
|---|
SimpleSnitch() |
| Modifier and Type | Method and Description |
|---|---|
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 |
getDatacenter(java.net.InetAddress endpoint)
returns a String representing the datacenter this endpoint belongs to
|
java.lang.String |
getRack(java.net.InetAddress endpoint)
returns a String repesenting the rack this endpoint belongs to
|
void |
sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
Sorts the List of node addresses, in-place, by proximity to the given address
|
getSortedListByProximity, gossiperStarting, isWorthMergingForRangeQuerypublic java.lang.String getRack(java.net.InetAddress endpoint)
IEndpointSnitchpublic java.lang.String getDatacenter(java.net.InetAddress endpoint)
IEndpointSnitchpublic void sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
AbstractEndpointSnitchsortByProximity in interface IEndpointSnitchsortByProximity in class AbstractEndpointSnitchaddress - the address to sort the proximity byaddresses - the nodes to sortpublic int compareEndpoints(java.net.InetAddress target,
java.net.InetAddress a1,
java.net.InetAddress a2)
IEndpointSnitchcompareEndpoints in interface IEndpointSnitchcompareEndpoints in class AbstractEndpointSnitchCopyright © 2015 The Apache Software Foundation