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()
TaskRunner
stop
in interface TaskRunner
public List<com.metamx.common.Pair<Task,com.google.common.util.concurrent.ListenableFuture<TaskStatus>>> restore()
TaskRunner
restore
in interface TaskRunner
public Collection<ZkWorker> getWorkers()
public Collection<RemoteTaskRunnerWorkItem> getRunningTasks()
getRunningTasks
in interface TaskRunner
public Collection<RemoteTaskRunnerWorkItem> getPendingTasks()
getPendingTasks
in interface TaskRunner
public Collection<RemoteTaskRunnerWorkItem> getKnownTasks()
getKnownTasks
in interface TaskRunner
public com.google.common.base.Optional<ScalingStats> getScalingStats()
TaskRunner
getScalingStats
in interface TaskRunner
public com.google.common.util.concurrent.ListenableFuture<TaskStatus> run(Task task)
run
in interface TaskRunner
task
- task to runpublic void shutdown(String taskId)
shutdown
in interface TaskRunner
taskId
- - 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.TaskLogStreamer
public List<ZkWorker> markWorkersLazy(com.google.common.base.Predicate<ZkWorker> isLazyWorker, int maxWorkers)
Copyright © 2011–2016. All rights reserved.