public class RemoteTaskRunner extends Object implements TaskRunner, io.druid.tasklogs.TaskLogStreamer
| Constructor and Description |
|---|
RemoteTaskRunner(com.fasterxml.jackson.databind.ObjectMapper jsonMapper,
RemoteTaskRunnerConfig config,
IndexerZkConfig indexerZkConfig,
org.apache.curator.framework.CuratorFramework cf,
PathChildrenCacheFactory pathChildrenCacheFactory,
com.metamx.http.client.HttpClient httpClient,
com.google.common.base.Supplier<WorkerBehaviorConfig> workerConfigRef,
ScheduledExecutorService cleanupExec,
ResourceManagementStrategy<RemoteTaskRunner> resourceManagement) |
| Modifier and Type | Method and Description |
|---|---|
ZkWorker |
findWorkerRunningTask(String taskId) |
Collection<RemoteTaskRunnerWorkItem> |
getKnownTasks() |
List<ZkWorker> |
getLazyWorkers() |
Collection<RemoteTaskRunnerWorkItem> |
getPendingTasks() |
Collection<RemoteTaskRunnerWorkItem> |
getRunningTasks() |
com.google.common.base.Optional<ScalingStats> |
getScalingStats()
Some runners are able to scale up and down their capacity in a dynamic manner.
|
Collection<ZkWorker> |
getWorkers() |
boolean |
isWorkerRunningTask(Worker worker,
String taskId) |
List<ZkWorker> |
markWorkersLazy(com.google.common.base.Predicate<ZkWorker> isLazyWorker,
int maxWorkers) |
List<com.metamx.common.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)
A task will be run only if there is no current knowledge in the RemoteTaskRunner of the task.
|
void |
shutdown(String taskId)
Finds the worker running the task and forwards the shutdown signal to the worker.
|
void |
start() |
void |
stop()
Stop this task runner.
|
com.google.common.base.Optional<com.google.common.io.ByteSource> |
streamTaskLog(String taskId,
long offset) |
public RemoteTaskRunner(com.fasterxml.jackson.databind.ObjectMapper jsonMapper,
RemoteTaskRunnerConfig config,
IndexerZkConfig indexerZkConfig,
org.apache.curator.framework.CuratorFramework cf,
PathChildrenCacheFactory pathChildrenCacheFactory,
com.metamx.http.client.HttpClient httpClient,
com.google.common.base.Supplier<WorkerBehaviorConfig> workerConfigRef,
ScheduledExecutorService cleanupExec,
ResourceManagementStrategy<RemoteTaskRunner> resourceManagement)
public void start()
public void stop()
TaskRunnerstop in interface TaskRunnerpublic List<com.metamx.common.Pair<Task,com.google.common.util.concurrent.ListenableFuture<TaskStatus>>> restore()
TaskRunnerrestore in interface TaskRunnerpublic Collection<ZkWorker> getWorkers()
public Collection<RemoteTaskRunnerWorkItem> getRunningTasks()
getRunningTasks in interface TaskRunnerpublic Collection<RemoteTaskRunnerWorkItem> getPendingTasks()
getPendingTasks in interface TaskRunnerpublic Collection<RemoteTaskRunnerWorkItem> getKnownTasks()
getKnownTasks in interface TaskRunnerpublic com.google.common.base.Optional<ScalingStats> getScalingStats()
TaskRunnergetScalingStats in interface TaskRunnerpublic com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
run in interface TaskRunnertask - task to runpublic void shutdown(String taskId)
shutdown in interface TaskRunnertaskId - - task id to shutdownpublic com.google.common.base.Optional<com.google.common.io.ByteSource> streamTaskLog(String taskId, long offset)
streamTaskLog in interface io.druid.tasklogs.TaskLogStreamerpublic List<ZkWorker> markWorkersLazy(com.google.common.base.Predicate<ZkWorker> isLazyWorker, int maxWorkers)
Copyright © 2011–2016. All rights reserved.