Class CircuitBreakerRegistry
java.lang.Object
org.apache.solr.util.circuitbreaker.CircuitBreakerRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable
Keeps track of all registered circuit breaker instances for various request types. Responsible
for a holistic view of whether a circuit breaker has tripped or not. Circuit breakers may be
registered globally and/or per-core. This registry has one instance per core, but keeps a static
map of globally registered Circuit Breakers that are always checked.
- Since:
- 9.4
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckTripped(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType) Check and return circuit breakers that have triggeredvoidclose()voidstatic voidbooleanisEnabled(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType) static Set<CircuitBreaker> List all registered circuit breakers for global contextstatic List<CircuitBreaker> parseCircuitBreakersFromProperties(CoreContainer coreContainer) voidregister(CircuitBreaker circuitBreaker) Register a circuit breaker for a corestatic voidregisterGlobal(CircuitBreaker circuitBreaker) Register a global circuit breakerstatic StringtoErrorMessage(List<CircuitBreaker> circuitBreakerList) Construct the final error message to be printed when circuit breakers trip.
-
Field Details
-
SYSPROP_PREFIX
- See Also:
-
SYSPROP_UPDATE_CPU
- See Also:
-
SYSPROP_UPDATE_MEM
- See Also:
-
SYSPROP_UPDATE_LOADAVG
- See Also:
-
SYSPROP_QUERY_CPU
- See Also:
-
SYSPROP_QUERY_MEM
- See Also:
-
SYSPROP_QUERY_LOADAVG
- See Also:
-
SYSPROP_WARN_ONLY_SUFFIX
- See Also:
-
-
Constructor Details
-
CircuitBreakerRegistry
-
-
Method Details
-
parseCircuitBreakersFromProperties
-
listGlobal
List all registered circuit breakers for global context -
register
Register a circuit breaker for a core -
registerGlobal
Register a global circuit breaker -
deregisterAll
- Throws:
IOException
-
deregisterGlobal
public static void deregisterGlobal() -
checkTripped
public List<CircuitBreaker> checkTripped(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType) Check and return circuit breakers that have triggered- Parameters:
requestType-SolrRequest.SolrRequestTypeto check for.- Returns:
- CircuitBreakers which have triggered, null otherwise.
-
toErrorMessage
Construct the final error message to be printed when circuit breakers trip.- Parameters:
circuitBreakerList- Input list for circuit breakers.- Returns:
- Constructed error message.
-
isEnabled
public boolean isEnabled(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType) -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-