public abstract class CircuitBreaker extends Object
There are two (typical) ways to use circuit breakers: 1. Have them checked at admission control by default (use CircuitBreakerManager for the same). 2. Use the circuit breaker in a specific code path(s). TODO: This class should be grown as the scope of circuit breakers grow. The class and its derivatives raise a standard exception when a circuit breaker is triggered. We should make it into a dedicated exception (https://issues.apache.org/jira/browse/SOLR-14755)
Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreaker.CircuitBreakerConfig
Represents the configuration for a circuit breaker
|
Modifier and Type | Field and Description |
---|---|
protected CircuitBreaker.CircuitBreakerConfig |
config |
static String |
NAME |
Constructor and Description |
---|
CircuitBreaker(CircuitBreaker.CircuitBreakerConfig config) |
Modifier and Type | Method and Description |
---|---|
abstract String |
getDebugInfo()
Get debug useful info.
|
abstract String |
getErrorMessage()
Get error message when the circuit breaker triggers
|
protected boolean |
isEnabled()
Global config for all circuit breakers.
|
abstract boolean |
isTripped()
Check if circuit breaker is tripped.
|
public static final String NAME
protected final CircuitBreaker.CircuitBreakerConfig config
public CircuitBreaker(CircuitBreaker.CircuitBreakerConfig config)
protected boolean isEnabled()
public abstract boolean isTripped()
public abstract String getDebugInfo()
public abstract String getErrorMessage()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.