Package org.apache.cassandra.net
Class RequestCallbacks
java.lang.Object
org.apache.cassandra.net.RequestCallbacks
An expiring map of request callbacks.
Used to match response (id, peer) pairs to corresponding
RequestCallbacks, or, if said responses
don't arrive in a timely manner (within verb's timeout), to expire the callbacks.
Since we reuse the same request id for multiple messages now, the map is keyed by (id, peer) tuples
rather than just id as it used to before 4.0.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWithExpiration(RequestCallback<?> cb, Message<?> message, InetAddressAndPort to) Register the providedRequestCallback, inferring expiry and id from the providedMessage.voidaddWithExpiration(AbstractWriteResponseHandler<?> cb, Message<?> message, Replica to) static longvoidonDiscardOnClose(Message<?> message, InetAddressAndPort peer) voidonExpired(Message<?> message, InetAddressAndPort peer) voidonFailedSerialize(Message<?> message, InetAddressAndPort peer, int messagingVersion, int bytesWrittenToNetwork, Throwable failure) voidonOverloaded(Message<?> message, InetAddressAndPort peer) remove(long id, InetAddressAndPort peer) Remove and return theRequestCallbacks.CallbackInfoassociated with given id and peer, if known.voidremoveAndRespond(long id, InetAddressAndPort peer, Message message) void
-
Method Details
-
remove
Remove and return theRequestCallbacks.CallbackInfoassociated with given id and peer, if known. -
addWithExpiration
Register the providedRequestCallback, inferring expiry and id from the providedMessage. -
addWithExpiration
-
removeAndRespond
-
unsafeClear
public void unsafeClear() -
onOverloaded
-
onExpired
-
onFailedSerialize
public void onFailedSerialize(Message<?> message, InetAddressAndPort peer, int messagingVersion, int bytesWrittenToNetwork, Throwable failure) -
onDiscardOnClose
-
defaultExpirationInterval
public static long defaultExpirationInterval()
-