Class Backoff.Jitter

java.lang.Object
org.apache.bookkeeper.common.util.Backoff.Jitter
All Implemented Interfaces:
Backoff.Policy
Enclosing class:
Backoff

public static class Backoff.Jitter extends Object implements Backoff.Policy
A Jittered backoff policy.

It is an implementation of {@link http://www.awsarchitectureblog.com/2015/03/backoff.html}

  • Method Details

    • of

      public static Backoff.Jitter of(Backoff.Jitter.Type type, long startMs, long maxMs)
      Create infinite jittered backoff stream.

      It is the infinite version of of(Type, long, long, long).

      Parameters:
      type - jittered backoff type
      startMs - the start backoff time in milliseconds.
      maxMs - the max backoff time in milliseconds.
      Returns:
      jittered backoff policy.
    • toBackoffs

      public Stream<Long> toBackoffs()
      Description copied from interface: Backoff.Policy
      Convert the policy into a series of backoff values.
      Specified by:
      toBackoffs in interface Backoff.Policy
      Returns:
      a series of backoff values.
    • of

      public static Backoff.Jitter of(Backoff.Jitter.Type type, long startMs, long maxMs, long limit)
    • getType

      public Backoff.Jitter.Type getType()
    • getStartMs

      public long getStartMs()
    • getMaxMs

      public long getMaxMs()
    • getLimit

      public long getLimit()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object