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 java.lang.Object implements Backoff.Policy
A Jittered backoff policy.It is an implementation of {@link http://www.awsarchitectureblog.com/2015/03/backoff.html}
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBackoff.Jitter.TypeJitter type.
-
Field Summary
-
Fields inherited from interface org.apache.bookkeeper.common.util.Backoff.Policy
NONE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)longgetLimit()longgetMaxMs()longgetStartMs()Backoff.Jitter.TypegetType()inthashCode()static Backoff.Jitterof(Backoff.Jitter.Type type, long startMs, long maxMs)Create infinite jittered backoff stream.static Backoff.Jitterof(Backoff.Jitter.Type type, long startMs, long maxMs, long limit)java.util.stream.Stream<java.lang.Long>toBackoffs()Convert the policy into a series of backoff values.java.lang.StringtoString()
-
-
-
Method Detail
-
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 typestartMs- the start backoff time in milliseconds.maxMs- the max backoff time in milliseconds.- Returns:
- jittered backoff policy.
-
toBackoffs
public java.util.stream.Stream<java.lang.Long> toBackoffs()
Description copied from interface:Backoff.PolicyConvert the policy into a series of backoff values.- Specified by:
toBackoffsin interfaceBackoff.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(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-