Class Backoff.Exponential
- java.lang.Object
-
- org.apache.bookkeeper.common.util.Backoff.Exponential
-
- All Implemented Interfaces:
Backoff.Policy
- Enclosing class:
- Backoff
public static class Backoff.Exponential extends java.lang.Object implements Backoff.Policy
A exponential backoff policy.
-
-
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 boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
int
getLimit()
long
getMaxMs()
int
getMultiplier()
long
getStartMs()
int
hashCode()
static Backoff.Exponential
of(long startMs, long maxMs, int multiplier)
Create an infinite exponential backoff policy.static Backoff.Exponential
of(long startMs, long maxMs, int multiplier, int limit)
java.util.stream.Stream<java.lang.Long>
toBackoffs()
Convert the policy into a series of backoff values.java.lang.String
toString()
-
-
-
Method Detail
-
of
public static Backoff.Exponential of(long startMs, long maxMs, int multiplier)
Create an infinite exponential backoff policy.It is the infinite version of
of(long, long, int, int)
.- Parameters:
startMs
- start backoff time in milliseconds.maxMs
- max backoff time in milliseconds.multiplier
- the backoff multiplier- Returns:
- the exponential backoff policy.
-
toBackoffs
public java.util.stream.Stream<java.lang.Long> toBackoffs()
Description copied from interface:Backoff.Policy
Convert the policy into a series of backoff values.- Specified by:
toBackoffs
in interfaceBackoff.Policy
- Returns:
- a series of backoff values.
-
of
public static Backoff.Exponential of(long startMs, long maxMs, int multiplier, int limit)
-
getStartMs
public long getStartMs()
-
getMaxMs
public long getMaxMs()
-
getMultiplier
public int getMultiplier()
-
getLimit
public int getLimit()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-