Package com.couchbase.client.core.retry
Interface RetryStrategy
-
- All Known Implementing Classes:
BestEffortRetryStrategy
,FailFastRetryStrategy
public interface RetryStrategy
Base interface for allRetryStrategy
implementations.- Since:
- 1.1.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
shouldRetry(CouchbaseRequest request, CoreEnvironment environment)
Decides whether the givenCouchbaseRequest
should be retried or cancelled.boolean
shouldRetryObserve()
Decides whetherObserveRequest
s should be retried or cancelled when an error happens.
-
-
-
Method Detail
-
shouldRetry
boolean shouldRetry(CouchbaseRequest request, CoreEnvironment environment)
Decides whether the givenCouchbaseRequest
should be retried or cancelled.- Parameters:
request
- the request in question.environment
- the environment for more context.- Returns:
- true if it should be retried, false otherwise.
-
shouldRetryObserve
boolean shouldRetryObserve()
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.- Returns:
- true if it should be retried, false otherwise.
-
-