public class ThreadPoolTaskRunner extends Object implements TaskRunner, QuerySegmentWalker
Constructor and Description |
---|
ThreadPoolTaskRunner(TaskToolboxFactory toolboxFactory,
QueryRunnerFactoryConglomerate conglomerate) |
Modifier and Type | Method and Description |
---|---|
Collection<TaskRunnerWorkItem> |
getKnownTasks() |
Collection<TaskRunnerWorkItem> |
getPendingTasks() |
<T> QueryRunner<T> |
getQueryRunnerForIntervals(Query<T> query,
Iterable<org.joda.time.Interval> intervals)
Gets the Queryable for a given interval, the Queryable returned can be any version(s) or partitionNumber(s)
such that it represents the interval.
|
<T> QueryRunner<T> |
getQueryRunnerForSegments(Query<T> query,
Iterable<io.druid.query.SegmentDescriptor> specs)
Gets the Queryable for a given list of SegmentSpecs.
|
Collection<TaskRunnerWorkItem> |
getRunningTasks() |
Collection<ZkWorker> |
getWorkers() |
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 |
stop() |
@Inject public ThreadPoolTaskRunner(TaskToolboxFactory toolboxFactory, QueryRunnerFactoryConglomerate conglomerate)
public void stop()
public com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
TaskRunner
run
in interface TaskRunner
task
- task to runpublic void shutdown(String taskid)
TaskRunner
shutdown
in interface TaskRunner
taskid
- task ID to clean up resources forpublic Collection<TaskRunnerWorkItem> getRunningTasks()
getRunningTasks
in interface TaskRunner
public Collection<TaskRunnerWorkItem> getPendingTasks()
getPendingTasks
in interface TaskRunner
public Collection<TaskRunnerWorkItem> getKnownTasks()
getKnownTasks
in interface TaskRunner
public Collection<ZkWorker> getWorkers()
getWorkers
in interface TaskRunner
public <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals)
QuerySegmentWalker
getQueryRunnerForIntervals
in interface QuerySegmentWalker
T
- query result typequery
- the query to find a Queryable forintervals
- the intervals to find a Queryable forpublic <T> QueryRunner<T> getQueryRunnerForSegments(Query<T> query, Iterable<io.druid.query.SegmentDescriptor> specs)
QuerySegmentWalker
getQueryRunnerForSegments
in interface QuerySegmentWalker
T
- the query result typequery
- the query to return a Queryable forspecs
- the list of SegmentSpecs to find a Queryable forCopyright © 2011–2015. All rights reserved.