Package org.elasticsearch.common.breaker
Class NoopCircuitBreaker
- java.lang.Object
-
- org.elasticsearch.common.breaker.NoopCircuitBreaker
-
- All Implemented Interfaces:
CircuitBreaker
public class NoopCircuitBreaker extends java.lang.Object implements CircuitBreaker
A CircuitBreaker that doesn't increment or adjust, and all operations are basically noops
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.breaker.CircuitBreaker
CircuitBreaker.Type
-
-
Field Summary
Fields Modifier and Type Field Description static intLIMIT-
Fields inherited from interface org.elasticsearch.common.breaker.CircuitBreaker
ACCOUNTING, FIELDDATA, IN_FLIGHT_REQUESTS, PARENT, REQUEST
-
-
Constructor Summary
Constructors Constructor Description NoopCircuitBreaker(java.lang.String name)
-
Method Summary
Modifier and Type Method Description doubleaddEstimateBytesAndMaybeBreak(long bytes, java.lang.String label)add bytes to the breaker and maybe triplongaddWithoutBreaking(long bytes)Adjust the circuit breaker without trippingvoidcircuitBreak(java.lang.String fieldName, long bytesNeeded)Trip the circuit breakerlonggetLimit()java.lang.StringgetName()doublegetOverhead()longgetTrippedCount()longgetUsed()
-
-
-
Field Detail
-
LIMIT
public static final int LIMIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
circuitBreak
public void circuitBreak(java.lang.String fieldName, long bytesNeeded)Description copied from interface:CircuitBreakerTrip the circuit breaker- Specified by:
circuitBreakin interfaceCircuitBreaker- Parameters:
fieldName- name of the field responsible for tripping the breakerbytesNeeded- bytes asked for but unable to be allocated
-
addEstimateBytesAndMaybeBreak
public double addEstimateBytesAndMaybeBreak(long bytes, java.lang.String label) throws CircuitBreakingExceptionDescription copied from interface:CircuitBreakeradd bytes to the breaker and maybe trip- Specified by:
addEstimateBytesAndMaybeBreakin interfaceCircuitBreaker- Parameters:
bytes- number of bytes to addlabel- string label describing the bytes being added- Returns:
- the number of "used" bytes for the circuit breaker
- Throws:
CircuitBreakingException
-
addWithoutBreaking
public long addWithoutBreaking(long bytes)
Description copied from interface:CircuitBreakerAdjust the circuit breaker without tripping- Specified by:
addWithoutBreakingin interfaceCircuitBreaker
-
getUsed
public long getUsed()
- Specified by:
getUsedin interfaceCircuitBreaker- Returns:
- the currently used bytes the breaker is tracking
-
getLimit
public long getLimit()
- Specified by:
getLimitin interfaceCircuitBreaker- Returns:
- maximum number of bytes the circuit breaker can track before tripping
-
getOverhead
public double getOverhead()
- Specified by:
getOverheadin interfaceCircuitBreaker- Returns:
- overhead of circuit breaker
-
getTrippedCount
public long getTrippedCount()
- Specified by:
getTrippedCountin interfaceCircuitBreaker- Returns:
- the number of times the circuit breaker has been tripped
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceCircuitBreaker- Returns:
- the name of the breaker
-
-