Package org.apache.cassandra.locator
Class ReplicaPlan.ForWrite
java.lang.Object
org.apache.cassandra.locator.ReplicaPlan.AbstractReplicaPlan<EndpointsForToken,ReplicaPlan.ForWrite>
org.apache.cassandra.locator.ReplicaPlan.ForWrite
- All Implemented Interfaces:
ReplicaPlan<EndpointsForToken,ReplicaPlan.ForWrite>
- Direct Known Subclasses:
ReplicaPlan.ForPaxosWrite
- Enclosing interface:
- ReplicaPlan<E extends Endpoints<E>,
P extends ReplicaPlan<E, P>>
public static class ReplicaPlan.ForWrite
extends ReplicaPlan.AbstractReplicaPlan<EndpointsForToken,ReplicaPlan.ForWrite>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.locator.ReplicaPlan
ReplicaPlan.AbstractForRead<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E, P>>, ReplicaPlan.AbstractReplicaPlan<E extends Endpoints<E>, P extends ReplicaPlan<E, P>>, ReplicaPlan.ForFullRangeRead, ReplicaPlan.ForPaxosWrite, ReplicaPlan.ForRangeRead, ReplicaPlan.ForRead<E extends Endpoints<E>, P extends ReplicaPlan.ForRead<E, P>>, ReplicaPlan.ForTokenRead, ReplicaPlan.ForWrite, ReplicaPlan.Shared<E extends Endpoints<E>, P extends ReplicaPlan<E, P>>, ReplicaPlan.SharedForRangeRead, ReplicaPlan.SharedForTokenRead -
Field Summary
Fields inherited from class org.apache.cassandra.locator.ReplicaPlan.AbstractReplicaPlan
consistencyLevel, keyspace, replicationStrategy -
Constructor Summary
ConstructorsConstructorDescriptionForWrite(Keyspace keyspace, AbstractReplicationStrategy replicationStrategy, ConsistencyLevel consistencyLevel, EndpointsForToken pending, EndpointsForToken liveAndDown, EndpointsForToken live, EndpointsForToken contact) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest liveness, consistent with the upfront analysis done for this operation (i.e.live()The live replicas present in liveAndDown, usually derived from FailureDetector.isReplicaAliveReplicas that can participate in the write - this always includes all nodes (pending and natural) in all DCs, except for paxos LOCAL_QUORUM (which is local DC only)Calculate which live endpoints we could have contacted, but chose not tolookup(InetAddressAndPort endpoint) pending()Replicas that a region of the ring is moving to; not yet ready to serve reads, but should receive writestoString()withContacts(EndpointsForToken newContact) intMethods inherited from class org.apache.cassandra.locator.ReplicaPlan.AbstractReplicaPlan
consistencyLevel, contacts, keyspace, replicationStrategy
-
Constructor Details
-
ForWrite
public ForWrite(Keyspace keyspace, AbstractReplicationStrategy replicationStrategy, ConsistencyLevel consistencyLevel, EndpointsForToken pending, EndpointsForToken liveAndDown, EndpointsForToken live, EndpointsForToken contact)
-
-
Method Details
-
writeQuorum
public int writeQuorum() -
pending
Replicas that a region of the ring is moving to; not yet ready to serve reads, but should receive writes -
liveAndDown
Replicas that can participate in the write - this always includes all nodes (pending and natural) in all DCs, except for paxos LOCAL_QUORUM (which is local DC only) -
live
The live replicas present in liveAndDown, usually derived from FailureDetector.isReplicaAlive -
liveUncontacted
Calculate which live endpoints we could have contacted, but chose not to -
isAlive
Test liveness, consistent with the upfront analysis done for this operation (i.e. test membership of live()) -
lookup
-
withContacts
-
toString
-