Package org.apache.cassandra.locator
Class GoogleCloudSnitch
java.lang.Object
org.apache.cassandra.locator.AbstractEndpointSnitch
org.apache.cassandra.locator.AbstractNetworkTopologySnitch
org.apache.cassandra.locator.GoogleCloudSnitch
- All Implemented Interfaces:
IEndpointSnitch
A snitch that assumes an GCE region is a DC and an GCE availability_zone
is a rack. This information is available in the config for the node.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector -
Constructor Summary
ConstructorsConstructorDescriptionGoogleCloudSnitch(org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector connector) GoogleCloudSnitch(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
-
GoogleCloudSnitch
- Throws:
IOException
-
GoogleCloudSnitch
- Throws:
IOException
-
GoogleCloudSnitch
public GoogleCloudSnitch(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
-