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.Loggerlogger
-
Constructor Summary
Constructors Constructor Description Ec2Snitch()Ec2Snitch(SnitchProperties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDatacenter(InetAddressAndPort endpoint)Return the data center for which an endpoint resides injava.lang.StringgetRack(InetAddressAndPort endpoint)Return the rack for which an endpoint resides inbooleanvalidate(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.IOExceptionConfigurationException
-
Ec2Snitch
public Ec2Snitch(SnitchProperties props) throws java.io.IOException, ConfigurationException
- Throws:
java.io.IOExceptionConfigurationException
-
-
Method Detail
-
getRack
public java.lang.String getRack(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitchReturn the rack for which an endpoint resides in- Specified by:
getRackin interfaceIEndpointSnitch- Specified by:
getRackin classAbstractNetworkTopologySnitch- Parameters:
endpoint- a specified endpoint- Returns:
- string of rack
-
getDatacenter
public java.lang.String getDatacenter(InetAddressAndPort endpoint)
Description copied from class:AbstractNetworkTopologySnitchReturn the data center for which an endpoint resides in- Specified by:
getDatacenterin interfaceIEndpointSnitch- Specified by:
getDatacenterin 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:IEndpointSnitchDetermine if the datacenter or rack values in the current node's snitch conflict with those passed in parameters.
-
-