public class YamlFileNetworkTopologySnitch extends AbstractNetworkTopologySnitch
This snitch supports connections over preferred addresses, such as a data-center-local address, based on the
reconnection trick used in Ec2MultiRegionSnitch
. The configuration file, cassandra-topology.yaml
, is
checked periodically for updates.
Modifier and Type | Class and Description |
---|---|
static class |
YamlFileNetworkTopologySnitch.Datacenter
Data center object type for the YAML topology configuration.
|
static class |
YamlFileNetworkTopologySnitch.Node
Node object type for the YAML topology configuration.
|
static class |
YamlFileNetworkTopologySnitch.Rack
Rack object type for the YAML topology configuration.
|
static class |
YamlFileNetworkTopologySnitch.TopologyConfig
Root object type for the YAML topology configuration.
|
Constructor and Description |
---|
YamlFileNetworkTopologySnitch()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatacenter(java.net.InetAddress endpoint)
Returns the name of the data center for the endpoint, or
UNKNOWN if not known. |
java.lang.String |
getRack(java.net.InetAddress endpoint)
Returns the name of the rack for the endpoint, or
UNKNOWN if not known. |
void |
gossiperStarting()
Called in preparation for the initiation of the gossip loop.
|
compareEndpoints
getSortedListByProximity, isWorthMergingForRangeQuery, sortByProximity
public YamlFileNetworkTopologySnitch() throws ConfigurationException
ConfigurationException
- on failurepublic java.lang.String getRack(java.net.InetAddress endpoint)
UNKNOWN
if not known.getRack
in interface IEndpointSnitch
getRack
in class AbstractNetworkTopologySnitch
endpoint
- a specified endpointUNKNOWN
if not knownpublic java.lang.String getDatacenter(java.net.InetAddress endpoint)
UNKNOWN
if not known.getDatacenter
in interface IEndpointSnitch
getDatacenter
in class AbstractNetworkTopologySnitch
endpoint
- a specified endpointUNKNOWN
if not knownpublic void gossiperStarting()
gossiperStarting
in interface IEndpointSnitch
gossiperStarting
in class AbstractEndpointSnitch
Copyright © 2015 The Apache Software Foundation