CloudstackSnitch (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.locator

## Class CloudstackSnitch

- java.lang.Object
- - org.apache.cassandra.locator.AbstractEndpointSnitch
  - - org.apache.cassandra.locator.AbstractNetworkTopologySnitch
    - - org.apache.cassandra.locator.CloudstackSnitch

- All Implemented Interfaces:
    IEndpointSnitch

      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`

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `CloudstackSnitch()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDatacenter(java.net.InetAddress endpoint)` Return the data center for which an endpoint resides in
    `java.lang.String` | `getRack(java.net.InetAddress 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

      `getSortedListByProximity, gossiperStarting, isWorthMergingForRangeQuery, sortByProximity`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.slf4j.Logger logger

    - #### ZONE_NAME_QUERY_URI

          protected static final java.lang.String ZONE_NAME_QUERY_URI

      See Also:
        Constant Field Values

    - #### csZoneDc

          protected java.lang.String csZoneDc

    - #### csZoneRack

          protected java.lang.String csZoneRack

  - ### Constructor Detail

    - #### CloudstackSnitch

          public CloudstackSnitch()
                           throws java.io.IOException,
                                  ConfigurationException

      Throws:
        `java.io.IOException`
        `ConfigurationException`

  - ### Method Detail

    - #### getRack

          public java.lang.String getRack(java.net.InetAddress endpoint)

      Description copied from class: `AbstractNetworkTopologySnitch`
      Return the rack for which an endpoint resides in
      Specified by:
        `getRack` in interface `IEndpointSnitch`
      Specified by:
        `getRack` in class `AbstractNetworkTopologySnitch`
      Parameters:
        `endpoint` - a specified endpoint
      Returns:
        string of rack

    - #### getDatacenter

          public java.lang.String getDatacenter(java.net.InetAddress endpoint)

      Description copied from class: `AbstractNetworkTopologySnitch`
      Return the data center for which an endpoint resides in
      Specified by:
        `getDatacenter` in interface `IEndpointSnitch`
      Specified by:
        `getDatacenter` in class `AbstractNetworkTopologySnitch`
      Parameters:
        `endpoint` - a specified endpoint
      Returns:
        string of data center

Copyright © 2018 The Apache Software Foundation