org.apache.cassandra.locator

## Class OldNetworkTopologyStrategy

- java.lang.Object
- - org.apache.cassandra.locator.AbstractReplicationStrategy
  - - org.apache.cassandra.locator.OldNetworkTopologyStrategy

-     public class OldNetworkTopologyStrategy
      extends AbstractReplicationStrategy

  This Replication Strategy returns the nodes responsible for a given key but respects rack awareness. It places one replica in a different data center from the first (if there is any such data center), the third replica in a different rack in the first datacenter, and any remaining replicas on the first unused nodes on the ring.

- - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.locator.AbstractReplicationStrategy

      `configOptions, snitch`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OldNetworkTopologyStrategy(java.lang.String keyspaceName, TokenMetadata tokenMetadata, IEndpointSnitch snitch, java.util.Map<java.lang.String,java.lang.String> configOptions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<java.net.InetAddress>` | `calculateNaturalEndpoints(Token token, TokenMetadata metadata)` calculate the natural endpoints for the given token
    `int` | `getReplicationFactor()` calculate the RF based on strategy_options.
    `java.util.Collection<java.lang.String>` | `recognizedOptions()`
    `void` | `validateOptions()`

    - ### Methods inherited from class org.apache.cassandra.locator.AbstractReplicationStrategy

      `createReplicationStrategy, getAddressRanges, getAddressRanges, getCachedEndpoints, getClass, getNaturalEndpoints, getPendingAddressRanges, getPendingAddressRanges, getRangeAddresses, getWriteResponseHandler, hasSameSettings, validateReplicationFactor, validateReplicationStrategy`

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

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

- - ### Constructor Detail

    - #### OldNetworkTopologyStrategy

          public OldNetworkTopologyStrategy(java.lang.String keyspaceName,
                                            TokenMetadata tokenMetadata,
                                            IEndpointSnitch snitch,
                                            java.util.Map<java.lang.String,java.lang.String> configOptions)

  - ### Method Detail

    - #### calculateNaturalEndpoints

          public java.util.List<java.net.InetAddress> calculateNaturalEndpoints(Token token,
                                                                                TokenMetadata metadata)

      Description copied from class: `AbstractReplicationStrategy`
      calculate the natural endpoints for the given token
      Specified by:
        `calculateNaturalEndpoints` in class `AbstractReplicationStrategy`
      Parameters:
        `token` - the token the natural endpoints are requested for
      Returns:
        a copy of the natural endpoints for the given token
      See Also:
        `AbstractReplicationStrategy.getNaturalEndpoints(org.apache.cassandra.dht.RingPosition)`

    - #### getReplicationFactor

          public int getReplicationFactor()

      Description copied from class: `AbstractReplicationStrategy`
      calculate the RF based on strategy_options. When overwriting, ensure that this get() is FAST, as this is called often.
      Specified by:
        `getReplicationFactor` in class `AbstractReplicationStrategy`
      Returns:
        the replication factor

    - #### validateOptions

          public void validateOptions()
                               throws ConfigurationException

      Specified by:
        `validateOptions` in class `AbstractReplicationStrategy`
      Throws:
        `ConfigurationException`

    - #### recognizedOptions

          public java.util.Collection<java.lang.String> recognizedOptions()

      Overrides:
        `recognizedOptions` in class `AbstractReplicationStrategy`

Copyright © 2018 The Apache Software Foundation