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
AzureSnitch will resolve datacenter and rack by calling
/metadata/instance/compute endpoint returning
the response in JSON format for API version 2021-12-13. The version of API is configurable via property
azure_api_version in cassandra-rackdc.properties.
A datacenter is resolved from location field and a rack is resolved by looking into zone field first.
When zone is not set, or it is empty string, it will look into platformFaultDomain field. Such resolved
value is prepended by rack- string.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector -
Constructor Summary
ConstructorsConstructorDescriptionAzureSnitch(org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector) AzureSnitch(SnitchProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetDatacenter(InetAddressAndPort endpoint) Return the data center for which an endpoint resides infinal Stringreturns a String representing the datacenter current endpoint belongs tofinal Stringreturns a String representing the rack current endpoint belongs tofinal StringgetRack(InetAddressAndPort endpoint) Return the rack for which an endpoint resides inMethods inherited from class org.apache.cassandra.locator.AbstractNetworkTopologySnitch
compareEndpointsMethods inherited from class org.apache.cassandra.locator.AbstractEndpointSnitch
gossiperStarting, isWorthMergingForRangeQuery, sortedByProximityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.locator.IEndpointSnitch
getDatacenter, getDatacenter, validate
-
Field Details
-
connector
protected final org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector
-
-
Constructor Details
-
AzureSnitch
- Throws:
IOException
-
AzureSnitch
- Throws:
IOException
-
AzureSnitch
public AzureSnitch(org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector) throws IOException - Throws:
IOException
-
-
Method Details
-
getLocalRack
Description copied from interface:IEndpointSnitchreturns a String representing the rack current endpoint belongs to -
getLocalDatacenter
Description copied from interface:IEndpointSnitchreturns a String representing the datacenter current endpoint belongs to -
getRack
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
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
-