public class BestEffortRetryStrategy extends Object implements RetryStrategy
A RetryStrategy
that will retry until the max request lifetime is reached.
Modifier and Type | Field and Description |
---|---|
static BestEffortRetryStrategy |
INSTANCE
A reusable instance of this strategy.
|
Modifier and Type | Method and Description |
---|---|
boolean |
shouldRetry(CouchbaseRequest request,
CoreEnvironment env)
Decides whether the given
CouchbaseRequest should be retried or cancelled. |
boolean |
shouldRetryObserve()
Decides whether
ObserveRequest s should be retried or cancelled when an error happens. |
String |
toString() |
public static final BestEffortRetryStrategy INSTANCE
A reusable instance of this strategy.
public boolean shouldRetry(CouchbaseRequest request, CoreEnvironment env)
RetryStrategy
Decides whether the given CouchbaseRequest
should be retried or cancelled.
shouldRetry
in interface RetryStrategy
request
- the request in question.env
- the environment for more context.public boolean shouldRetryObserve()
RetryStrategy
Decides whether ObserveRequest
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.
shouldRetryObserve
in interface RetryStrategy
Copyright © 2018 Couchbase, Inc.. All rights reserved.