public class ForkingTaskRunner extends Object implements TaskRunner, TaskLogStreamer
| Constructor and Description | 
|---|
ForkingTaskRunner(ForkingTaskRunnerConfig config,
                 TaskConfig taskConfig,
                 WorkerConfig workerConfig,
                 Properties props,
                 TaskLogPusher taskLogPusher,
                 com.fasterxml.jackson.databind.ObjectMapper jsonMapper,
                 DruidNode node)  | 
| Modifier and Type | Method and Description | 
|---|---|
Collection<TaskRunnerWorkItem> | 
getKnownTasks()  | 
Collection<TaskRunnerWorkItem> | 
getPendingTasks()  | 
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. 
 | 
com.google.common.base.Optional<com.google.common.io.ByteSource> | 
streamTaskLog(String taskid,
             long offset)
Stream log for a task. 
 | 
void | 
unregisterListener(String listenerId)  | 
@Inject public ForkingTaskRunner(ForkingTaskRunnerConfig config, TaskConfig taskConfig, WorkerConfig workerConfig, Properties props, TaskLogPusher taskLogPusher, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, DruidNode node)
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 com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
TaskRunnerrun in interface TaskRunnertask - task to runpublic void stop()
TaskRunnerstop in interface TaskRunnerpublic 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 com.google.common.base.Optional<com.google.common.io.ByteSource> streamTaskLog(String taskid, long offset)
TaskLogStreamerstreamTaskLog in interface TaskLogStreameroffset - If zero, stream the entire log. If positive, attempt to read from this position onwards. If
               negative, attempt to read this many bytes from the end of the file (like tail -n).Copyright © 2011–2018. All rights reserved.