Class PaxosPropose<OnDone extends java.util.function.Consumer<? super org.apache.cassandra.service.paxos.PaxosPropose.Status>>
- java.lang.Object
-
- org.apache.cassandra.service.FailureRecordingCallback<T>
-
- org.apache.cassandra.service.paxos.PaxosRequestCallback<org.apache.cassandra.service.paxos.PaxosPropose.Response>
-
- org.apache.cassandra.service.paxos.PaxosPropose<OnDone>
-
- All Implemented Interfaces:
RequestCallback<org.apache.cassandra.service.paxos.PaxosPropose.Response>
,RequestCallbackWithFailure<org.apache.cassandra.service.paxos.PaxosPropose.Response>
public class PaxosPropose<OnDone extends java.util.function.Consumer<? super org.apache.cassandra.service.paxos.PaxosPropose.Status>> extends PaxosRequestCallback<org.apache.cassandra.service.paxos.PaxosPropose.Response>
In waitForNoSideEffect mode, we will not return failure to the caller until we have received a complete set of refusal responses, or at least one accept, indicating (respectively) that we have had no side effect, or that we cannot know if we our proposal produced a side effect.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PaxosPropose.RequestHandler
The proposal request handler, i.e.static class
PaxosPropose.RequestSerializer
static class
PaxosPropose.ResponseSerializer
-
Nested classes/interfaces inherited from class org.apache.cassandra.service.FailureRecordingCallback
FailureRecordingCallback.AsMap, FailureRecordingCallback.FailureResponses
-
-
Field Summary
Fields Modifier and Type Field Description static long
ACCEPT_INCREMENT
static long
FAILURE_INCREMENT
static long
REFUSAL_INCREMENT
static PaxosPropose.RequestHandler
requestHandler
static PaxosPropose.RequestSerializer
requestSerializer
static PaxosPropose.ResponseSerializer
responseSerializer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onFailure(InetAddressAndPort from, RequestFailureReason reason)
Called when there is an exception on the remote node or timeout happensvoid
onResponse(org.apache.cassandra.service.paxos.PaxosPropose.Response response, InetAddressAndPort from)
static <T> boolean
shouldSignal(long responses, int required, int participants, boolean waitForNoSideEffect, java.util.concurrent.atomic.AtomicLongFieldUpdater<T> responsesUpdater, T update)
-
Methods inherited from class org.apache.cassandra.service.paxos.PaxosRequestCallback
executeOnSelf, onResponse
-
Methods inherited from class org.apache.cassandra.service.FailureRecordingCallback
failureReasonsAsMap, onFailureWithMutex
-
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
trackLatencyForSnitch
-
Methods inherited from interface org.apache.cassandra.net.RequestCallbackWithFailure
invokeOnFailure
-
-
-
-
Field Detail
-
requestHandler
public static final PaxosPropose.RequestHandler requestHandler
-
requestSerializer
public static final PaxosPropose.RequestSerializer requestSerializer
-
responseSerializer
public static final PaxosPropose.ResponseSerializer responseSerializer
-
ACCEPT_INCREMENT
public static final long ACCEPT_INCREMENT
- See Also:
- Constant Field Values
-
REFUSAL_INCREMENT
public static final long REFUSAL_INCREMENT
- See Also:
- Constant Field Values
-
FAILURE_INCREMENT
public static final long FAILURE_INCREMENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
onResponse
public void onResponse(org.apache.cassandra.service.paxos.PaxosPropose.Response response, InetAddressAndPort from)
- Specified by:
onResponse
in classPaxosRequestCallback<org.apache.cassandra.service.paxos.PaxosPropose.Response>
-
onFailure
public void onFailure(InetAddressAndPort from, RequestFailureReason reason)
Description copied from interface:RequestCallbackWithFailure
Called when there is an exception on the remote node or timeout happens- Specified by:
onFailure
in interfaceRequestCallback<OnDone extends java.util.function.Consumer<? super org.apache.cassandra.service.paxos.PaxosPropose.Status>>
- Specified by:
onFailure
in interfaceRequestCallbackWithFailure<OnDone extends java.util.function.Consumer<? super org.apache.cassandra.service.paxos.PaxosPropose.Status>>
- Overrides:
onFailure
in classFailureRecordingCallback<org.apache.cassandra.service.paxos.PaxosPropose.Response>
-
shouldSignal
public static <T> boolean shouldSignal(long responses, int required, int participants, boolean waitForNoSideEffect, java.util.concurrent.atomic.AtomicLongFieldUpdater<T> responsesUpdater, T update)
-
-