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
Constructors Constructor Description ForWrite(Keyspace keyspace, AbstractReplicationStrategy replicationStrategy, ConsistencyLevel consistencyLevel, EndpointsForToken pending, EndpointsForToken liveAndDown, EndpointsForToken live, EndpointsForToken contact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAlive(Replica replica)
Test liveness, consistent with the upfront analysis done for this operation (i.e.EndpointsForToken
live()
The live replicas present in liveAndDown, usually derived from FailureDetector.isReplicaAliveEndpointsForToken
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)EndpointsForToken
liveUncontacted()
Calculate which live endpoints we could have contacted, but chose not toReplica
lookup(InetAddressAndPort endpoint)
EndpointsForToken
pending()
Replicas that a region of the ring is moving to; not yet ready to serve reads, but should receive writesjava.lang.String
toString()
ReplicaPlan.ForWrite
withContacts(EndpointsForToken newContact)
int
writeQuorum()
-
Methods inherited from class org.apache.cassandra.locator.ReplicaPlan.AbstractReplicaPlan
consistencyLevel, contacts, keyspace, replicationStrategy
-
-
-
-
Constructor Detail
-
ForWrite
public ForWrite(Keyspace keyspace, AbstractReplicationStrategy replicationStrategy, ConsistencyLevel consistencyLevel, EndpointsForToken pending, EndpointsForToken liveAndDown, EndpointsForToken live, EndpointsForToken contact)
-
-
Method Detail
-
writeQuorum
public int writeQuorum()
-
pending
public EndpointsForToken pending()
Replicas that a region of the ring is moving to; not yet ready to serve reads, but should receive writes
-
liveAndDown
public EndpointsForToken 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
public EndpointsForToken live()
The live replicas present in liveAndDown, usually derived from FailureDetector.isReplicaAlive
-
liveUncontacted
public EndpointsForToken liveUncontacted()
Calculate which live endpoints we could have contacted, but chose not to
-
isAlive
public boolean isAlive(Replica replica)
Test liveness, consistent with the upfront analysis done for this operation (i.e. test membership of live())
-
lookup
public Replica lookup(InetAddressAndPort endpoint)
-
withContacts
public ReplicaPlan.ForWrite withContacts(EndpointsForToken newContact)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-