Package org.apache.cassandra.net
Interface RequestCallback<T>
-
- All Known Subinterfaces:
RequestCallbackWithFailure<T>
- All Known Implementing Classes:
AbstractPaxosCallback,AbstractWriteResponseHandler,AsyncOneResponse,BatchlogResponseHandler,BlockingPartitionRepair,DatacenterSyncWriteResponseHandler,DatacenterWriteResponseHandler,FailureRecordingCallback,PaxosCleanupComplete,PaxosCleanupSession,PaxosCommit,PaxosFinishPrepareCleanup,PaxosPrepare,PaxosPrepareRefresh,PaxosPropose,PaxosRequestCallback,PaxosStartPrepareCleanup,PrepareCallback,ProposeCallback,ReadCallback,TruncateResponseHandler,WriteResponseHandler
public interface RequestCallback<T>implementors ofRequestCallbackneed to make sure that any public methods are threadsafe with respect toonResponse(org.apache.cassandra.net.Message<T>)being called from the message service. In particular, if any shared state is referenced, making response alone synchronized will not suffice.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleaninvokeOnFailure()Returns true if the callback handles failure reporting - in which case the remove host will be asked to report failures to us in the event of a problem processing the request.default voidonFailure(InetAddressAndPort from, RequestFailureReason failureReason)Called when there is an exception on the remote node or timeout happensvoidonResponse(Message<T> msg)default booleantrackLatencyForSnitch()
-
-
-
Method Detail
-
onFailure
default void onFailure(InetAddressAndPort from, RequestFailureReason failureReason)
Called when there is an exception on the remote node or timeout happens
-
invokeOnFailure
default boolean invokeOnFailure()
Returns true if the callback handles failure reporting - in which case the remove host will be asked to report failures to us in the event of a problem processing the request. TODO: this is an error prone method, and we should be handling failures everywhere so we should probably just start doing that, and remove this method- Returns:
- true if the callback should be invoked on failure
-
trackLatencyForSnitch
default boolean trackLatencyForSnitch()
- Returns:
- true if this callback is on the read path and its latency should be given as input to the dynamic snitch.
-
-