public class TaskExecutorService extends org.apache.hadoop.service.AbstractService implements Scheduler<TaskRunnerCallable>, SchedulerFragmentCompletingListener
Because of the concurrent nature of task submission, the position of the task in wait queue is held as long the scheduling of the task from wait queue (with or without pre-emption) is complete. The order of pre-emption is based on the ordering in the pre-emption queue. All tasks that cannot run to completion immediately (canFinish = false) are added to pre-emption queue.
When all the executor threads are occupied and wait queue is full, the task scheduler will return SubmissionState.REJECTED response
Task executor service can be shut down which will terminated all running tasks and reject all new tasks. Shutting down of the task executor service can be done gracefully or immediately.
Modifier and Type | Class and Description |
---|---|
static class |
TaskExecutorService.PreemptionQueueComparator |
static class |
TaskExecutorService.TaskWrapper |
Scheduler.SubmissionState
SchedulerFragmentCompletingListener.State
Constructor and Description |
---|
TaskExecutorService(int numExecutors,
int waitQueueSize,
String waitQueueComparatorClassName,
boolean enablePreemption,
ClassLoader classLoader,
LlapDaemonExecutorMetrics metrics,
org.apache.hadoop.yarn.util.Clock clock) |
Modifier and Type | Method and Description |
---|---|
QueryIdentifier |
findQueryByFragment(String fragmentId) |
void |
fragmentCompleting(String fragmentId,
SchedulerFragmentCompletingListener.State state)
Indicates that a fragment is about to complete.
|
Set<String> |
getExecutorsStatusForReporting() |
int |
getNumActiveForReporting() |
void |
killFragment(String fragmentId)
Attempt to kill the fragment with the specified fragmentId
|
Scheduler.SubmissionState |
schedule(TaskRunnerCallable task)
Schedule the task or throw RejectedExecutionException if queues are full
|
void |
serviceStop() |
void |
shutDown(boolean awaitTermination) |
boolean |
updateFragment(String fragmentId,
boolean isGuaranteed) |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public TaskExecutorService(int numExecutors, int waitQueueSize, String waitQueueComparatorClassName, boolean enablePreemption, ClassLoader classLoader, LlapDaemonExecutorMetrics metrics, org.apache.hadoop.yarn.util.Clock clock)
public void serviceStop()
serviceStop
in class org.apache.hadoop.service.AbstractService
public int getNumActiveForReporting()
getNumActiveForReporting
in interface Scheduler<TaskRunnerCallable>
public Set<String> getExecutorsStatusForReporting()
getExecutorsStatusForReporting
in interface Scheduler<TaskRunnerCallable>
public Scheduler.SubmissionState schedule(TaskRunnerCallable task)
Scheduler
schedule
in interface Scheduler<TaskRunnerCallable>
task
- - task to schedulepublic boolean updateFragment(String fragmentId, boolean isGuaranteed)
updateFragment
in interface Scheduler<TaskRunnerCallable>
public QueryIdentifier findQueryByFragment(String fragmentId)
findQueryByFragment
in interface Scheduler<TaskRunnerCallable>
public void killFragment(String fragmentId)
Scheduler
killFragment
in interface Scheduler<TaskRunnerCallable>
public void fragmentCompleting(String fragmentId, SchedulerFragmentCompletingListener.State state)
SchedulerFragmentCompletingListener
fragmentCompleting
in interface SchedulerFragmentCompletingListener
public void shutDown(boolean awaitTermination)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.