Class ReplicaLayout<E extends Endpoints<E>>

java.lang.Object
org.apache.cassandra.locator.ReplicaLayout<E>
Type Parameters:
E -
Direct Known Subclasses:
ReplicaLayout.ForRangeRead, ReplicaLayout.ForTokenRead, ReplicaLayout.ForWrite

public abstract class ReplicaLayout<E extends Endpoints<E>> extends Object
The relevant replicas for an operation over a given range or token.
  • Method Details

    • natural

      public final E natural()
      The 'natural' owners of the ring position(s), as implied by the current ring layout. This excludes any pending owners, i.e. those that are in the process of taking ownership of a range, but have not yet finished obtaining their view of the range.
    • replicationStrategy

      public final AbstractReplicationStrategy replicationStrategy()
    • all

      public E all()
      All relevant owners of the ring position(s) for this operation, as implied by the current ring layout. For writes, this will include pending owners, and for reads it will be equivalent to natural()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • forTokenWriteLiveAndDown

      public static ReplicaLayout.ForTokenWrite forTokenWriteLiveAndDown(Keyspace keyspace, Token token)
      Gets the 'natural' and 'pending' replicas that own a given token, with no filtering or processing. Since a write is intended for all nodes (except, unless necessary, transient replicas), this method's only responsibility is to fetch the 'natural' and 'pending' replicas, then resolve any conflicts haveWriteConflicts(Endpoints, Endpoints)
    • forTokenWrite

      public static ReplicaLayout.ForTokenWrite forTokenWrite(AbstractReplicationStrategy replicationStrategy, EndpointsForToken natural, EndpointsForToken pending)
    • forTokenReadLiveSorted

      public static ReplicaLayout.ForTokenRead forTokenReadLiveSorted(AbstractReplicationStrategy replicationStrategy, Token token)
      Returns:
      the read layout for a token - this includes only live natural replicas, i.e. those that are not pending and not marked down by the failure detector. these are reverse sorted by the badness score of the configured snitch