public abstract class AbstractEndpointSnitch extends java.lang.Object implements IEndpointSnitch
Constructor and Description |
---|
AbstractEndpointSnitch() |
Modifier and Type | Method and Description |
---|---|
abstract 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.net.InetAddress> |
getSortedListByProximity(java.net.InetAddress address,
java.util.Collection<java.net.InetAddress> unsortedAddress)
Sorts the Collection of node addresses by proximity to the given address
|
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 |
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatacenter, getRack
public abstract int compareEndpoints(java.net.InetAddress target, java.net.InetAddress a1, java.net.InetAddress a2)
IEndpointSnitch
compareEndpoints
in interface IEndpointSnitch
public java.util.List<java.net.InetAddress> getSortedListByProximity(java.net.InetAddress address, java.util.Collection<java.net.InetAddress> unsortedAddress)
getSortedListByProximity
in interface IEndpointSnitch
address
- the address to sort by proximity tounsortedAddress
- the nodes to sortpublic void sortByProximity(java.net.InetAddress address, java.util.List<java.net.InetAddress> addresses)
sortByProximity
in interface IEndpointSnitch
address
- the address to sort the proximity byaddresses
- the nodes to sortpublic void gossiperStarting()
IEndpointSnitch
gossiperStarting
in interface IEndpointSnitch
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
Copyright © 2014 The Apache Software Foundation