public class ThreadPoolTaskRunner extends Object implements TaskRunner, QuerySegmentWalker
| Constructor and Description | 
|---|
ThreadPoolTaskRunner(TaskToolboxFactory toolboxFactory,
                    TaskConfig taskConfig,
                    ServiceEmitter emitter,
                    DruidNode node,
                    ServerConfig serverConfig)  | 
| 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<SegmentDescriptor> specs)
Gets the Queryable for a given list of SegmentSpecs. 
 | 
Collection<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)  | 
@Inject public ThreadPoolTaskRunner(TaskToolboxFactory toolboxFactory, TaskConfig taskConfig, ServiceEmitter emitter, DruidNode node, ServerConfig serverConfig)
public List<Pair<Task,com.google.common.util.concurrent.ListenableFuture<TaskStatus>>> restore()
TaskRunnerrestore in interface TaskRunnerpublic void registerListener(TaskRunnerListener listener, Executor executor)
TaskRunnerregisterListener in interface TaskRunnerlistener - the listenerexecutor - executor to run callbacks inpublic void unregisterListener(String listenerId)
unregisterListener in interface TaskRunnerpublic void stop()
TaskRunnerstop in interface TaskRunnerpublic com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
TaskRunnerrun in interface TaskRunnertask - task to runpublic void shutdown(String taskid)
TaskRunnershutdown in interface TaskRunnertaskid - task ID to clean up resources forpublic Collection<TaskRunnerWorkItem> getRunningTasks()
getRunningTasks in interface TaskRunnerpublic Collection<TaskRunnerWorkItem> getPendingTasks()
getPendingTasks in interface TaskRunnerpublic Collection<TaskRunnerWorkItem> getKnownTasks()
getKnownTasks in interface TaskRunnerpublic com.google.common.base.Optional<ScalingStats> getScalingStats()
TaskRunnergetScalingStats in interface TaskRunnerpublic void start()
TaskRunnerstart in interface TaskRunnerpublic <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals)
QuerySegmentWalkergetQueryRunnerForIntervals in interface QuerySegmentWalkerT - 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<SegmentDescriptor> specs)
QuerySegmentWalkergetQueryRunnerForSegments in interface QuerySegmentWalkerT - the query result typequery - the query to return a Queryable forspecs - the list of SegmentSpecs to find a Queryable forCopyright © 2011–2018. All rights reserved.