-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Move resource managemnt to be the responsibility of the TaskRunner #1953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,12 @@ | |
|
|
||
| package io.druid.indexing.overlord; | ||
|
|
||
| import com.google.common.base.Optional; | ||
| import com.google.common.util.concurrent.ListenableFuture; | ||
| import com.metamx.common.Pair; | ||
| import io.druid.indexing.common.TaskStatus; | ||
| import io.druid.indexing.common.task.Task; | ||
| import io.druid.indexing.overlord.autoscaling.ScalingStats; | ||
|
|
||
| import java.util.Collection; | ||
| import java.util.List; | ||
|
|
@@ -45,27 +47,32 @@ public interface TaskRunner | |
| * | ||
| * @return task status, eventually | ||
| */ | ||
| public ListenableFuture<TaskStatus> run(Task task); | ||
| ListenableFuture<TaskStatus> run(Task task); | ||
|
|
||
| /** | ||
| * Inform the task runner it can clean up any resources associated with a task. This implies shutdown of any | ||
| * currently-running tasks. | ||
| * | ||
| * @param taskid task ID to clean up resources for | ||
| */ | ||
| public void shutdown(String taskid); | ||
| void shutdown(String taskid); | ||
|
|
||
| /** | ||
| * Stop this task runner. This may block until currently-running tasks can be gracefully stopped. After calling | ||
| * stopping, "run" will not accept further tasks. | ||
| */ | ||
| public void stop(); | ||
| void stop(); | ||
|
|
||
| public Collection<? extends TaskRunnerWorkItem> getRunningTasks(); | ||
| Collection<? extends TaskRunnerWorkItem> getRunningTasks(); | ||
|
|
||
| public Collection<? extends TaskRunnerWorkItem> getPendingTasks(); | ||
| Collection<? extends TaskRunnerWorkItem> getPendingTasks(); | ||
|
|
||
| public Collection<? extends TaskRunnerWorkItem> getKnownTasks(); | ||
| Collection<? extends TaskRunnerWorkItem> getKnownTasks(); | ||
|
|
||
| public Collection<ZkWorker> getWorkers(); | ||
| /** | ||
| * Some runners are able to scale up and down their capacity in a dynamic manner. This returns stats on those activities | ||
| * | ||
| * @return ScalingStats if the runner has an underlying resource which can scale, Optional.absent() otherwise | ||
| */ | ||
| Optional<ScalingStats> getScalingStats(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to getWorkers() , getScalingStats() is also tied to some specific TaskRunners and ScalingStat looks like related much more to autoscaling . not sure if we are introducing same kind of coupling again via this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My issue here is how to handle This is intended to be a baby step |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drcrallen are you able to start overlord after this change, guice does not seem to be able to inject "ScheduledExecutorService" .