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 of
RequestCallback need to make sure that any public methods
are threadsafe with respect to onResponse(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
Modifier and TypeMethodDescriptiondefault booleanReturns 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 booleanisTimeout(Map<InetAddressAndPort, RequestFailureReason> failureReasonByEndpoint) default voidonFailure(InetAddressAndPort from, RequestFailureReason failureReason) Called when there is an exception on the remote node or timeout happensvoidonResponse(Message<T> msg) default boolean
-
Method Details
-
onResponse
- Parameters:
msg- response received.
-
onFailure
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
-