TokenMetadata.Topology (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.locator

## Class TokenMetadata.Topology

- java.lang.Object
- - org.apache.cassandra.locator.TokenMetadata.Topology

- Enclosing class:
    TokenMetadata

      public static class TokenMetadata.Topology
      extends java.lang.Object

  Tracks the assignment of racks and endpoints in each datacenter for all the "normal" endpoints in this TokenMetadata. This allows faster calculation of endpoints in NetworkTopologyStrategy.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TokenMetadata.Topology()`
    `protected` | `TokenMetadata.Topology(TokenMetadata.Topology other)` construct deep-copy of other

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addEndpoint(java.net.InetAddress ep)` Stores current DC/rack assignment for ep
    `protected void` | `clear()`
    `com.google.common.collect.Multimap<java.lang.String,java.net.InetAddress>` | `getDatacenterEndpoints()`
    `java.util.Map<java.lang.String,com.google.common.collect.Multimap<java.lang.String,java.net.InetAddress>>` | `getDatacenterRacks()`
    `protected void` | `removeEndpoint(java.net.InetAddress ep)` Removes current DC/rack assignment for ep

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

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

- - ### Constructor Detail

    - #### TokenMetadata.Topology

          protected TokenMetadata.Topology()

    - #### TokenMetadata.Topology

          protected TokenMetadata.Topology(TokenMetadata.Topology other)

      construct deep-copy of other

  - ### Method Detail

    - #### clear

          protected void clear()

    - #### addEndpoint

          protected void addEndpoint(java.net.InetAddress ep)

      Stores current DC/rack assignment for ep

    - #### removeEndpoint

          protected void removeEndpoint(java.net.InetAddress ep)

      Removes current DC/rack assignment for ep

    - #### getDatacenterEndpoints

          public com.google.common.collect.Multimap<java.lang.String,java.net.InetAddress> getDatacenterEndpoints()

      Returns:
        multi-map of DC to endpoints in that DC

    - #### getDatacenterRacks

          public java.util.Map<java.lang.String,com.google.common.collect.Multimap<java.lang.String,java.net.InetAddress>> getDatacenterRacks()

      Returns:
        map of DC to multi-map of rack to endpoints in that rack

Copyright © 2014 The Apache Software Foundation