类 AbstractCircuitBreaker

java.lang.Object
com.alibaba.csp.sentinel.slots.block.degrade.circuitbreaker.AbstractCircuitBreaker
所有已实现的接口:
CircuitBreaker
直接已知子类:
ExceptionCircuitBreaker, ResponseTimeCircuitBreaker

public abstract class AbstractCircuitBreaker extends Object implements CircuitBreaker
从以下版本开始:
1.8.0
作者:
Eric Zhao
  • 字段详细资料

    • rule

      protected final DegradeRule rule
    • recoveryTimeoutMs

      protected final int recoveryTimeoutMs
    • currentState

      protected final AtomicReference<CircuitBreaker.State> currentState
    • nextRetryTimestamp

      protected volatile long nextRetryTimestamp
  • 构造器详细资料

    • AbstractCircuitBreaker

      public AbstractCircuitBreaker(DegradeRule rule)
  • 方法详细资料

    • getRule

      public DegradeRule getRule()
      从接口复制的说明: CircuitBreaker
      Get the associated circuit breaking rule.
      指定者:
      getRule 在接口中 CircuitBreaker
      返回:
      associated circuit breaking rule
    • currentState

      public CircuitBreaker.State currentState()
      从接口复制的说明: CircuitBreaker
      Get current state of the circuit breaker.
      指定者:
      currentState 在接口中 CircuitBreaker
      返回:
      current state of the circuit breaker
    • tryPass

      public boolean tryPass(Context context)
      从接口复制的说明: CircuitBreaker
      Acquires permission of an invocation only if it is available at the time of invoking.
      指定者:
      tryPass 在接口中 CircuitBreaker
      参数:
      context - context of current invocation
      返回:
      true if permission was acquired and false otherwise
    • retryTimeoutArrived

      protected boolean retryTimeoutArrived()
    • updateNextRetryTimestamp

      protected void updateNextRetryTimestamp()
    • fromCloseToOpen

      protected boolean fromCloseToOpen(double snapshotValue)
    • fromOpenToHalfOpen

      protected boolean fromOpenToHalfOpen(Context context)
    • fromHalfOpenToOpen

      protected boolean fromHalfOpenToOpen(double snapshotValue)
    • fromHalfOpenToClose

      protected boolean fromHalfOpenToClose()
    • transformToOpen

      protected void transformToOpen(double triggerValue)