Class CircuitBreakerRegistry
- java.lang.Object
-
- org.apache.solr.util.circuitbreaker.CircuitBreakerRegistry
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CircuitBreakerRegistry extends Object implements Closeable
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.- Since:
- 9.4
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description CircuitBreakerRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CircuitBreaker>
checkTripped(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType)
Check and return circuit breakers that have triggeredvoid
close()
void
deregisterAll()
boolean
isEnabled(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType)
void
register(CircuitBreaker circuitBreaker)
static String
toErrorMessage(List<CircuitBreaker> circuitBreakerList)
Construct the final error message to be printed when circuit breakers trip.
-
-
-
Method Detail
-
register
public void register(CircuitBreaker circuitBreaker)
-
deregisterAll
public void deregisterAll() throws IOException
- Throws:
IOException
-
checkTripped
public List<CircuitBreaker> checkTripped(org.apache.solr.client.solrj.SolrRequest.SolrRequestType requestType)
Check and return circuit breakers that have triggered- Parameters:
requestType
-SolrRequest.SolrRequestType
to check for.- Returns:
- CircuitBreakers which have triggered, null otherwise.
-
toErrorMessage
public static String toErrorMessage(List<CircuitBreaker> circuitBreakerList)
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
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-