@DefaultImplementation(value=BatchSingleJobScheduler.class) public interface Scheduler
ScheduledTaskGroup
to executors.Modifier and Type | Method and Description |
---|---|
void |
onExecutorAdded(String executorId)
Called when an executor is added to Runtime, so that the extra resource can be used to execute the job.
|
void |
onExecutorRemoved(String executorId)
Called when an executor is removed from Runtime, so that faults related to the removal can be handled.
|
void |
onTaskGroupStateChanged(String executorId,
String taskGroupId,
TaskGroupState.State newState,
int attemptIdx,
String taskPutOnHold,
TaskGroupState.RecoverableFailureCause failureCause)
Called when a TaskGroup's execution state changes.
|
void |
scheduleJob(PhysicalPlan physicalPlan,
JobStateManager jobStateManager)
Schedules the given job.
|
void |
terminate()
To be called when a job should be terminated.
|
void |
updateJob(String jobId,
PhysicalPlan newPhysicalPlan,
Pair<String,String> taskInfo)
Receives and updates the scheduler with a new physical plan for a job.
|
void scheduleJob(PhysicalPlan physicalPlan, JobStateManager jobStateManager)
physicalPlan
- of the job being submitted.jobStateManager
- to manage the states of the submitted job.void updateJob(String jobId, PhysicalPlan newPhysicalPlan, Pair<String,String> taskInfo)
jobId
- the ID of the job to change the physical plan.newPhysicalPlan
- new physical plan for the job.taskInfo
- pair containing the information of the executor id and task group id to mark as complete after the
update.void onExecutorAdded(String executorId)
executorId
- of the executor that has been added.void onExecutorRemoved(String executorId)
executorId
- of the executor that has been removed.void onTaskGroupStateChanged(String executorId, String taskGroupId, TaskGroupState.State newState, int attemptIdx, @Nullable String taskPutOnHold, TaskGroupState.RecoverableFailureCause failureCause)
executorId
- of the executor in which the TaskGroup is executing.taskGroupId
- of the TaskGroup whose state must be updated.newState
- for the TaskGroup.attemptIdx
- the number of times this TaskGroup has executed.
the below parameters are only valid for failures *****************taskPutOnHold
- the ID of task that are put on hold. It is null otherwise.failureCause
- for which the TaskGroup failed in the case of a recoverable failure.void terminate()
Copyright © 2018. All rights reserved.