Package org.apache.cassandra.locator
Class Ec2Snitch
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractEndpointSnitch
-
- org.apache.cassandra.locator.AbstractNetworkTopologySnitch
-
- org.apache.cassandra.locator.Ec2Snitch
-
- All Implemented Interfaces:
IEndpointSnitch
- Direct Known Subclasses:
Ec2MultiRegionSnitch
public class Ec2Snitch extends AbstractNetworkTopologySnitch
A snitch that assumes an EC2 region is a DC and an EC2 availability_zone is a rack. This information is available in the config for the node.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description Ec2Snitch()
Ec2Snitch(SnitchProperties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDatacenter(InetAddressAndPort endpoint)
Return the data center for which an endpoint resides injava.lang.String
getRack(InetAddressAndPort endpoint)
Return the rack for which an endpoint resides inboolean
validate(java.util.Set<java.lang.String> datacenters, java.util.Set<java.lang.String> racks)
Determine if the datacenter or rack values in the current node's snitch conflict with those passed in parameters.-
Methods inherited from class org.apache.cassandra.locator.AbstractNetworkTopologySnitch
compareEndpoints
-
Methods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
gossiperStarting, isWorthMergingForRangeQuery, sortedByProximity
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.locator.IEndpointSnitch
getDatacenter, getLocalDatacenter, getLocalRack
-
-
-
-
Constructor Detail
-
Ec2Snitch
public Ec2Snitch() throws java.io.IOException, ConfigurationException
- Throws:
java.io.IOException
ConfigurationException
-
Ec2Snitch
public Ec2Snitch(SnitchProperties props) throws java.io.IOException, ConfigurationException
- Throws:
java.io.IOException
ConfigurationException
-
-
Method Detail
-
getRack
public java.lang.String getRack(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitch
Return the rack for which an endpoint resides in- Specified by:
getRack
in interfaceIEndpointSnitch
- Specified by:
getRack
in classAbstractNetworkTopologySnitch
- Parameters:
endpoint
- a specified endpoint- Returns:
- string of rack
-
getDatacenter
public java.lang.String getDatacenter(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitch
Return the data center for which an endpoint resides in- Specified by:
getDatacenter
in interfaceIEndpointSnitch
- Specified by:
getDatacenter
in classAbstractNetworkTopologySnitch
- Parameters:
endpoint
- a specified endpoint- Returns:
- string of data center
-
validate
public boolean validate(java.util.Set<java.lang.String> datacenters, java.util.Set<java.lang.String> racks)
Description copied from interface:IEndpointSnitch
Determine if the datacenter or rack values in the current node's snitch conflict with those passed in parameters.
-
-