public class CircuitBreakerConfig extends Object
CircuitBreaker
.Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreakerConfig.Builder |
Modifier and Type | Field and Description |
---|---|
static CircuitBreaker.CompletionCallback |
DEFAULT_COMPLETION_CALLBACK |
static boolean |
DEFAULT_ENABLED |
static int |
DEFAULT_ERROR_THRESHOLD_PERCENTAGE |
static Duration |
DEFAULT_ROLLING_WINDOW |
static Duration |
DEFAULT_SLEEP_WINDOW |
static int |
DEFAULT_VOLUME_THRESHOLD |
Modifier and Type | Method and Description |
---|---|
static CircuitBreakerConfig.Builder |
builder()
Creates a new builder to customize the configuration properties.
|
CircuitBreaker.CompletionCallback |
completionCallback() |
static CircuitBreakerConfig.Builder |
completionCallback(CircuitBreaker.CompletionCallback completionCallback) |
boolean |
enabled()
Returns true if this circuit breaker is enabled.
|
static CircuitBreakerConfig.Builder |
enabled(boolean enabled) |
int |
errorThresholdPercentage()
Returns the configured error threshold percentage after which the circuit possibly opens.
|
static CircuitBreakerConfig.Builder |
errorThresholdPercentage(int errorThresholdPercentage) |
Map<String,Object> |
exportAsMap() |
Duration |
rollingWindow()
Returns the configured rolling window duration which is considered to track the failed ops.
|
static CircuitBreakerConfig.Builder |
rollingWindow(Duration rollingWindow) |
Duration |
sleepWindow()
Returns the configured sleep window after which a canary is allowed to go through.
|
static CircuitBreakerConfig.Builder |
sleepWindow(Duration sleepWindow) |
int |
volumeThreshold()
Returns the volume threshold at which point the circuit will decide if it opens.
|
static CircuitBreakerConfig.Builder |
volumeThreshold(int volumeThreshold) |
public static final boolean DEFAULT_ENABLED
public static final int DEFAULT_VOLUME_THRESHOLD
public static final int DEFAULT_ERROR_THRESHOLD_PERCENTAGE
public static final Duration DEFAULT_SLEEP_WINDOW
public static final Duration DEFAULT_ROLLING_WINDOW
public static final CircuitBreaker.CompletionCallback DEFAULT_COMPLETION_CALLBACK
public static CircuitBreakerConfig.Builder builder()
CircuitBreakerConfig.Builder
to customize.public static CircuitBreakerConfig.Builder enabled(boolean enabled)
public static CircuitBreakerConfig.Builder volumeThreshold(int volumeThreshold)
public static CircuitBreakerConfig.Builder errorThresholdPercentage(int errorThresholdPercentage)
public static CircuitBreakerConfig.Builder sleepWindow(Duration sleepWindow)
public static CircuitBreakerConfig.Builder rollingWindow(Duration rollingWindow)
public static CircuitBreakerConfig.Builder completionCallback(CircuitBreaker.CompletionCallback completionCallback)
public boolean enabled()
public int volumeThreshold()
public int errorThresholdPercentage()
public Duration sleepWindow()
public Duration rollingWindow()
public CircuitBreaker.CompletionCallback completionCallback()
@Stability.Volatile public Map<String,Object> exportAsMap()
Copyright © 2024 Couchbase, Inc.. All rights reserved.