ChildMemoryCircuitBreaker
, MemoryCircuitBreaker
, NoopCircuitBreaker
public interface CircuitBreaker
Modifier and Type | Interface | Description |
---|---|---|
static class |
CircuitBreaker.Type |
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ACCOUNTING |
The accounting breaker tracks things held in memory that is independent
of the request lifecycle.
|
static java.lang.String |
FIELDDATA |
The fielddata breaker tracks data used for fielddata (on fields) as well
as the id cached used for parent/child queries.
|
static java.lang.String |
IN_FLIGHT_REQUESTS |
The in-flight request breaker tracks bytes allocated for reading and
writing requests on the network layer.
|
static java.lang.String |
PARENT |
The parent breaker is a sum of all the following breakers combined.
|
static java.lang.String |
REQUEST |
The request breaker tracks memory used for particular requests.
|
Modifier and Type | Method | Description |
---|---|---|
double |
addEstimateBytesAndMaybeBreak(long bytes,
java.lang.String label) |
add bytes to the breaker and maybe trip
|
long |
addWithoutBreaking(long bytes) |
Adjust the circuit breaker without tripping
|
void |
circuitBreak(java.lang.String fieldName,
long bytesNeeded) |
Trip the circuit breaker
|
long |
getLimit() |
|
java.lang.String |
getName() |
|
double |
getOverhead() |
|
long |
getTrippedCount() |
|
long |
getUsed() |
static final java.lang.String PARENT
static final java.lang.String FIELDDATA
static final java.lang.String REQUEST
static final java.lang.String IN_FLIGHT_REQUESTS
static final java.lang.String ACCOUNTING
void circuitBreak(java.lang.String fieldName, long bytesNeeded)
fieldName
- name of the field responsible for tripping the breakerbytesNeeded
- bytes asked for but unable to be allocateddouble addEstimateBytesAndMaybeBreak(long bytes, java.lang.String label) throws CircuitBreakingException
bytes
- number of bytes to addlabel
- string label describing the bytes being addedCircuitBreakingException
long addWithoutBreaking(long bytes)
long getUsed()
long getLimit()
double getOverhead()
long getTrippedCount()
java.lang.String getName()