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 ofRequestCallback
need 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 Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.static boolean
isTimeout(java.util.Map<InetAddressAndPort,RequestFailureReason> failureReasonByEndpoint)
default void
onFailure(InetAddressAndPort from, RequestFailureReason failureReason)
Called when there is an exception on the remote node or timeout happensvoid
onResponse(Message<T> msg)
default boolean
trackLatencyForSnitch()
-
-
-
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.
-
isTimeout
static boolean isTimeout(java.util.Map<InetAddressAndPort,RequestFailureReason> failureReasonByEndpoint)
-
-