public class ForkingTaskRunner extends Object implements TaskRunner, io.druid.tasklogs.TaskLogStreamer
Constructor and Description |
---|
ForkingTaskRunner(ForkingTaskRunnerConfig config,
TaskConfig taskConfig,
WorkerConfig workerConfig,
Properties props,
io.druid.tasklogs.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() |
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() |
com.google.common.base.Optional<com.google.common.io.ByteSource> |
streamTaskLog(String taskid,
long offset) |
@Inject public ForkingTaskRunner(ForkingTaskRunnerConfig config, TaskConfig taskConfig, WorkerConfig workerConfig, Properties props, io.druid.tasklogs.TaskLogPusher taskLogPusher, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, DruidNode node)
public com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
TaskRunner
run
in interface TaskRunner
task
- task to runpublic void stop()
public 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 com.google.common.base.Optional<com.google.common.io.ByteSource> streamTaskLog(String taskid, long offset)
streamTaskLog
in interface io.druid.tasklogs.TaskLogStreamer
Copyright © 2011–2015. All rights reserved.