public class SimpleSnitch extends AbstractEndpointSnitch
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DATA_CENTER_NAME |
| Constructor and Description |
|---|
SimpleSnitch() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareEndpoints(InetAddressAndPort target,
Replica r1,
Replica r2)
compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
|
java.lang.String |
getDatacenter(InetAddressAndPort endpoint)
returns a String representing the datacenter the given endpoint belongs to
|
java.lang.String |
getRack(InetAddressAndPort endpoint)
returns a String representing the rack the given endpoint belongs to
|
<C extends ReplicaCollection<? extends C>> |
sortedByProximity(InetAddressAndPort address,
C unsortedAddress)
Sorts the Collection of node addresses by proximity to the given address
|
gossiperStarting, isWorthMergingForRangeQueryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDatacenter, getLocalDatacenter, getLocalRack, validatepublic static final java.lang.String DATA_CENTER_NAME
public java.lang.String getRack(InetAddressAndPort endpoint)
IEndpointSnitchpublic java.lang.String getDatacenter(InetAddressAndPort endpoint)
IEndpointSnitchpublic <C extends ReplicaCollection<? extends C>> C sortedByProximity(InetAddressAndPort address, C unsortedAddress)
AbstractEndpointSnitchsortedByProximity in interface IEndpointSnitchsortedByProximity in class AbstractEndpointSnitchaddress - the address to sort by proximity tounsortedAddress - the nodes to sortpublic int compareEndpoints(InetAddressAndPort target, Replica r1, Replica r2)
IEndpointSnitchcompareEndpoints in interface IEndpointSnitchcompareEndpoints in class AbstractEndpointSnitchCopyright © 2009-2020 The Apache Software Foundation