Class LoadAverageCircuitBreaker
- java.lang.Object
-
- org.apache.solr.util.circuitbreaker.CircuitBreaker
-
- org.apache.solr.util.circuitbreaker.LoadAverageCircuitBreaker
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,NamedListInitializedPlugin
public class LoadAverageCircuitBreaker extends CircuitBreaker
Tracks current system load average and triggers if the specified threshold is breached.This circuit breaker gets the load average (length of the run queue) over the last minute and uses that data to take a decision. We depend on OperatingSystemMXBean which does not allow a configurable interval of collection of data.
This Circuit breaker is dependent on the operating system, and may typically not work on Microsoft Windows.
-
-
Constructor Summary
Constructors Constructor Description LoadAverageCircuitBreaker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
calculateLiveLoadAverage()
String
getErrorMessage()
Get error message when the circuit breaker triggersdouble
getLoadAverageThreshold()
boolean
isTripped()
Check if circuit breaker is tripped.LoadAverageCircuitBreaker
setThreshold(double thresholdValueUnbounded)
-
Methods inherited from class org.apache.solr.util.circuitbreaker.CircuitBreaker
close, getErrorCode, getRequestTypes, init, setRequestTypes
-
-
-
-
Method Detail
-
isTripped
public boolean isTripped()
Description copied from class:CircuitBreaker
Check if circuit breaker is tripped.- Specified by:
isTripped
in classCircuitBreaker
-
getErrorMessage
public String getErrorMessage()
Description copied from class:CircuitBreaker
Get error message when the circuit breaker triggers- Specified by:
getErrorMessage
in classCircuitBreaker
-
setThreshold
public LoadAverageCircuitBreaker setThreshold(double thresholdValueUnbounded)
-
getLoadAverageThreshold
public double getLoadAverageThreshold()
-
calculateLiveLoadAverage
protected double calculateLiveLoadAverage()
-
-