Package org.apache.cassandra.locator
Class AlibabaCloudSnitch
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractEndpointSnitch
-
- org.apache.cassandra.locator.AbstractNetworkTopologySnitch
-
- org.apache.cassandra.locator.AlibabaCloudSnitch
-
- All Implemented Interfaces:
IEndpointSnitch
public class AlibabaCloudSnitch extends AbstractNetworkTopologySnitch
A snitch that assumes an ECS region is a DC and an ECS availability_zone is a rack. This information is available in the config for the node. the format of the zone-id is like :cn-hangzhou-a where cn means china, hangzhou means the hangzhou region, a means the az id. We use cn-hangzhou as the dc, and f as the zone-id.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
ecsRegion
protected java.lang.String
ecsZone
protected static org.slf4j.Logger
logger
protected static java.lang.String
ZONE_NAME_QUERY_URL
-
Constructor Summary
Constructors Constructor Description AlibabaCloudSnitch()
-
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 in-
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, validate
-
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
ZONE_NAME_QUERY_URL
protected static final java.lang.String ZONE_NAME_QUERY_URL
- See Also:
- Constant Field Values
-
ecsZone
protected java.lang.String ecsZone
-
ecsRegion
protected java.lang.String ecsRegion
-
-
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
-
-