Package com.uber.cadence.internal.worker
Class PollerOptions.Builder
- java.lang.Object
-
- com.uber.cadence.internal.worker.PollerOptions.Builder
-
- Enclosing class:
- PollerOptions
public static final class PollerOptions.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PollerOptions
build()
PollerOptions.Builder
setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
Defines interval for measuring poll rate.PollerOptions.Builder
setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
Maximum rate of polling.PollerOptions.Builder
setPollBackoffCoefficient(double pollBackoffCoefficient)
Coefficient to use when calculating exponential delay in case of failuresPollerOptions.Builder
setPollBackoffInitialInterval(java.time.Duration pollBackoffInitialInterval)
Initial delay in case of failure.PollerOptions.Builder
setPollBackoffMaximumInterval(java.time.Duration pollBackoffMaximumInterval)
Maximum interval between polls in case of failures.PollerOptions.Builder
setPollerAutoScalerOptions(PollerAutoScalerOptions pollerAutoScalerOptions)
PollerOptions.Builder
setPollOnlyIfExecutorHasCapacity(boolean pollOnlyIfExecutorHasCapacity)
The poller will check task executor's remaining capacity before polling tasks.PollerOptions.Builder
setPollThreadCount(int pollThreadCount)
Number of parallel polling threads.PollerOptions.Builder
setPollThreadNamePrefix(java.lang.String pollThreadNamePrefix)
Prefix to use when naming poller threads.PollerOptions.Builder
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Called to report unexpected exceptions in the poller threads.
-
-
-
Method Detail
-
setMaximumPollRateIntervalMilliseconds
public PollerOptions.Builder setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
Defines interval for measuring poll rate. Larger the interval more spiky can be the load.
-
setMaximumPollRatePerSecond
public PollerOptions.Builder setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
Maximum rate of polling. Measured in the interval set throughsetMaximumPollRateIntervalMilliseconds(int)
.
-
setPollBackoffCoefficient
public PollerOptions.Builder setPollBackoffCoefficient(double pollBackoffCoefficient)
Coefficient to use when calculating exponential delay in case of failures
-
setPollBackoffInitialInterval
public PollerOptions.Builder setPollBackoffInitialInterval(java.time.Duration pollBackoffInitialInterval)
Initial delay in case of failure. If backoff coefficient is 1 then it would be the constant delay between failing polls.
-
setPollBackoffMaximumInterval
public PollerOptions.Builder setPollBackoffMaximumInterval(java.time.Duration pollBackoffMaximumInterval)
Maximum interval between polls in case of failures.
-
setPollThreadCount
public PollerOptions.Builder setPollThreadCount(int pollThreadCount)
Number of parallel polling threads.
-
setUncaughtExceptionHandler
public PollerOptions.Builder setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Called to report unexpected exceptions in the poller threads.
-
setPollThreadNamePrefix
public PollerOptions.Builder setPollThreadNamePrefix(java.lang.String pollThreadNamePrefix)
Prefix to use when naming poller threads.
-
setPollOnlyIfExecutorHasCapacity
public PollerOptions.Builder setPollOnlyIfExecutorHasCapacity(boolean pollOnlyIfExecutorHasCapacity)
The poller will check task executor's remaining capacity before polling tasks. This is to prevent task to get started but not being able to execute in time.
-
setPollerAutoScalerOptions
public PollerOptions.Builder setPollerAutoScalerOptions(PollerAutoScalerOptions pollerAutoScalerOptions)
-
build
public PollerOptions build()
-
-