Package org.apache.cassandra.locator
Class AbstractNetworkTopologySnitch
java.lang.Object
org.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.AbstractNetworkTopologySnitch
- All Implemented Interfaces:
IEndpointSnitch
- Direct Known Subclasses:
AlibabaCloudSnitch,AzureSnitch,CloudstackSnitch,Ec2Snitch,GoogleCloudSnitch,GossipingPropertyFileSnitch,PropertyFileSnitch,RackInferringSnitch
An endpoint snitch tells Cassandra information about network topology that it can use to route
requests more efficiently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareEndpoints(InetAddressAndPort address, Replica r1, Replica r2) compares two endpoints in relation to the target endpoint, returning as Comparator.compare wouldabstract StringgetDatacenter(InetAddressAndPort endpoint) Return the data center for which an endpoint resides inabstract StringgetRack(InetAddressAndPort endpoint) Return the rack for which an endpoint resides inMethods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
gossiperStarting, isWorthMergingForRangeQuery, sortedByProximityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.locator.IEndpointSnitch
getDatacenter, getDatacenter, getLocalDatacenter, getLocalRack, validate
-
Constructor Details
-
AbstractNetworkTopologySnitch
public AbstractNetworkTopologySnitch()
-
-
Method Details
-
getRack
Return the rack for which an endpoint resides in- Parameters:
endpoint- a specified endpoint- Returns:
- string of rack
-
getDatacenter
Return the data center for which an endpoint resides in- Parameters:
endpoint- a specified endpoint- Returns:
- string of data center
-
compareEndpoints
Description copied from interface:IEndpointSnitchcompares two endpoints in relation to the target endpoint, returning as Comparator.compare would- Specified by:
compareEndpointsin interfaceIEndpointSnitch- Specified by:
compareEndpointsin classAbstractEndpointSnitch
-