Package com.couchbase.client.core.msg
Class CancellationReason
java.lang.Object
com.couchbase.client.core.msg.CancellationReason
public class CancellationReason extends Object
Describes the reason why a
Request
has been cancelled.- Since:
- 2.0.0
-
Field Summary
Fields Modifier and Type Field Description static CancellationReason
CANCELLED_VIA_CONTEXT
The user or some other code proactively cancelled the request by cancelling it through its attached context.static CancellationReason
OTHER
For a different reason.static CancellationReason
SHUTDOWN
The SDK has been shut down already when this request is dispatched.static CancellationReason
STOPPED_LISTENING
The downstream consumer stopped listening for a result and therefore any further processing is a waste of resources.static CancellationReason
TARGET_NODE_REMOVED
When aTargetedRequest
is dispatched but the list of nodes does not contain the target at all, there is good chance that this request will not be able to make progress anymore so it will be cancelled.static CancellationReason
TIMEOUT
The request ran into a timeout and is therefore cancelled before it got a chance to complete.static CancellationReason
TOO_MANY_REQUESTS_IN_RETRY
If too many outstanding requests are waiting to be completed. -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
String
identifier()
Returns the identifier for this reason.Object
innerReason()
If applicable, returns an inner reason for the cancellation for additional context.static CancellationReason
noMoreRetries(RetryReason retryReason)
This cancellation reason indicates that no more retries were allowed based on the retry strategy.String
toString()
-
Field Details
-
STOPPED_LISTENING
The downstream consumer stopped listening for a result and therefore any further processing is a waste of resources. -
TIMEOUT
The request ran into a timeout and is therefore cancelled before it got a chance to complete. -
CANCELLED_VIA_CONTEXT
The user or some other code proactively cancelled the request by cancelling it through its attached context. -
SHUTDOWN
The SDK has been shut down already when this request is dispatched. -
OTHER
For a different reason. Make sure to emit an event so that debugging provides further context. -
TOO_MANY_REQUESTS_IN_RETRY
If too many outstanding requests are waiting to be completed. This is the SDK backpressure signal. -
TARGET_NODE_REMOVED
When aTargetedRequest
is dispatched but the list of nodes does not contain the target at all, there is good chance that this request will not be able to make progress anymore so it will be cancelled.Request creators are advised to grab a fresh config, a new target, and re-dispatch the operation to give it a chance to make progress eventually.
-
-
Method Details
-
noMoreRetries
This cancellation reason indicates that no more retries were allowed based on the retry strategy.- Parameters:
retryReason
- the retry reason why it got sent into retry.- Returns:
- the cancellation reason instance.
-
innerReason
If applicable, returns an inner reason for the cancellation for additional context. -
identifier
Returns the identifier for this reason. -
toString
-
equals
-
hashCode
public int hashCode()
-