public class DefaultBatchJobRecoveryHandler extends Object implements BatchJobRecoveryHandler, JobEventReplayHandler
BatchJobRecoveryHandler
and JobEventReplayHandler
.Constructor and Description |
---|
DefaultBatchJobRecoveryHandler(JobEventManager jobEventManager,
Configuration jobMasterConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
finalizeReplay()
Called when finalizing replaying job event.
|
void |
initialize(BatchJobRecoveryContext context)
Initializes the recovery handler with the batch job recovery context.
|
boolean |
isRecovering()
Determines whether the job is recovering.
|
boolean |
needRecover()
Determines whether the job needs to undergo recovery.
|
void |
onExecutionFinished(ExecutionVertexID executionVertexId)
Records the execution vertex finished event for use during future batch job recovery.
|
void |
onExecutionJobVertexInitialization(JobVertexID jobVertexId,
int parallelism,
Map<IntermediateDataSetID,JobVertexInputInfo> jobVertexInputInfos)
Records the job vertex initialization event for use during future batch job recovery.
|
void |
onExecutionVertexReset(Collection<ExecutionVertexID> vertices)
Handles the reset event for a collection of execution vertices and records the event for use
during future batch job recovery.
|
void |
replayOneEvent(JobEvent jobEvent)
Called to replay one job event.
|
void |
startRecovering()
Starts the recovery process.
|
void |
startReplay()
Called when starting replaying job event.
|
void |
stop(boolean cleanUp)
Stops the job recovery handler and optionally clean up.
|
public DefaultBatchJobRecoveryHandler(JobEventManager jobEventManager, Configuration jobMasterConfiguration)
public void initialize(BatchJobRecoveryContext context)
BatchJobRecoveryHandler
initialize
in interface BatchJobRecoveryHandler
public void stop(boolean cleanUp)
BatchJobRecoveryHandler
stop
in interface BatchJobRecoveryHandler
cleanUp
- whether to clean up.public void startRecovering()
BatchJobRecoveryHandler
startRecovering
in interface BatchJobRecoveryHandler
public boolean needRecover()
BatchJobRecoveryHandler
needRecover
in interface BatchJobRecoveryHandler
public boolean isRecovering()
BatchJobRecoveryHandler
isRecovering
in interface BatchJobRecoveryHandler
public void startReplay()
JobEventReplayHandler
startReplay
in interface JobEventReplayHandler
public void replayOneEvent(JobEvent jobEvent)
JobEventReplayHandler
replayOneEvent
in interface JobEventReplayHandler
public void finalizeReplay() throws Exception
JobEventReplayHandler
finalizeReplay
in interface JobEventReplayHandler
Exception
public void onExecutionVertexReset(Collection<ExecutionVertexID> vertices)
BatchJobRecoveryHandler
onExecutionVertexReset
in interface BatchJobRecoveryHandler
vertices
- a collection of execution vertex IDs that have been reset.public void onExecutionJobVertexInitialization(JobVertexID jobVertexId, int parallelism, Map<IntermediateDataSetID,JobVertexInputInfo> jobVertexInputInfos)
BatchJobRecoveryHandler
onExecutionJobVertexInitialization
in interface BatchJobRecoveryHandler
jobVertexId
- the id of the job vertex being initialized.parallelism
- the parallelism of the job vertex.jobVertexInputInfos
- a map of intermediate dataset IDs to job vertex input info.public void onExecutionFinished(ExecutionVertexID executionVertexId)
BatchJobRecoveryHandler
onExecutionFinished
in interface BatchJobRecoveryHandler
executionVertexId
- the id of the execution vertex is finished.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.