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.Object
The relevant replicas for an operation over a given range or token.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ReplicaLayout.ForRange
static class
ReplicaLayout.ForRangeRead
static interface
ReplicaLayout.ForToken
static class
ReplicaLayout.ForTokenRead
static class
ReplicaLayout.ForTokenWrite
static class
ReplicaLayout.ForWrite<E extends Endpoints<E>>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description E
all()
All relevant owners of the ring position(s) for this operation, as implied by the current ring layout.static ReplicaLayout.ForTokenRead
forTokenReadLiveSorted(AbstractReplicationStrategy replicationStrategy, Token token)
static ReplicaLayout.ForTokenWrite
forTokenWrite(AbstractReplicationStrategy replicationStrategy, EndpointsForToken natural, EndpointsForToken pending)
static ReplicaLayout.ForTokenWrite
forTokenWriteLiveAndDown(Keyspace keyspace, Token token)
Gets the 'natural' and 'pending' replicas that own a given token, with no filtering or processing.E
natural()
The 'natural' owners of the ring position(s), as implied by the current ring layout.AbstractReplicationStrategy
replicationStrategy()
java.lang.String
toString()
-
-
-
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:
toString
in 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
-
-