public class ChildMemoryCircuitBreaker extends Object implements CircuitBreaker
CircuitBreaker.TypeFIELDDATA, IN_FLIGHT_REQUESTS, PARENT, REQUEST| Constructor and Description |
|---|
ChildMemoryCircuitBreaker(BreakerSettings settings,
ChildMemoryCircuitBreaker oldBreaker,
ESLogger logger,
HierarchyCircuitBreakerService parent,
String name)
Create a circuit breaker that will break if the number of estimated
bytes grows above the limit.
|
ChildMemoryCircuitBreaker(BreakerSettings settings,
ESLogger logger,
HierarchyCircuitBreakerService parent,
String name)
Create a circuit breaker that will break if the number of estimated
bytes grows above the limit.
|
| Modifier and Type | Method and Description |
|---|---|
double |
addEstimateBytesAndMaybeBreak(long bytes,
String label)
Add a number of bytes, tripping the circuit breaker if the aggregated
estimates are above the limit.
|
long |
addWithoutBreaking(long bytes)
Add an exact number of bytes, not checking for tripping the
circuit breaker.
|
void |
circuitBreak(String fieldName,
long bytesNeeded)
Method used to trip the breaker, delegates to the parent to determine
whether to trip the breaker or not
|
long |
getLimit() |
String |
getName() |
double |
getOverhead() |
long |
getTrippedCount() |
long |
getUsed() |
public ChildMemoryCircuitBreaker(BreakerSettings settings, ESLogger logger, HierarchyCircuitBreakerService parent, String name)
settings - settings to configure this breakerparent - parent circuit breaker service to delegate tripped breakers toname - the name of the breakerpublic ChildMemoryCircuitBreaker(BreakerSettings settings, ChildMemoryCircuitBreaker oldBreaker, ESLogger logger, HierarchyCircuitBreakerService parent, String name)
settings - settings to configure this breakerparent - parent circuit breaker service to delegate tripped breakers toname - the name of the breakeroldBreaker - the previous circuit breaker to inherit the used value from (starting offset)public void circuitBreak(String fieldName, long bytesNeeded)
circuitBreak in interface CircuitBreakerfieldName - name of the field responsible for tripping the breakerbytesNeeded - bytes asked for but unable to be allocatedpublic double addEstimateBytesAndMaybeBreak(long bytes,
String label)
throws CircuitBreakingException
addEstimateBytesAndMaybeBreak in interface CircuitBreakerbytes - number of bytes to add to the breakerlabel - string label describing the bytes being addedCircuitBreakingExceptionpublic long addWithoutBreaking(long bytes)
addWithoutBreaking in interface CircuitBreakerbytes - number of bytes to add to the breakerpublic long getUsed()
getUsed in interface CircuitBreakerpublic long getLimit()
getLimit in interface CircuitBreakerpublic double getOverhead()
getOverhead in interface CircuitBreakerpublic long getTrippedCount()
getTrippedCount in interface CircuitBreakerpublic String getName()
getName in interface CircuitBreakerCopyright © 2009–2017. All rights reserved.