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.
CircuitBreaker.CircuitBreakerConfig
config, NAME
Constructor and Description |
---|
MemoryCircuitBreaker(CircuitBreaker.CircuitBreakerConfig config) |
Modifier and Type | Method and 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 triggers
|
boolean |
isTripped()
Check if circuit breaker is tripped.
|
isEnabled
public MemoryCircuitBreaker(CircuitBreaker.CircuitBreakerConfig config)
public boolean isTripped()
CircuitBreaker
isTripped
in class CircuitBreaker
public String getDebugInfo()
CircuitBreaker
getDebugInfo
in class CircuitBreaker
public String getErrorMessage()
CircuitBreaker
getErrorMessage
in class CircuitBreaker
protected long calculateLiveMemoryUsage()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.