public class TaskQueue extends Object
add(io.druid.indexing.common.task.Task)
and manages delivery of these tasks to a
TaskRunner
. Tasks will run in a mostly-FIFO order, with deviations when the natural next task is not ready
in time (based on its Task.isReady(io.druid.indexing.common.actions.TaskActionClient)
method).
For persistence, we save all new tasks and task status changes using a TaskStorage
object.Constructor and Description |
---|
TaskQueue(TaskQueueConfig config,
TaskStorage taskStorage,
TaskRunner taskRunner,
TaskActionClientFactory taskActionClientFactory,
TaskLockbox taskLockbox,
com.metamx.emitter.service.ServiceEmitter emitter) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Task task)
Adds some work to the queue and the underlying task storage facility with a generic "running" status.
|
void |
shutdown(String taskId)
Shuts down a task if it has not yet finished.
|
void |
start()
Starts this task queue.
|
void |
stop()
Shuts down the queue.
|
@Inject public TaskQueue(TaskQueueConfig config, TaskStorage taskStorage, TaskRunner taskRunner, TaskActionClientFactory taskActionClientFactory, TaskLockbox taskLockbox, com.metamx.emitter.service.ServiceEmitter emitter)
public void start()
add(Task)
to accept new tasks.public void stop()
public boolean add(Task task) throws EntryExistsException
task
- task to addEntryExistsException
- if the task already existspublic void shutdown(String taskId)
taskId
- task to killCopyright © 2011–2015. All rights reserved.