public class PropertyFileSnitch extends AbstractNetworkTopologySnitch
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| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SNITCH_PROPERTIES_FILENAME |
| Constructor and Description |
|---|
PropertyFileSnitch() |
PropertyFileSnitch(int refreshPeriodInSeconds) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDatacenter(java.net.InetAddress endpoint)
Return the data center for which an endpoint resides in
|
static java.lang.String[] |
getEndpointInfo(java.net.InetAddress endpoint)
Get the raw information about an end point
|
java.lang.String |
getRack(java.net.InetAddress endpoint)
Return the rack for which an endpoint resides in
|
void |
gossiperStarting()
called after Gossiper instance exists immediately before it starts gossiping
|
void |
reloadConfiguration(boolean isUpdate) |
compareEndpointsgetSortedListByProximity, isWorthMergingForRangeQuery, sortByProximitypublic static final java.lang.String SNITCH_PROPERTIES_FILENAME
public PropertyFileSnitch()
throws ConfigurationException
ConfigurationExceptionpublic PropertyFileSnitch(int refreshPeriodInSeconds)
throws ConfigurationException
ConfigurationExceptionpublic static java.lang.String[] getEndpointInfo(java.net.InetAddress endpoint)
endpoint - endpoint to processpublic java.lang.String getDatacenter(java.net.InetAddress endpoint)
getDatacenter in interface IEndpointSnitchgetDatacenter in class AbstractNetworkTopologySnitchendpoint - the endpoint to processpublic java.lang.String getRack(java.net.InetAddress endpoint)
getRack in interface IEndpointSnitchgetRack in class AbstractNetworkTopologySnitchendpoint - the endpoint to processpublic void reloadConfiguration(boolean isUpdate)
throws ConfigurationException
ConfigurationExceptionpublic void gossiperStarting()
IEndpointSnitchgossiperStarting in interface IEndpointSnitchgossiperStarting in class AbstractEndpointSnitchCopyright © 2016 The Apache Software Foundation