Class CPUCircuitBreaker
- java.lang.Object
-
- org.apache.solr.util.circuitbreaker.CircuitBreaker
-
- org.apache.solr.util.circuitbreaker.CPUCircuitBreaker
-
public class CPUCircuitBreaker extends CircuitBreaker
Tracks current CPU usage and triggers if the specified threshold is breached.This circuit breaker gets the average CPU load 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. //TODO: Use Codahale Meter to calculate the value locally.
The configuration to define which mode to use and the trigger threshold are defined in solrconfig.xml
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.util.circuitbreaker.CircuitBreaker
CircuitBreaker.CircuitBreakerConfig
-
-
Field Summary
-
Fields inherited from class org.apache.solr.util.circuitbreaker.CircuitBreaker
config, NAME
-
-
Constructor Summary
Constructors Constructor Description CPUCircuitBreaker(CircuitBreaker.CircuitBreakerConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
calculateLiveCPUUsage()
double
getCpuUsageThreshold()
String
getDebugInfo()
Get debug useful info.String
getErrorMessage()
Get error message when the circuit breaker triggersboolean
isTripped()
Check if circuit breaker is tripped.-
Methods inherited from class org.apache.solr.util.circuitbreaker.CircuitBreaker
isEnabled
-
-
-
-
Constructor Detail
-
CPUCircuitBreaker
public CPUCircuitBreaker(CircuitBreaker.CircuitBreakerConfig config)
-
-
Method Detail
-
isTripped
public boolean isTripped()
Description copied from class:CircuitBreaker
Check if circuit breaker is tripped.- Specified by:
isTripped
in classCircuitBreaker
-
getDebugInfo
public String getDebugInfo()
Description copied from class:CircuitBreaker
Get debug useful info.- Specified by:
getDebugInfo
in classCircuitBreaker
-
getErrorMessage
public String getErrorMessage()
Description copied from class:CircuitBreaker
Get error message when the circuit breaker triggers- Specified by:
getErrorMessage
in classCircuitBreaker
-
getCpuUsageThreshold
public double getCpuUsageThreshold()
-
calculateLiveCPUUsage
protected double calculateLiveCPUUsage()
-
-