类 Backoff

java.lang.Object
org.apache.pulsar.common.util.Backoff

public class Backoff extends Object
  • 字段详细资料

    • DEFAULT_INTERVAL_IN_NANOSECONDS

      public static final long DEFAULT_INTERVAL_IN_NANOSECONDS
    • MAX_BACKOFF_INTERVAL_NANOSECONDS

      public static final long MAX_BACKOFF_INTERVAL_NANOSECONDS
  • 构造器详细资料

    • Backoff

      public Backoff(long initial, TimeUnit unitInitial, long max, TimeUnit unitMax, long mandatoryStop, TimeUnit unitMandatoryStop)
  • 方法详细资料

    • next

      public long next()
    • reduceToHalf

      public void reduceToHalf()
    • reset

      public void reset()
    • shouldBackoff

      public static boolean shouldBackoff(long initialTimestamp, TimeUnit unitInitial, int failedAttempts, long defaultInterval, long maxBackoffInterval)
    • shouldBackoff

      public static boolean shouldBackoff(long initialTimestamp, TimeUnit unitInitial, int failedAttempts)