public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILatencySubscriber, 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 |
---|---|
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.util.List<java.lang.Double> |
dumpTimings(java.lang.String hostname) |
double |
getBadnessThreshold() |
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
|
int |
getResetInterval() |
java.util.Map<java.net.InetAddress,java.lang.Double> |
getScores() |
double |
getSeverity() |
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> addresses)
Sorts the Collection of node addresses by proximity to the given address
|
java.lang.String |
getSubsnitchClassName() |
int |
getUpdateInterval() |
void |
gossiperStarting()
called after Gossiper instance exists immediately before it starts gossiping
|
boolean |
isWorthMergingForRangeQuery(java.util.List<java.net.InetAddress> merged,
java.util.List<java.net.InetAddress> l1,
java.util.List<java.net.InetAddress> 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(java.net.InetAddress host,
long latency) |
void |
setSeverity(double severity)
Use this if you want to specify a severity; it can be negative
Example: Page cache is cold and you want data to be sent
though it is not preferred one.
|
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
|
void |
unregisterMBean() |
public final IEndpointSnitch subsnitch
public DynamicEndpointSnitch(IEndpointSnitch snitch)
public DynamicEndpointSnitch(IEndpointSnitch snitch, java.lang.String instance)
public void unregisterMBean()
public void gossiperStarting()
IEndpointSnitch
gossiperStarting
in interface IEndpointSnitch
gossiperStarting
in class AbstractEndpointSnitch
public java.lang.String getRack(java.net.InetAddress endpoint)
IEndpointSnitch
getRack
in interface IEndpointSnitch
public java.lang.String getDatacenter(java.net.InetAddress endpoint)
IEndpointSnitch
getDatacenter
in interface IEndpointSnitch
public java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> addresses)
AbstractEndpointSnitch
getSortedListByProximity
in interface IEndpointSnitch
getSortedListByProximity
in class AbstractEndpointSnitch
address
- the address to sort by proximity toaddresses
- the nodes to sortpublic void sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
AbstractEndpointSnitch
sortByProximity
in interface IEndpointSnitch
sortByProximity
in class AbstractEndpointSnitch
address
- 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)
IEndpointSnitch
compareEndpoints
in interface IEndpointSnitch
compareEndpoints
in class AbstractEndpointSnitch
public void receiveTiming(java.net.InetAddress host, long latency)
receiveTiming
in interface ILatencySubscriber
public java.util.Map<java.net.InetAddress,java.lang.Double> getScores()
getScores
in interface DynamicEndpointSnitchMBean
public int getUpdateInterval()
getUpdateInterval
in interface DynamicEndpointSnitchMBean
public int getResetInterval()
getResetInterval
in interface DynamicEndpointSnitchMBean
public double getBadnessThreshold()
getBadnessThreshold
in interface DynamicEndpointSnitchMBean
public java.lang.String getSubsnitchClassName()
getSubsnitchClassName
in interface DynamicEndpointSnitchMBean
public java.util.List<java.lang.Double> dumpTimings(java.lang.String hostname) throws java.net.UnknownHostException
dumpTimings
in interface DynamicEndpointSnitchMBean
java.net.UnknownHostException
public void setSeverity(double severity)
DynamicEndpointSnitchMBean
setSeverity
in interface DynamicEndpointSnitchMBean
public double getSeverity()
getSeverity
in interface DynamicEndpointSnitchMBean
public boolean isWorthMergingForRangeQuery(java.util.List<java.net.InetAddress> merged, java.util.List<java.net.InetAddress> l1, java.util.List<java.net.InetAddress> l2)
IEndpointSnitch
isWorthMergingForRangeQuery
in interface IEndpointSnitch
isWorthMergingForRangeQuery
in class AbstractEndpointSnitch
Copyright © 2020 The Apache Software Foundation