public final class JobStateManager extends Object
Constructor and Description |
---|
JobStateManager(PhysicalPlan physicalPlan,
BlockManagerMaster blockManagerMaster,
MetricMessageHandler metricMessageHandler,
int maxScheduleAttempt) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkJobTermination() |
boolean |
checkStageCompletion(String stageId) |
int |
getAttemptCountForStage(String stageId) |
Map<String,StageState> |
getIdToStageStates() |
Map<String,TaskGroupState> |
getIdToTaskGroupStates() |
String |
getJobId() |
JobState |
getJobState() |
StageState |
getStageState(String stageId) |
TaskGroupState |
getTaskGroupState(String taskGroupId) |
void |
onJobStateChanged(JobState.State newState)
Updates the state of the job.
|
void |
onStageStateChanged(String stageId,
StageState.State newState)
Updates the state of a stage.
|
void |
onTaskGroupStateChanged(String taskGroupId,
TaskGroupState.State newState)
Updates the state of a task group.
|
void |
storeJSON(String directory,
String suffix)
Stores JSON representation of job state into a file.
|
String |
toString() |
String |
toStringWithPhysicalPlan() |
JobState |
waitUntilFinish()
Wait for this job to be finished and return the final state.
|
JobState |
waitUntilFinish(long timeout,
TimeUnit unit)
Wait for this job to be finished and return the final state.
|
public JobStateManager(PhysicalPlan physicalPlan, BlockManagerMaster blockManagerMaster, MetricMessageHandler metricMessageHandler, int maxScheduleAttempt)
public void onJobStateChanged(JobState.State newState)
newState
- of the job.public void onStageStateChanged(String stageId, StageState.State newState)
stageId
- of the stage.newState
- of the stage.public void onTaskGroupStateChanged(String taskGroupId, TaskGroupState.State newState)
BatchSingleJobScheduler
.
State changes that occur in executors are sent to master as a control message,
and the call to this method is initiated in BatchSingleJobScheduler
when the message/event is received.
A task group completion implies completion of all its tasks.taskGroupId
- the ID of the task group.newState
- the new state of the task group.public boolean checkStageCompletion(String stageId)
public boolean checkJobTermination()
public int getAttemptCountForStage(String stageId)
public JobState waitUntilFinish()
public JobState waitUntilFinish(long timeout, TimeUnit unit)
timeout
- of waiting.unit
- of the timeout.public String getJobId()
public JobState getJobState()
public StageState getStageState(String stageId)
public Map<String,StageState> getIdToStageStates()
public TaskGroupState getTaskGroupState(String taskGroupId)
public Map<String,TaskGroupState> getIdToTaskGroupStates()
public void storeJSON(String directory, String suffix)
directory
- the directory which JSON representation is saved tosuffix
- suffix for file namepublic String toStringWithPhysicalPlan()
Copyright © 2018. All rights reserved.