Class CircuitBreakerConfig
java.lang.Object
com.couchbase.client.core.endpoint.CircuitBreakerConfig
Allows configuring a
CircuitBreaker.- Since:
- 2.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CircuitBreaker.CompletionCallbackstatic final booleanstatic final intstatic final Durationstatic final Durationstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic CircuitBreakerConfig.Builderbuilder()Creates a new builder to customize the configuration properties.static CircuitBreakerConfig.BuildercompletionCallback(CircuitBreaker.CompletionCallback completionCallback) booleanenabled()Returns true if this circuit breaker is enabled.static CircuitBreakerConfig.Builderenabled(boolean enabled) intReturns the configured error threshold percentage after which the circuit possibly opens.static CircuitBreakerConfig.BuildererrorThresholdPercentage(int errorThresholdPercentage) Returns the configured rolling window duration which is considered to track the failed ops.static CircuitBreakerConfig.BuilderrollingWindow(Duration rollingWindow) Returns the configured sleep window after which a canary is allowed to go through.static CircuitBreakerConfig.BuildersleepWindow(Duration sleepWindow) intReturns the volume threshold at which point the circuit will decide if it opens.static CircuitBreakerConfig.BuildervolumeThreshold(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.Builderto 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
-