Package org.apache.cassandra.locator
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
The relevant replicas for an operation over a given range or token.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic interfacestatic classstatic classstatic classReplicaLayout.ForWrite<E extends Endpoints<E>> -
Method Summary
Modifier and TypeMethodDescriptionall()All relevant owners of the ring position(s) for this operation, as implied by the current ring layout.static ReplicaLayout.ForTokenReadforTokenReadLiveSorted(AbstractReplicationStrategy replicationStrategy, Token token) static ReplicaLayout.ForTokenWriteforTokenWrite(AbstractReplicationStrategy replicationStrategy, EndpointsForToken natural, EndpointsForToken pending) static ReplicaLayout.ForTokenWriteforTokenWriteLiveAndDown(Keyspace keyspace, Token token) Gets the 'natural' and 'pending' replicas that own a given token, with no filtering or processing.final Enatural()The 'natural' owners of the ring position(s), as implied by the current ring layout.toString()
-
Method Details
-
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
-
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
-
forTokenWriteLiveAndDown
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 conflictshaveWriteConflicts(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
-