Package org.apache.beam.sdk.util
Class BackOffUtils
- java.lang.Object
-
- org.apache.beam.sdk.util.BackOffUtils
-
public final class BackOffUtils extends java.lang.Object
Utilities forBackOff
.Note: This is copied from Google API client library to avoid its dependency.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
next(Sleeper sleeper, BackOff backOff)
Runs the next iteration of the back-off policy, and returns whether to continue to retry the operation.
-
-
-
Method Detail
-
next
public static boolean next(Sleeper sleeper, BackOff backOff) throws java.lang.InterruptedException, java.io.IOException
Runs the next iteration of the back-off policy, and returns whether to continue to retry the operation.If
true
, it will callSleeper.sleep(long)
with the specified number of milliseconds fromBackOff.nextBackOffMillis()
.- Parameters:
sleeper
- sleeperbackOff
- back-off policy- Returns:
- whether to continue to back off; in other words, whether
BackOff.nextBackOffMillis()
did not returnBackOff.STOP
- Throws:
java.lang.InterruptedException
- if any thread has interrupted the current threadjava.io.IOException
-
-