Class MemoryCircuitBreaker
- java.lang.Object
-
- org.apache.solr.util.circuitbreaker.CircuitBreaker
-
- org.apache.solr.util.circuitbreaker.MemoryCircuitBreaker
-
public class MemoryCircuitBreaker extends CircuitBreaker
Tracks the current JVM heap usage and triggers if it exceeds the defined percentage of the maximum heap size allocated to the JVM. This circuit breaker is a part of the default CircuitBreakerManager so is checked for every request -- hence it is realtime. Once the memory usage goes below the threshold, it will start allowing queries again.The memory threshold is defined as a percentage of the maximum memory allocated -- see memThreshold 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 MemoryCircuitBreaker(CircuitBreaker.CircuitBreakerConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
calculateLiveMemoryUsage()
Calculate the live memory usage for the system.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
-
MemoryCircuitBreaker
public MemoryCircuitBreaker(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
-
calculateLiveMemoryUsage
protected long calculateLiveMemoryUsage()
Calculate the live memory usage for the system. This method has package visibility to allow using for testing.- Returns:
- Memory usage in bytes.
-
-