public static final class TaskSchedulingService.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
TaskSchedulingService |
build()
Creates a
TaskSchedulingService based on the various builder methods you have chained. |
TaskSchedulingService.Builder |
withLoopIntervalMillis(long loopIntervalMillis)
Use the given milli seconds as minimum delay between two consecutive scheduling iterations.
|
TaskSchedulingService.Builder |
withMaxDelayMillis(long maxDelayMillis)
Use the given milli seconds as the maximum delay between two consecutive scheduling iterations.
|
TaskSchedulingService.Builder |
withPreSchedulingLoopHook(Action0 preHook)
Use the given action to call before starting a new scheduling iteration.
|
TaskSchedulingService.Builder |
withSchedulingResultCallback(Action1<SchedulingResult> callback)
Use the given callback to give scheduling results to at the end of each scheduling iteration.
|
TaskSchedulingService.Builder |
withTaskQuue(TaskQueue taskQ)
Use the given instance of
TaskQueue from which to get tasks to assign
resource to. |
TaskSchedulingService.Builder |
withTaskScheduler(TaskScheduler taskScheduler)
Use the given instance of
TaskScheduler for scheduling resources. |
public TaskSchedulingService.Builder withTaskScheduler(TaskScheduler taskScheduler)
TaskScheduler
for scheduling resources. A task scheduler must be provided
before this builder can create the scheduling service.taskScheduler
- The task scheduler instance to use.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService.Builder withSchedulingResultCallback(Action1<SchedulingResult> callback)
callback
- The action to call with scheduling results.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService.Builder withTaskQuue(TaskQueue taskQ)
TaskQueue
from which to get tasks to assign
resource to. A task queue must be provided before this builder can create the scheduling service.taskQ
- The task queue from which to get tasks for assignment of resoruces.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService.Builder withLoopIntervalMillis(long loopIntervalMillis)
loopIntervalMillis
- The delay between consecutive scheduling iterations in milli seconds.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService.Builder withMaxDelayMillis(long maxDelayMillis)
withLoopIntervalMillis(long)
if the service notices no changes to the queue or there are no new
VM leases input.maxDelayMillis
- The maximum delay between two consecutive scheduling iterations.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService.Builder withPreSchedulingLoopHook(Action0 preHook)
preHook
- The callback to mark beginning of a new scheduling iteration.Builder
, suitable for further chaining or to build the TaskSchedulingService
.public TaskSchedulingService build()
TaskSchedulingService
based on the various builder methods you have chained.TaskSchedulingService
built according to the specifications you indicated