public class SimpleSnitch extends AbstractEndpointSnitch
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATA_CENTER_NAME |
static java.lang.String |
RACK_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, isWorthMergingForRangeQuery
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatacenter, getLocalDatacenter, getLocalRack, validate
public static final java.lang.String DATA_CENTER_NAME
public static final java.lang.String RACK_NAME
public java.lang.String getRack(InetAddressAndPort endpoint)
IEndpointSnitch
public java.lang.String getDatacenter(InetAddressAndPort endpoint)
IEndpointSnitch
public <C extends ReplicaCollection<? extends C>> C sortedByProximity(InetAddressAndPort address, C unsortedAddress)
AbstractEndpointSnitch
sortedByProximity
in interface IEndpointSnitch
sortedByProximity
in class AbstractEndpointSnitch
address
- the address to sort by proximity tounsortedAddress
- the nodes to sortpublic int compareEndpoints(InetAddressAndPort target, Replica r1, Replica r2)
IEndpointSnitch
compareEndpoints
in interface IEndpointSnitch
compareEndpoints
in class AbstractEndpointSnitch
Copyright © 2009- The Apache Software Foundation