类 CheckpointManager
- java.lang.Object
-
- org.apache.seatunnel.engine.server.checkpoint.CheckpointManager
-
public class CheckpointManager extends Object
Used to manage all checkpoints for a job.Maintain the life cycle of the
CheckpointCoordinatorthrough theCheckpointPlanand the status of the job.
-
-
构造器概要
构造器 构造器 说明 CheckpointManager(long jobId, boolean isStartWithSavePoint, com.hazelcast.spi.impl.NodeEngine nodeEngine, JobMaster jobMaster, Map<Integer,CheckpointPlan> checkpointPlanMap, org.apache.seatunnel.engine.common.config.server.CheckpointConfig checkpointConfig, ExecutorService executorService, com.hazelcast.map.IMap<Object,Object> runningJobStateIMap)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidacknowledgeTask(TaskAcknowledgeOperation ackOperation)Called by theTask.org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CheckpointCoordinatorState>cancelCheckpoint(int pipelineId)Call By JobMaster If all the tasks canceled or some task failed, JobMaster will call this method to cancel checkpoint coordinator.voidclearCheckpointIfNeed(org.apache.seatunnel.engine.core.job.JobStatus jobStatus)Called by the JobMaster.CheckpointCoordinatorgetCheckpointCoordinator(int pipelineId)protected voidhandleCheckpointError(int pipelineId, boolean neverRestore)booleanisCompletedPipeline(int pipelineId)Called by the JobMaster.booleanisPipelineSavePointEnd(PipelineLocation pipelineLocation)booleanisSavePointEnd()CompletableFuture<Void>listenPipeline(int pipelineId, org.apache.seatunnel.engine.core.job.PipelineStatus pipelineStatus)Called by the JobMaster.voidreadyToClose(TaskLocation taskLocation)Called by theSourceSplitEnumeratorTask.voidreadyToCloseIdleTask(TaskLocation taskLocation)Called by theSourceSplitEnumeratorTask.voidreportCheckpointErrorFromTask(TaskLocation taskLocation, String errorMsg)voidreportedPipelineRunning(int pipelineId, boolean alreadyStarted)voidreportedTask(TaskReportStatusOperation reportStatusOperation)Called by theTask.protected com.hazelcast.spi.impl.operationservice.impl.InvocationFuture<?>sendOperationToMemberNode(TaskOperation operation)org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CompletedCheckpoint>[]triggerSavePoints()Called by the JobMaster, actually triggered by the user.voidtriggerSchemaChangeAfterCheckpoint(TriggerSchemaChangeAfterCheckpointOperation operation)voidtriggerSchemaChangeBeforeCheckpoint(TriggerSchemaChangeBeforeCheckpointOperation operation)org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CheckpointCoordinatorState>waitCheckpointCoordinatorComplete(int pipelineId)Call By JobMaster If all the tasks is finished, JobMaster will call this method to wait checkpoint coordinator complete.
-
-
-
构造器详细资料
-
CheckpointManager
public CheckpointManager(long jobId, boolean isStartWithSavePoint, com.hazelcast.spi.impl.NodeEngine nodeEngine, JobMaster jobMaster, Map<Integer,CheckpointPlan> checkpointPlanMap, org.apache.seatunnel.engine.common.config.server.CheckpointConfig checkpointConfig, ExecutorService executorService, com.hazelcast.map.IMap<Object,Object> runningJobStateIMap) throws org.apache.seatunnel.engine.checkpoint.storage.exception.CheckpointStorageException- 抛出:
org.apache.seatunnel.engine.checkpoint.storage.exception.CheckpointStorageException
-
-
方法详细资料
-
triggerSavePoints
public org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CompletedCheckpoint>[] triggerSavePoints()
Called by the JobMaster, actually triggered by the user.
After the savepoint is triggered, it will cause the job to stop automatically.
-
reportedPipelineRunning
public void reportedPipelineRunning(int pipelineId, boolean alreadyStarted)
-
handleCheckpointError
protected void handleCheckpointError(int pipelineId, boolean neverRestore)
-
reportCheckpointErrorFromTask
public void reportCheckpointErrorFromTask(TaskLocation taskLocation, String errorMsg)
-
getCheckpointCoordinator
public CheckpointCoordinator getCheckpointCoordinator(int pipelineId)
-
reportedTask
public void reportedTask(TaskReportStatusOperation reportStatusOperation)
-
readyToClose
public void readyToClose(TaskLocation taskLocation)
Called by theSourceSplitEnumeratorTask.
used by SourceSplitEnumeratorTask to tell CheckpointCoordinator pipeline will trigger close barrier by SourceSplitEnumeratorTask.
-
readyToCloseIdleTask
public void readyToCloseIdleTask(TaskLocation taskLocation)
Called by theSourceSplitEnumeratorTask.
used by SourceSplitEnumeratorTask to tell CheckpointCoordinator pipeline will trigger close barrier of idle task by SourceSplitEnumeratorTask.
-
listenPipeline
public CompletableFuture<Void> listenPipeline(int pipelineId, org.apache.seatunnel.engine.core.job.PipelineStatus pipelineStatus)
Called by the JobMaster.
Listen to thePipelineStatusof thePipeline, which is used to shut down the runningCheckpointIDCounterat the end of the pipeline.
-
clearCheckpointIfNeed
public void clearCheckpointIfNeed(org.apache.seatunnel.engine.core.job.JobStatus jobStatus)
Called by the JobMaster.
Listen to theJobStatusof theJob.
-
isCompletedPipeline
public boolean isCompletedPipeline(int pipelineId)
Called by the JobMaster.
Returns whether the pipeline has completed; No need to deploy/restore theSubPlanif the pipeline has been completed;
-
acknowledgeTask
public void acknowledgeTask(TaskAcknowledgeOperation ackOperation)
-
triggerSchemaChangeBeforeCheckpoint
public void triggerSchemaChangeBeforeCheckpoint(TriggerSchemaChangeBeforeCheckpointOperation operation)
-
triggerSchemaChangeAfterCheckpoint
public void triggerSchemaChangeAfterCheckpoint(TriggerSchemaChangeAfterCheckpointOperation operation)
-
isSavePointEnd
public boolean isSavePointEnd()
-
isPipelineSavePointEnd
public boolean isPipelineSavePointEnd(PipelineLocation pipelineLocation)
-
sendOperationToMemberNode
protected com.hazelcast.spi.impl.operationservice.impl.InvocationFuture<?> sendOperationToMemberNode(TaskOperation operation)
-
cancelCheckpoint
public org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CheckpointCoordinatorState> cancelCheckpoint(int pipelineId)
Call By JobMaster If all the tasks canceled or some task failed, JobMaster will call this method to cancel checkpoint coordinator.- 参数:
pipelineId-- 返回:
-
waitCheckpointCoordinatorComplete
public org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture<CheckpointCoordinatorState> waitCheckpointCoordinatorComplete(int pipelineId)
Call By JobMaster If all the tasks is finished, JobMaster will call this method to wait checkpoint coordinator complete.- 参数:
pipelineId-- 返回:
-
-