use of org.apache.flink.runtime.state.TestingCheckpointStorageAccessCoordinatorView in project flink by apache.
the class OperatorCoordinatorSchedulerTest method createSchedulerWithRestoredSavepoint.
private DefaultScheduler createSchedulerWithRestoredSavepoint(byte[] coordinatorState) throws Exception {
final byte[] savepointMetadata = serializeAsCheckpointMetadata(testOperatorId, coordinatorState);
final String savepointPointer = "testingSavepointPointer";
final TestingCheckpointStorageAccessCoordinatorView storage = new TestingCheckpointStorageAccessCoordinatorView();
storage.registerSavepoint(savepointPointer, savepointMetadata);
final Consumer<JobGraph> savepointConfigurer = (jobGraph) -> {
SchedulerTestingUtils.enableCheckpointing(jobGraph, new ModernStateBackend(), storage.asCheckpointStorage());
jobGraph.setSavepointRestoreSettings(SavepointRestoreSettings.forPath(savepointPointer));
};
final DefaultScheduler scheduler = setupTestJobAndScheduler(new TestingOperatorCoordinator.Provider(testOperatorId), null, savepointConfigurer, false);
scheduler.startScheduling();
return scheduler;
}
Aggregations