Package org.apache.cassandra.locator
Class PropertyFileSnitch
java.lang.Object
org.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.AbstractNetworkTopologySnitch
org.apache.cassandra.locator.PropertyFileSnitch
- All Implemented Interfaces:
IEndpointSnitch
Used to determine if two IP's are in the same datacenter or on the same rack.
Based on a properties file in the following format: 10.0.0.13=DC1:RAC2 10.21.119.14=DC3:RAC2 10.20.114.15=DC2:RAC2 default=DC1:r1-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDatacenter(InetAddressAndPort endpoint) Return the data center for which an endpoint resides instatic String[]getEndpointInfo(InetAddressAndPort endpoint) Get the raw information about an end pointgetRack(InetAddressAndPort endpoint) Return the rack for which an endpoint resides invoidcalled after Gossiper instance exists immediately before it starts gossipingvoidreloadConfiguration(boolean isUpdate) Methods inherited from class org.apache.cassandra.locator.AbstractNetworkTopologySnitch
compareEndpointsMethods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
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
-
Field Details
-
SNITCH_PROPERTIES_FILENAME
- See Also:
-
-
Constructor Details
-
PropertyFileSnitch
- Throws:
ConfigurationException
-
PropertyFileSnitch
- Throws:
ConfigurationException
-
-
Method Details
-
getEndpointInfo
Get the raw information about an end point- Parameters:
endpoint- endpoint to process- Returns:
- a array of string with the first index being the data center and the second being the rack
-
getDatacenter
Return the data center for which an endpoint resides in- Specified by:
getDatacenterin interfaceIEndpointSnitch- Specified by:
getDatacenterin classAbstractNetworkTopologySnitch- Parameters:
endpoint- the endpoint to process- Returns:
- string of data center
-
getRack
Return the rack for which an endpoint resides in- Specified by:
getRackin interfaceIEndpointSnitch- Specified by:
getRackin classAbstractNetworkTopologySnitch- Parameters:
endpoint- the endpoint to process- Returns:
- string of rack
-
reloadConfiguration
- Throws:
ConfigurationException
-
gossiperStarting
public void gossiperStarting()Description copied from interface:IEndpointSnitchcalled after Gossiper instance exists immediately before it starts gossiping- Specified by:
gossiperStartingin interfaceIEndpointSnitch- Overrides:
gossiperStartingin classAbstractEndpointSnitch
-