public class CloudstackSnitch extends AbstractNetworkTopologySnitch
A snitch that assumes a Cloudstack Zone follows the typical convention
<country>-<location>-<availability zone> and uses the country/location
tuple as a datacenter and the availability zone as a rack
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
csZoneDc |
protected java.lang.String |
csZoneRack |
protected static org.slf4j.Logger |
logger |
protected static java.lang.String |
ZONE_NAME_QUERY_URI |
Constructor and Description |
---|
CloudstackSnitch() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatacenter(InetAddressAndPort endpoint)
Return the data center for which an endpoint resides in
|
java.lang.String |
getRack(InetAddressAndPort endpoint)
Return the rack for which an endpoint resides in
|
compareEndpoints
gossiperStarting, isWorthMergingForRangeQuery, sortedByProximity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatacenter, getLocalDatacenter, getLocalRack, validate
protected static final org.slf4j.Logger logger
protected static final java.lang.String ZONE_NAME_QUERY_URI
protected java.lang.String csZoneDc
protected java.lang.String csZoneRack
public CloudstackSnitch() throws java.io.IOException, ConfigurationException
java.io.IOException
ConfigurationException
public java.lang.String getRack(InetAddressAndPort endpoint)
AbstractNetworkTopologySnitch
getRack
in interface IEndpointSnitch
getRack
in class AbstractNetworkTopologySnitch
endpoint
- a specified endpointpublic java.lang.String getDatacenter(InetAddressAndPort endpoint)
AbstractNetworkTopologySnitch
getDatacenter
in interface IEndpointSnitch
getDatacenter
in class AbstractNetworkTopologySnitch
endpoint
- a specified endpointCopyright © 2009-2022 The Apache Software Foundation