Class Backoff

java.lang.Object
org.apache.pulsar.client.impl.Backoff

public class Backoff extends Object
  • Field Details

    • DEFAULT_INTERVAL_IN_NANOSECONDS

      public static final long DEFAULT_INTERVAL_IN_NANOSECONDS
    • MAX_BACKOFF_INTERVAL_NANOSECONDS

      public static final long MAX_BACKOFF_INTERVAL_NANOSECONDS
  • Constructor Details

    • Backoff

      public Backoff(long initial, TimeUnit unitInitial, long max, TimeUnit unitMax, long mandatoryStop, TimeUnit unitMandatoryStop)
  • Method Details

    • 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)