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 memoryCircuitBreakerThresholdPct 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 longcalculateLiveMemoryUsage()Calculate the live memory usage for the system.StringgetDebugInfo()Get debug useful info.StringgetErrorMessage()Get error message when the circuit breaker triggersbooleanisTripped()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:CircuitBreakerCheck if circuit breaker is tripped.- Specified by:
isTrippedin classCircuitBreaker
-
getDebugInfo
public String getDebugInfo()
Description copied from class:CircuitBreakerGet debug useful info.- Specified by:
getDebugInfoin classCircuitBreaker
-
getErrorMessage
public String getErrorMessage()
Description copied from class:CircuitBreakerGet error message when the circuit breaker triggers- Specified by:
getErrorMessagein 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.
-
-