Package com.couchbase.client.core.retry
Class FailFastRetryStrategy
java.lang.Object
com.couchbase.client.core.retry.FailFastRetryStrategy
- All Implemented Interfaces:
RetryStrategy
A
RetryStrategy
that will never retry and cancel right away.- Since:
- 1.1.0
- Author:
- Michael Nitschinger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FailFastRetryStrategy
A reusable instance of this strategy. -
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldRetry
(CouchbaseRequest request, CoreEnvironment env) Decides whether the givenCouchbaseRequest
should be retried or cancelled.boolean
Decides whetherObserveRequest
s should be retried or cancelled when an error happens.toString()
-
Field Details
-
INSTANCE
A reusable instance of this strategy.
-
-
Method Details
-
shouldRetry
Description copied from interface:RetryStrategy
Decides whether the givenCouchbaseRequest
should be retried or cancelled.- Specified by:
shouldRetry
in interfaceRetryStrategy
- Parameters:
request
- the request in question.env
- the environment for more context.- Returns:
- true if it should be retried, false otherwise.
-
shouldRetryObserve
public boolean shouldRetryObserve()Description copied from interface:RetryStrategy
Decides whetherObserveRequest
s should be retried or cancelled when an error happens. When false is returned, as soon as an error happens (for example one of the nodes that need to be reached does not have an active partition because of a node failure) the whole observe sequence is aborted. If retried, errors are swallowed and the observe cycle will start again.- Specified by:
shouldRetryObserve
in interfaceRetryStrategy
- Returns:
- true if it should be retried, false otherwise.
-
toString
-