Package org.apache.cassandra.net
Class RequestCallbacks
- java.lang.Object
-
- org.apache.cassandra.net.RequestCallbacks
-
public class RequestCallbacks extends java.lang.ObjectAn expiring map of request callbacks. Used to match response (id, peer) pairs to correspondingRequestCallbacks, 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 Modifier and Type Class Description static classRequestCallbacks.CallbackInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWithExpiration(RequestCallback<?> cb, Message<?> message, InetAddressAndPort to)Register the providedRequestCallback, inferring expiry and id from the providedMessage.voidaddWithExpiration(AbstractWriteResponseHandler<?> cb, Message<?> message, Replica to)static longdefaultExpirationInterval()voidonDiscardOnClose(Message<?> message, InetAddressAndPort peer)voidonExpired(Message<?> message, InetAddressAndPort peer)voidonFailedSerialize(Message<?> message, InetAddressAndPort peer, int messagingVersion, int bytesWrittenToNetwork, java.lang.Throwable failure)voidonOverloaded(Message<?> message, InetAddressAndPort peer)RequestCallbacks.CallbackInforemove(long id, InetAddressAndPort peer)Remove and return theRequestCallbacks.CallbackInfoassociated with given id and peer, if known.voidremoveAndRespond(long id, InetAddressAndPort peer, Message message)voidunsafeClear()
-
-
-
Method Detail
-
remove
@Nullable public RequestCallbacks.CallbackInfo remove(long id, InetAddressAndPort peer)
Remove and return theRequestCallbacks.CallbackInfoassociated with given id and peer, if known.
-
addWithExpiration
public void addWithExpiration(RequestCallback<?> cb, Message<?> message, InetAddressAndPort to)
Register the providedRequestCallback, inferring expiry and id from the providedMessage.
-
addWithExpiration
public void addWithExpiration(AbstractWriteResponseHandler<?> cb, Message<?> message, Replica to)
-
removeAndRespond
public void removeAndRespond(long id, InetAddressAndPort peer, Message message)
-
unsafeClear
public void unsafeClear()
-
onOverloaded
public void onOverloaded(Message<?> message, InetAddressAndPort peer)
-
onExpired
public void onExpired(Message<?> message, InetAddressAndPort peer)
-
onFailedSerialize
public void onFailedSerialize(Message<?> message, InetAddressAndPort peer, int messagingVersion, int bytesWrittenToNetwork, java.lang.Throwable failure)
-
onDiscardOnClose
public void onDiscardOnClose(Message<?> message, InetAddressAndPort peer)
-
defaultExpirationInterval
public static long defaultExpirationInterval()
-
-