Package org.apache.cassandra.locator
Class AzureSnitch
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractEndpointSnitch
-
- org.apache.cassandra.locator.AbstractNetworkTopologySnitch
-
- org.apache.cassandra.locator.AzureSnitch
-
- All Implemented Interfaces:
IEndpointSnitch
public class AzureSnitch extends AbstractNetworkTopologySnitch
AzureSnitch will resolve datacenter and rack by calling/metadata/instance/compute
endpoint returning the response in JSON format for API version2021-12-13
. The version of API is configurable via propertyazure_api_version
in cassandra-rackdc.properties.A datacenter is resolved from
location
field and a rack is resolved by looking intozone
field first. When zone is not set, or it is empty string, it will look intoplatformFaultDomain
field. Such resolved value is prepended byrack-
string.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector
connector
-
Constructor Summary
Constructors Constructor Description AzureSnitch()
AzureSnitch(org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector)
AzureSnitch(SnitchProperties properties)
-
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
getLocalDatacenter()
returns a String representing the datacenter current endpoint belongs tojava.lang.String
getLocalRack()
returns a String representing the rack current endpoint belongs tojava.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, getDatacenter, validate
-
-
-
-
Constructor Detail
-
AzureSnitch
public AzureSnitch() throws java.io.IOException
- Throws:
java.io.IOException
-
AzureSnitch
public AzureSnitch(SnitchProperties properties) throws java.io.IOException
- Throws:
java.io.IOException
-
AzureSnitch
public AzureSnitch(org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getLocalRack
public final java.lang.String getLocalRack()
Description copied from interface:IEndpointSnitch
returns a String representing the rack current endpoint belongs to
-
getLocalDatacenter
public final java.lang.String getLocalDatacenter()
Description copied from interface:IEndpointSnitch
returns a String representing the datacenter current endpoint belongs to
-
getRack
public final 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 final 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
-
-