Class ProposeCallback
- java.lang.Object
-
- org.apache.cassandra.service.paxos.v1.AbstractPaxosCallback<java.lang.Boolean>
-
- org.apache.cassandra.service.paxos.v1.ProposeCallback
-
- All Implemented Interfaces:
RequestCallback<java.lang.Boolean>
public class ProposeCallback extends AbstractPaxosCallback<java.lang.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
Constructors Constructor Description ProposeCallback(int totalTargets, int requiredTargets, boolean failFast, ConsistencyLevel consistency, long queryStartNanoTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAcceptCount()
boolean
isFullyRefused()
boolean
isSuccessful()
void
onResponse(Message<java.lang.Boolean> msg)
-
Methods inherited from class org.apache.cassandra.service.paxos.v1.AbstractPaxosCallback
await, getResponseCount
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.net.RequestCallback
invokeOnFailure, onFailure, trackLatencyForSnitch
-
-
-
-
Constructor Detail
-
ProposeCallback
public ProposeCallback(int totalTargets, int requiredTargets, boolean failFast, ConsistencyLevel consistency, long queryStartNanoTime)
-
-
Method Detail
-
onResponse
public void onResponse(Message<java.lang.Boolean> msg)
- Parameters:
msg
- response received.
-
getAcceptCount
public int getAcceptCount()
-
isSuccessful
public boolean isSuccessful()
-
isFullyRefused
public boolean isFullyRefused()
-
-