Class ProposeCallback
java.lang.Object
org.apache.cassandra.service.paxos.v1.AbstractPaxosCallback<Boolean>
org.apache.cassandra.service.paxos.v1.ProposeCallback
- All Implemented Interfaces:
RequestCallback<Boolean>
ProposeCallback has two modes of operation, controlled by the failFast parameter.
In failFast mode, we will return a failure as soon as a majority of nodes reject
the proposal. This is used when replaying a proposal from an earlier leader.
Otherwise, we wait for either all replicas to respond or until we achieve
the desired quorum. We continue to wait for all replicas even after we know we cannot succeed
because we need to know if no node at all have accepted or if at least one has.
In the former case, a proposer is guaranteed no-one will
replay its value; in the latter we don't, so we must timeout in case another
leader replays it before we can; see CASSANDRA-6013
-
Field Summary
Fields inherited from class org.apache.cassandra.service.paxos.v1.AbstractPaxosCallback
latch, targets -
Constructor Summary
ConstructorsConstructorDescriptionProposeCallback(int totalTargets, int requiredTargets, boolean failFast, ConsistencyLevel consistency, Dispatcher.RequestTime requestTime) -
Method Summary
Methods inherited from class org.apache.cassandra.service.paxos.v1.AbstractPaxosCallback
await, getResponseCount, invokeOnFailure, onFailureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.net.RequestCallback
trackLatencyForSnitch
-
Constructor Details
-
ProposeCallback
public ProposeCallback(int totalTargets, int requiredTargets, boolean failFast, ConsistencyLevel consistency, Dispatcher.RequestTime requestTime)
-
-
Method Details
-
onResponse
- Parameters:
msg- response received.
-
getAcceptCount
public int getAcceptCount() -
isSuccessful
public boolean isSuccessful() -
isFullyRefused
public boolean isFullyRefused()
-