Package com.github.kagkarlsson.scheduler
Class SchedulerBuilder
- java.lang.Object
-
- com.github.kagkarlsson.scheduler.SchedulerBuilder
-
- Direct Known Subclasses:
TestHelper.ManualSchedulerBuilder
public class SchedulerBuilder extends Object
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SchedulerBuilder(DataSource dataSource, List<Task<?>> knownTasks)
-
Method Summary
-
-
-
Field Detail
-
UPPER_LIMIT_FRACTION_OF_THREADS_FOR_FETCH
public static final double UPPER_LIMIT_FRACTION_OF_THREADS_FOR_FETCH
- See Also:
- Constant Field Values
-
DEFAULT_POLLING_INTERVAL
public static final Duration DEFAULT_POLLING_INTERVAL
-
DEFAULT_HEARTBEAT_INTERVAL
public static final Duration DEFAULT_HEARTBEAT_INTERVAL
-
DEFAULT_MISSED_HEARTBEATS_LIMIT
public static final int DEFAULT_MISSED_HEARTBEATS_LIMIT
- See Also:
- Constant Field Values
-
DEFAULT_DELETION_OF_UNRESOLVED_TASKS_DURATION
public static final Duration DEFAULT_DELETION_OF_UNRESOLVED_TASKS_DURATION
-
SHUTDOWN_MAX_WAIT
public static final Duration SHUTDOWN_MAX_WAIT
-
DEFAULT_POLLING_STRATEGY
public static final PollingStrategyConfig DEFAULT_POLLING_STRATEGY
-
DEFAULT_FAILURE_LOG_LEVEL
public static final LogLevel DEFAULT_FAILURE_LOG_LEVEL
-
LOG_STACK_TRACE_ON_FAILURE
public static final boolean LOG_STACK_TRACE_ON_FAILURE
- See Also:
- Constant Field Values
-
dataSource
protected final DataSource dataSource
-
clock
protected Clock clock
-
schedulerName
protected SchedulerName schedulerName
-
executorThreads
protected int executorThreads
-
waiter
protected Waiter waiter
-
statsRegistry
protected StatsRegistry statsRegistry
-
heartbeatInterval
protected Duration heartbeatInterval
-
serializer
protected Serializer serializer
-
tableName
protected String tableName
-
enableImmediateExecution
protected boolean enableImmediateExecution
-
executorService
protected ExecutorService executorService
-
dueExecutor
protected ExecutorService dueExecutor
-
housekeeperExecutor
protected ScheduledExecutorService housekeeperExecutor
-
deleteUnresolvedAfter
protected Duration deleteUnresolvedAfter
-
jdbcCustomization
protected JdbcCustomization jdbcCustomization
-
shutdownMaxWait
protected Duration shutdownMaxWait
-
commitWhenAutocommitDisabled
protected boolean commitWhenAutocommitDisabled
-
pollingStrategyConfig
protected PollingStrategyConfig pollingStrategyConfig
-
logLevel
protected LogLevel logLevel
-
logStackTrace
protected boolean logStackTrace
-
enablePriority
protected boolean enablePriority
-
registerShutdownHook
protected boolean registerShutdownHook
-
numberOfMissedHeartbeatsBeforeDead
protected int numberOfMissedHeartbeatsBeforeDead
-
alwaysPersistTimestampInUTC
protected boolean alwaysPersistTimestampInUTC
-
schedulerListeners
protected List<SchedulerListener> schedulerListeners
-
executionInterceptors
protected List<ExecutionInterceptor> executionInterceptors
-
-
Constructor Detail
-
SchedulerBuilder
public SchedulerBuilder(DataSource dataSource, List<Task<?>> knownTasks)
-
-
Method Detail
-
startTasks
@SafeVarargs public final <T extends Task<?> & OnStartup> SchedulerBuilder startTasks(T... startTasks)
-
startTasks
public <T extends Task<?> & OnStartup> SchedulerBuilder startTasks(List<T> startTasks)
-
pollingInterval
public SchedulerBuilder pollingInterval(Duration pollingInterval)
-
heartbeatInterval
public SchedulerBuilder heartbeatInterval(Duration duration)
-
missedHeartbeatsLimit
public SchedulerBuilder missedHeartbeatsLimit(int numberOfMissedHeartbeatsBeforeDead)
-
threads
public SchedulerBuilder threads(int numberOfThreads)
-
executorService
public SchedulerBuilder executorService(ExecutorService executorService)
-
dueExecutor
public SchedulerBuilder dueExecutor(ExecutorService dueExecutor)
-
housekeeperExecutor
public SchedulerBuilder housekeeperExecutor(ScheduledExecutorService housekeeperExecutor)
-
statsRegistry
@Deprecated public SchedulerBuilder statsRegistry(StatsRegistry statsRegistry)
Deprecated.Deprecated, use addSchedulerListener instead
-
addSchedulerListener
public SchedulerBuilder addSchedulerListener(SchedulerListener schedulerListener)
-
addExecutionInterceptor
public SchedulerBuilder addExecutionInterceptor(ExecutionInterceptor interceptor)
-
schedulerName
public SchedulerBuilder schedulerName(SchedulerName schedulerName)
-
serializer
public SchedulerBuilder serializer(Serializer serializer)
-
tableName
public SchedulerBuilder tableName(String tableName)
-
enableImmediateExecution
public SchedulerBuilder enableImmediateExecution()
-
deleteUnresolvedAfter
public SchedulerBuilder deleteUnresolvedAfter(Duration deleteAfter)
-
jdbcCustomization
public SchedulerBuilder jdbcCustomization(JdbcCustomization jdbcCustomization)
-
alwaysPersistTimestampInUTC
public SchedulerBuilder alwaysPersistTimestampInUTC()
-
shutdownMaxWait
public SchedulerBuilder shutdownMaxWait(Duration shutdownMaxWait)
-
commitWhenAutocommitDisabled
public SchedulerBuilder commitWhenAutocommitDisabled(boolean commitWhenAutocommitDisabled)
-
pollUsingFetchAndLockOnExecute
public SchedulerBuilder pollUsingFetchAndLockOnExecute(double lowerLimitFractionOfThreads, double executionsPerBatchFractionOfThreads)
-
pollUsingLockAndFetch
public SchedulerBuilder pollUsingLockAndFetch(double lowerLimitFractionOfThreads, double upperLimitFractionOfThreads)
-
failureLogging
public SchedulerBuilder failureLogging(LogLevel logLevel, boolean logStackTrace)
-
registerShutdownHook
public SchedulerBuilder registerShutdownHook()
-
enablePriority
public SchedulerBuilder enablePriority()
-
build
public Scheduler build()
-
-