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()
IEndpointSnitchgossiperStarting in interface IEndpointSnitchgossiperStarting in class AbstractEndpointSnitchpublic java.lang.String getRack(java.net.InetAddress endpoint)
IEndpointSnitchgetRack in interface IEndpointSnitchpublic java.lang.String getDatacenter(java.net.InetAddress endpoint)
IEndpointSnitchgetDatacenter in interface IEndpointSnitchpublic java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> addresses)
AbstractEndpointSnitchgetSortedListByProximity in interface IEndpointSnitchgetSortedListByProximity in class AbstractEndpointSnitchaddress - the address to sort by proximity toaddresses - the nodes to sortpublic void sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
AbstractEndpointSnitchsortByProximity in interface IEndpointSnitchsortByProximity in class AbstractEndpointSnitchaddress - 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)
IEndpointSnitchcompareEndpoints in interface IEndpointSnitchcompareEndpoints in class AbstractEndpointSnitchpublic void receiveTiming(java.net.InetAddress host,
long latency)
receiveTiming in interface ILatencySubscriberpublic java.util.Map<java.net.InetAddress,java.lang.Double> getScores()
getScores 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(java.util.List<java.net.InetAddress> merged,
java.util.List<java.net.InetAddress> l1,
java.util.List<java.net.InetAddress> l2)
IEndpointSnitchisWorthMergingForRangeQuery in interface IEndpointSnitchisWorthMergingForRangeQuery in class AbstractEndpointSnitchCopyright © 2015 The Apache Software Foundation