Class AbstractSourceTask.Backoff

java.lang.Object
io.aiven.kafka.connect.common.source.AbstractSourceTask.Backoff
Enclosing class:
AbstractSourceTask

public static class AbstractSourceTask.Backoff extends Object
Performs a delay based on the number of successive delay() or cleanDelay() calls without a reset(). Delay increases exponentially but never exceeds the time remaining by more than 0.512 seconds.
  • Field Details

  • Constructor Details

  • Method Details

    • reset

      public final void reset()
      Reset the backoff time so that delay is again at the minimum.
    • estimatedDelay

      public long estimatedDelay()
      Calculates the delay without jitter.
      Returns:
      the number of milliseconds the delay will be.
    • getMaxJitter

      public int getMaxJitter()
      Calculates the range of jitter in milliseconds.
      Returns:
      the maximum jitter in milliseconds. jitter is +/- maximum jitter.
    • delay

      public void delay() throws InterruptedException
      Delay execution based on the number of times this method has been called.
      Throws:
      InterruptedException - If any thread interrupts this thread.
    • cleanDelay

      public void cleanDelay()
      Like delay() but swallows the InterruptedException.
    • toString

      public String toString()
      Overrides:
      toString in class Object