public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements LatencySubscribers.Subscriber, DynamicEndpointSnitchMBean
| Modifier and Type | Field and Description |
|---|---|
IEndpointSnitch |
subsnitch |
| Constructor and Description |
|---|
DynamicEndpointSnitch(IEndpointSnitch snitch) |
DynamicEndpointSnitch(IEndpointSnitch snitch,
java.lang.String instance) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyConfigChanges()
Update configuration from
DatabaseDescriptor and estart the update-scheduler and reset-scheduler tasks
if the configured rates for these tasks have changed. |
void |
close() |
int |
compareEndpoints(InetAddressAndPort target,
Replica a1,
Replica a2)
compares two endpoints in relation to the target endpoint, returning as Comparator.compare would
|
java.util.List<java.lang.Double> |
dumpTimings(java.lang.String hostname) |
double |
getBadnessThreshold() |
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
|
int |
getResetInterval() |
java.util.Map<java.net.InetAddress,java.lang.Double> |
getScores() |
java.util.Map<java.lang.String,java.lang.Double> |
getScoresWithPort() |
double |
getSeverity() |
java.lang.String |
getSubsnitchClassName() |
int |
getUpdateInterval() |
void |
gossiperStarting()
called after Gossiper instance exists immediately before it starts gossiping
|
boolean |
isWorthMergingForRangeQuery(ReplicaCollection<?> merged,
ReplicaCollection<?> l1,
ReplicaCollection<?> l2)
Returns whether for a range query doing a query against merged is likely
to be faster than 2 sequential queries, one against l1 followed by one against l2.
|
void |
receiveTiming(InetAddressAndPort host,
long latency,
java.util.concurrent.TimeUnit unit) |
void |
setSeverity(double severity)
Setting a Severity allows operators to inject preference information into the Dynamic Snitch
replica selection.
|
<C extends ReplicaCollection<? extends C>> |
sortedByProximity(InetAddressAndPort address,
C unsortedAddresses)
Sorts the Collection of node addresses by proximity to the given address
|
boolean |
validate(java.util.Set<java.lang.String> datacenters,
java.util.Set<java.lang.String> racks)
Determine if the datacenter or rack values in the current node's snitch conflict with those passed in parameters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDatacenter, getLocalDatacenter, getLocalRackpublic final IEndpointSnitch subsnitch
public DynamicEndpointSnitch(IEndpointSnitch snitch)
public DynamicEndpointSnitch(IEndpointSnitch snitch, java.lang.String instance)
public void applyConfigChanges()
DatabaseDescriptor and estart the update-scheduler and reset-scheduler tasks
if the configured rates for these tasks have changed.public void close()
public void gossiperStarting()
IEndpointSnitchgossiperStarting in interface IEndpointSnitchgossiperStarting in class AbstractEndpointSnitchpublic java.lang.String getRack(InetAddressAndPort endpoint)
IEndpointSnitchgetRack in interface IEndpointSnitchpublic java.lang.String getDatacenter(InetAddressAndPort endpoint)
IEndpointSnitchgetDatacenter in interface IEndpointSnitchpublic <C extends ReplicaCollection<? extends C>> C sortedByProximity(InetAddressAndPort address, C unsortedAddresses)
AbstractEndpointSnitchsortedByProximity in interface IEndpointSnitchsortedByProximity in class AbstractEndpointSnitchaddress - the address to sort by proximity tounsortedAddresses - the nodes to sortpublic int compareEndpoints(InetAddressAndPort target, Replica a1, Replica a2)
IEndpointSnitchcompareEndpoints in interface IEndpointSnitchcompareEndpoints in class AbstractEndpointSnitchpublic void receiveTiming(InetAddressAndPort host, long latency, java.util.concurrent.TimeUnit unit)
receiveTiming in interface LatencySubscribers.Subscriberpublic java.util.Map<java.net.InetAddress,java.lang.Double> getScores()
getScores in interface DynamicEndpointSnitchMBeanpublic java.util.Map<java.lang.String,java.lang.Double> getScoresWithPort()
getScoresWithPort in interface DynamicEndpointSnitchMBeanpublic int getUpdateInterval()
getUpdateInterval in interface DynamicEndpointSnitchMBeanpublic int getResetInterval()
getResetInterval in interface DynamicEndpointSnitchMBeanpublic double getBadnessThreshold()
getBadnessThreshold in interface DynamicEndpointSnitchMBeanpublic java.lang.String getSubsnitchClassName()
getSubsnitchClassName in interface DynamicEndpointSnitchMBeanpublic java.util.List<java.lang.Double> dumpTimings(java.lang.String hostname)
throws java.net.UnknownHostException
dumpTimings in interface DynamicEndpointSnitchMBeanjava.net.UnknownHostExceptionpublic void setSeverity(double severity)
DynamicEndpointSnitchMBeansetSeverity in interface DynamicEndpointSnitchMBeanpublic double getSeverity()
getSeverity in interface DynamicEndpointSnitchMBeanpublic boolean isWorthMergingForRangeQuery(ReplicaCollection<?> merged, ReplicaCollection<?> l1, ReplicaCollection<?> l2)
IEndpointSnitchisWorthMergingForRangeQuery in interface IEndpointSnitchisWorthMergingForRangeQuery in class AbstractEndpointSnitchpublic boolean validate(java.util.Set<java.lang.String> datacenters,
java.util.Set<java.lang.String> racks)
IEndpointSnitchvalidate in interface IEndpointSnitchCopyright © 2009-2020 The Apache Software Foundation