|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.SimpleSnitch
public class SimpleSnitch
A simple endpoint snitch implementation that treats Strategy order as proximity, allowing non-read-repaired reads to prefer a single endpoint, which improves cache locality.
Constructor Summary | |
---|---|
SimpleSnitch()
|
Method Summary | |
---|---|
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 |
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> addresses)
returns a new List sorted by proximity to the given endpoint |
void |
sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
This method will sort the List by proximity to the given address. |
Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch |
---|
compareEndpoints, gossiperStarting |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSnitch()
Method Detail |
---|
public java.lang.String getRack(java.net.InetAddress endpoint)
IEndpointSnitch
public java.lang.String getDatacenter(java.net.InetAddress endpoint)
IEndpointSnitch
public java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> addresses)
IEndpointSnitch
getSortedListByProximity
in interface IEndpointSnitch
getSortedListByProximity
in class AbstractEndpointSnitch
public void sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
IEndpointSnitch
sortByProximity
in interface IEndpointSnitch
sortByProximity
in class AbstractEndpointSnitch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |