Class DefaultBatchJobRecoveryHandler
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.adaptivebatch.DefaultBatchJobRecoveryHandler
-
- All Implemented Interfaces:
JobEventReplayHandler
,BatchJobRecoveryHandler
public class DefaultBatchJobRecoveryHandler extends Object implements BatchJobRecoveryHandler, JobEventReplayHandler
Default implementation ofBatchJobRecoveryHandler
andJobEventReplayHandler
.
-
-
Constructor Summary
Constructors Constructor Description DefaultBatchJobRecoveryHandler(JobEventManager jobEventManager, org.apache.flink.configuration.Configuration jobMasterConfiguration, org.apache.flink.api.common.JobID jobId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
DefaultBatchJobRecoveryHandler
public DefaultBatchJobRecoveryHandler(JobEventManager jobEventManager, org.apache.flink.configuration.Configuration jobMasterConfiguration, org.apache.flink.api.common.JobID jobId)
-
-
Method Detail
-
initialize
public void initialize(BatchJobRecoveryContext context)
Description copied from interface:BatchJobRecoveryHandler
Initializes the recovery handler with the batch job recovery context.- Specified by:
initialize
in interfaceBatchJobRecoveryHandler
-
stop
public void stop(boolean cleanUp)
Description copied from interface:BatchJobRecoveryHandler
Stops the job recovery handler and optionally clean up.- Specified by:
stop
in interfaceBatchJobRecoveryHandler
- Parameters:
cleanUp
- whether to clean up.
-
startRecovering
public void startRecovering()
Description copied from interface:BatchJobRecoveryHandler
Starts the recovery process.- Specified by:
startRecovering
in interfaceBatchJobRecoveryHandler
-
needRecover
public boolean needRecover()
Description copied from interface:BatchJobRecoveryHandler
Determines whether the job needs to undergo recovery.- Specified by:
needRecover
in interfaceBatchJobRecoveryHandler
-
isRecovering
public boolean isRecovering()
Description copied from interface:BatchJobRecoveryHandler
Determines whether the job is recovering.- Specified by:
isRecovering
in interfaceBatchJobRecoveryHandler
-
startReplay
public void startReplay()
Description copied from interface:JobEventReplayHandler
Called when starting replaying job event.- Specified by:
startReplay
in interfaceJobEventReplayHandler
-
replayOneEvent
public void replayOneEvent(JobEvent jobEvent)
Description copied from interface:JobEventReplayHandler
Called to replay one job event.- Specified by:
replayOneEvent
in interfaceJobEventReplayHandler
-
finalizeReplay
public void finalizeReplay() throws Exception
Description copied from interface:JobEventReplayHandler
Called when finalizing replaying job event.- Specified by:
finalizeReplay
in interfaceJobEventReplayHandler
- Throws:
Exception
-
onExecutionVertexReset
public void onExecutionVertexReset(Collection<ExecutionVertexID> vertices)
Description copied from interface:BatchJobRecoveryHandler
Handles the reset event for a collection of execution vertices and records the event for use during future batch job recovery.- Specified by:
onExecutionVertexReset
in interfaceBatchJobRecoveryHandler
- Parameters:
vertices
- a collection of execution vertex IDs that have been reset.
-
onExecutionJobVertexInitialization
public void onExecutionJobVertexInitialization(JobVertexID jobVertexId, int parallelism, Map<IntermediateDataSetID,JobVertexInputInfo> jobVertexInputInfos)
Description copied from interface:BatchJobRecoveryHandler
Records the job vertex initialization event for use during future batch job recovery.- Specified by:
onExecutionJobVertexInitialization
in interfaceBatchJobRecoveryHandler
- Parameters:
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.
-
onExecutionFinished
public void onExecutionFinished(ExecutionVertexID executionVertexId)
Description copied from interface:BatchJobRecoveryHandler
Records the execution vertex finished event for use during future batch job recovery.- Specified by:
onExecutionFinished
in interfaceBatchJobRecoveryHandler
- Parameters:
executionVertexId
- the id of the execution vertex is finished.
-
-