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 of
BatchJobRecoveryHandler and JobEventReplayHandler.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBatchJobRecoveryHandler(JobEventManager jobEventManager, org.apache.flink.configuration.Configuration jobMasterConfiguration, org.apache.flink.api.common.JobID jobId) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when finalizing replaying job event.voidinitialize(BatchJobRecoveryContext context) Initializes the recovery handler with the batch job recovery context.booleanDetermines whether the job is recovering.booleanDetermines whether the job needs to undergo recovery.voidonExecutionFinished(ExecutionVertexID executionVertexId) Records the execution vertex finished event for use during future batch job recovery.voidonExecutionJobVertexInitialization(JobVertexID jobVertexId, int parallelism, Map<IntermediateDataSetID, JobVertexInputInfo> jobVertexInputInfos) Records the job vertex initialization event for use during future batch job recovery.voidonExecutionVertexReset(Collection<ExecutionVertexID> vertices) Handles the reset event for a collection of execution vertices and records the event for use during future batch job recovery.voidreplayOneEvent(JobEvent jobEvent) Called to replay one job event.voidStarts the recovery process.voidCalled when starting replaying job event.voidstop(boolean cleanUp) Stops the job recovery handler and optionally clean up.
-
Constructor Details
-
DefaultBatchJobRecoveryHandler
public DefaultBatchJobRecoveryHandler(JobEventManager jobEventManager, org.apache.flink.configuration.Configuration jobMasterConfiguration, org.apache.flink.api.common.JobID jobId)
-
-
Method Details
-
initialize
Description copied from interface:BatchJobRecoveryHandlerInitializes the recovery handler with the batch job recovery context.- Specified by:
initializein interfaceBatchJobRecoveryHandler
-
stop
public void stop(boolean cleanUp) Description copied from interface:BatchJobRecoveryHandlerStops the job recovery handler and optionally clean up.- Specified by:
stopin interfaceBatchJobRecoveryHandler- Parameters:
cleanUp- whether to clean up.
-
startRecovering
public void startRecovering()Description copied from interface:BatchJobRecoveryHandlerStarts the recovery process.- Specified by:
startRecoveringin interfaceBatchJobRecoveryHandler
-
needRecover
public boolean needRecover()Description copied from interface:BatchJobRecoveryHandlerDetermines whether the job needs to undergo recovery.- Specified by:
needRecoverin interfaceBatchJobRecoveryHandler
-
isRecovering
public boolean isRecovering()Description copied from interface:BatchJobRecoveryHandlerDetermines whether the job is recovering.- Specified by:
isRecoveringin interfaceBatchJobRecoveryHandler
-
startReplay
public void startReplay()Description copied from interface:JobEventReplayHandlerCalled when starting replaying job event.- Specified by:
startReplayin interfaceJobEventReplayHandler
-
replayOneEvent
Description copied from interface:JobEventReplayHandlerCalled to replay one job event.- Specified by:
replayOneEventin interfaceJobEventReplayHandler
-
finalizeReplay
Description copied from interface:JobEventReplayHandlerCalled when finalizing replaying job event.- Specified by:
finalizeReplayin interfaceJobEventReplayHandler- Throws:
Exception
-
onExecutionVertexReset
Description copied from interface:BatchJobRecoveryHandlerHandles the reset event for a collection of execution vertices and records the event for use during future batch job recovery.- Specified by:
onExecutionVertexResetin 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:BatchJobRecoveryHandlerRecords the job vertex initialization event for use during future batch job recovery.- Specified by:
onExecutionJobVertexInitializationin 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
Description copied from interface:BatchJobRecoveryHandlerRecords the execution vertex finished event for use during future batch job recovery.- Specified by:
onExecutionFinishedin interfaceBatchJobRecoveryHandler- Parameters:
executionVertexId- the id of the execution vertex is finished.
-