|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.DynamicEndpointSnitch
public class DynamicEndpointSnitch
A dynamic snitch that sorts endpoints by latency with an adapted phi failure detector
Field Summary | |
---|---|
IEndpointSnitch |
subsnitch
|
Fields inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch |
---|
subscribers |
Constructor Summary | |
---|---|
DynamicEndpointSnitch(IEndpointSnitch snitch)
|
Method Summary | |
---|---|
void |
cacheEndpoint(Token t,
java.util.ArrayList<java.net.InetAddress> addr)
puts an address in the cache for a given token. |
void |
clearEndpointCache()
clears all cache values. |
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.ArrayList<java.net.InetAddress> |
getCachedEndpoints(Token t)
returns a list of cached endpoints for a given token. |
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 |
java.util.Map<java.net.InetAddress,java.lang.Double> |
getScores()
|
java.util.List<java.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> addresses)
returns a new List sorted by proximity to the given endpoint |
void |
receiveTiming(java.net.InetAddress host,
java.lang.Double latency)
|
java.util.List<java.net.InetAddress> |
sortByProximity(java.net.InetAddress address,
java.util.List<java.net.InetAddress> addresses)
This method will sort the List by proximity to the given address. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public IEndpointSnitch subsnitch
Constructor Detail |
---|
public DynamicEndpointSnitch(IEndpointSnitch snitch)
Method Detail |
---|
public java.util.ArrayList<java.net.InetAddress> getCachedEndpoints(Token t)
IEndpointSnitch
getCachedEndpoints
in interface IEndpointSnitch
getCachedEndpoints
in class AbstractEndpointSnitch
public void cacheEndpoint(Token t, java.util.ArrayList<java.net.InetAddress> addr)
IEndpointSnitch
cacheEndpoint
in interface IEndpointSnitch
cacheEndpoint
in class AbstractEndpointSnitch
public void clearEndpointCache()
IEndpointSnitch
clearEndpointCache
in interface IEndpointSnitch
clearEndpointCache
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)
IEndpointSnitch
getSortedListByProximity
in interface IEndpointSnitch
getSortedListByProximity
in class AbstractEndpointSnitch
public java.util.List<java.net.InetAddress> sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
IEndpointSnitch
sortByProximity
in interface IEndpointSnitch
sortByProximity
in class AbstractEndpointSnitch
public 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, java.lang.Double latency)
receiveTiming
in interface ILatencySubscriber
public java.util.Map<java.net.InetAddress,java.lang.Double> getScores()
getScores
in interface DynamicEndpointSnitchMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |