Class 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
    • Constructor Detail

      • NoopCircuitBreaker

        public NoopCircuitBreaker​(java.lang.String name)
    • Method Detail

      • circuitBreak

        public void circuitBreak​(java.lang.String fieldName,
                                 long bytesNeeded)
        Description copied from interface: CircuitBreaker
        Trip the circuit breaker
        Specified by:
        circuitBreak in interface CircuitBreaker
        Parameters:
        fieldName - name of the field responsible for tripping the breaker
        bytesNeeded - bytes asked for but unable to be allocated
      • getUsed

        public long getUsed()
        Specified by:
        getUsed in interface CircuitBreaker
        Returns:
        the currently used bytes the breaker is tracking
      • getLimit

        public long getLimit()
        Specified by:
        getLimit in interface CircuitBreaker
        Returns:
        maximum number of bytes the circuit breaker can track before tripping
      • getOverhead

        public double getOverhead()
        Specified by:
        getOverhead in interface CircuitBreaker
        Returns:
        overhead of circuit breaker
      • getTrippedCount

        public long getTrippedCount()
        Specified by:
        getTrippedCount in interface CircuitBreaker
        Returns:
        the number of times the circuit breaker has been tripped
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface CircuitBreaker
        Returns:
        the name of the breaker