Class CircuitBreakerConfig
java.lang.Object
com.couchbase.client.core.endpoint.CircuitBreakerConfig
Allows configuring a
CircuitBreaker
.- Since:
- 2.0.0
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CircuitBreaker.CompletionCallback
static final boolean
static final int
static final Duration
static final Duration
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic CircuitBreakerConfig.Builder
builder()
Creates a new builder to customize the configuration properties.static CircuitBreakerConfig.Builder
completionCallback
(CircuitBreaker.CompletionCallback completionCallback) boolean
enabled()
Returns true if this circuit breaker is enabled.static CircuitBreakerConfig.Builder
enabled
(boolean enabled) int
Returns the configured error threshold percentage after which the circuit possibly opens.static CircuitBreakerConfig.Builder
errorThresholdPercentage
(int errorThresholdPercentage) Returns the configured rolling window duration which is considered to track the failed ops.static CircuitBreakerConfig.Builder
rollingWindow
(Duration rollingWindow) Returns the configured sleep window after which a canary is allowed to go through.static CircuitBreakerConfig.Builder
sleepWindow
(Duration sleepWindow) int
Returns the volume threshold at which point the circuit will decide if it opens.static CircuitBreakerConfig.Builder
volumeThreshold
(int volumeThreshold)
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED- See Also:
-
DEFAULT_VOLUME_THRESHOLD
public static final int DEFAULT_VOLUME_THRESHOLD- See Also:
-
DEFAULT_ERROR_THRESHOLD_PERCENTAGE
public static final int DEFAULT_ERROR_THRESHOLD_PERCENTAGE- See Also:
-
DEFAULT_SLEEP_WINDOW
-
DEFAULT_ROLLING_WINDOW
-
DEFAULT_COMPLETION_CALLBACK
-
-
Method Details
-
builder
Creates a new builder to customize the configuration properties.- Returns:
- a
CircuitBreakerConfig.Builder
to customize.
-
enabled
-
volumeThreshold
-
errorThresholdPercentage
-
sleepWindow
-
rollingWindow
-
completionCallback
public static CircuitBreakerConfig.Builder completionCallback(CircuitBreaker.CompletionCallback completionCallback) -
enabled
public boolean enabled()Returns true if this circuit breaker is enabled. -
volumeThreshold
public int volumeThreshold()Returns the volume threshold at which point the circuit will decide if it opens. -
errorThresholdPercentage
public int errorThresholdPercentage()Returns the configured error threshold percentage after which the circuit possibly opens. -
sleepWindow
Returns the configured sleep window after which a canary is allowed to go through. -
rollingWindow
Returns the configured rolling window duration which is considered to track the failed ops. -
completionCallback
-
exportAsMap
-