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
public abstract class ReplicaLayout<E extends Endpoints<E>> extends java.lang.ObjectThe relevant replicas for an operation over a given range or token.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceReplicaLayout.ForRangestatic classReplicaLayout.ForRangeReadstatic interfaceReplicaLayout.ForTokenstatic classReplicaLayout.ForTokenReadstatic classReplicaLayout.ForTokenWritestatic classReplicaLayout.ForWrite<E extends Endpoints<E>>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Eall()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.Enatural()The 'natural' owners of the ring position(s), as implied by the current ring layout.AbstractReplicationStrategyreplicationStrategy()java.lang.StringtoString()
-
-
-
Method Detail
-
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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.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 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
-
-