public interface TaskRunner
TaskQueue
.
Holds stateModifier and Type | Method and Description |
---|---|
Collection<? extends TaskRunnerWorkItem> |
getKnownTasks() |
Collection<? extends TaskRunnerWorkItem> |
getPendingTasks() |
Collection<? extends TaskRunnerWorkItem> |
getRunningTasks() |
com.google.common.base.Optional<ScalingStats> |
getScalingStats()
Some runners are able to scale up and down their capacity in a dynamic manner.
|
void |
registerListener(TaskRunnerListener listener,
Executor executor)
Register a listener with this task runner.
|
List<Pair<Task,com.google.common.util.concurrent.ListenableFuture<TaskStatus>>> |
restore()
Some task runners can restart previously-running tasks after being bounced.
|
com.google.common.util.concurrent.ListenableFuture<TaskStatus> |
run(Task task)
Run a task.
|
void |
shutdown(String taskid)
Inform the task runner it can clean up any resources associated with a task.
|
void |
start()
Start the state of the runner
|
void |
stop()
Stop this task runner.
|
void |
unregisterListener(String listenerId) |
List<Pair<Task,com.google.common.util.concurrent.ListenableFuture<TaskStatus>>> restore()
void registerListener(TaskRunnerListener listener, Executor executor)
listener
- the listenerexecutor
- executor to run callbacks invoid unregisterListener(String listenerId)
com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
task
- task to runvoid shutdown(String taskid)
taskid
- task ID to clean up resources forvoid stop()
Collection<? extends TaskRunnerWorkItem> getRunningTasks()
Collection<? extends TaskRunnerWorkItem> getPendingTasks()
Collection<? extends TaskRunnerWorkItem> getKnownTasks()
com.google.common.base.Optional<ScalingStats> getScalingStats()
void start()
Copyright © 2011–2017. All rights reserved.