public class PollingStrategies extends Object
PollingStrategies| Constructor and Description |
|---|
PollingStrategies() |
| Modifier and Type | Method and Description |
|---|---|
static PollingStrategy |
fixedInterval(long duration,
TimeUnit timeUnit)
Return a
PollingStrategy that polls at a fixed interval. |
static PollingStrategy |
initialDelay(PollingStrategy strategy,
long baseDuration,
long jitterDuration,
TimeUnit timeUnit)
A
PollingStrategy that will wait for a specified base amount of time plus some random jitter time
before performing the first poll. |
static PollingStrategy |
initialDelay(PollingStrategy strategy,
long duration,
TimeUnit timeUnit)
A
PollingStrategy that will wait for a specified amount of time before performing the first poll. |
public static PollingStrategy fixedInterval(long duration, TimeUnit timeUnit)
PollingStrategy that polls at a fixed interval.duration - time to wait in between pollstimeUnit - time unit of the waitpublic static PollingStrategy initialDelay(PollingStrategy strategy, long duration, TimeUnit timeUnit)
PollingStrategy that will wait for a specified amount of time before performing the first poll.
Every subsequent poll will be determined by the specified polling strategy.strategy - polling strategy to use after the first pollduration - time to wait before the first polltimeUnit - time unit of the waitpublic static PollingStrategy initialDelay(PollingStrategy strategy, long baseDuration, long jitterDuration, TimeUnit timeUnit)
PollingStrategy that will wait for a specified base amount of time plus some random jitter time
before performing the first poll. Every subsequent poll will be determined by the specified polling strategy.strategy - polling strategy to use after the first pollbaseDuration - wait at least this amount of time before the first polljitterDuration - maximum jitter time to add to the base durationtimeUnit - time unit of the waitCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.