@Override JobGraph validateGraph() { JobGraph jobGraph = super.validateGraph(); final SavepointRestoreSettings savepointRestoreSettings = jobGraph.getSavepointRestoreSettings(); Assert.assertTrue(savepointRestoreSettings.allowNonRestoredState()); Assert.assertEquals(RESTORE_PATH, savepointRestoreSettings.getRestorePath()); return jobGraph; } }
@Override JobGraph validateDefaultGraph() { JobGraph jobGraph = super.validateDefaultGraph(); final SavepointRestoreSettings savepointRestoreSettings = jobGraph.getSavepointRestoreSettings(); Assert.assertFalse(savepointRestoreSettings.allowNonRestoredState()); Assert.assertNull(savepointRestoreSettings.getRestorePath()); return jobGraph; }
assertEquals("unknown path", jobGraph.getSavepointRestoreSettings().getRestorePath());
SavepointRestoreSettings savepointSettings = options.getSavepointRestoreSettings(); assertTrue(savepointSettings.restoreSavepoint()); assertEquals("expectedSavepointPath", savepointSettings.getRestorePath()); assertFalse(savepointSettings.allowNonRestoredState()); SavepointRestoreSettings savepointSettings = options.getSavepointRestoreSettings(); assertTrue(savepointSettings.restoreSavepoint()); assertEquals("expectedSavepointPath", savepointSettings.getRestorePath()); assertTrue(savepointSettings.allowNonRestoredState());
/** * Tries to restore the given {@link ExecutionGraph} from the provided {@link SavepointRestoreSettings}. * * @param executionGraphToRestore {@link ExecutionGraph} which is supposed to be restored * @param savepointRestoreSettings {@link SavepointRestoreSettings} containing information about the savepoint to restore from * @throws Exception if the {@link ExecutionGraph} could not be restored */ private void tryRestoreExecutionGraphFromSavepoint(ExecutionGraph executionGraphToRestore, SavepointRestoreSettings savepointRestoreSettings) throws Exception { if (savepointRestoreSettings.restoreSavepoint()) { final CheckpointCoordinator checkpointCoordinator = executionGraphToRestore.getCheckpointCoordinator(); if (checkpointCoordinator != null) { checkpointCoordinator.restoreSavepoint( savepointRestoreSettings.getRestorePath(), savepointRestoreSettings.allowNonRestoredState(), executionGraphToRestore.getAllVertices(), userCodeLoader); } } }
/** * Tries to restore the given {@link ExecutionGraph} from the provided {@link SavepointRestoreSettings}. * * @param executionGraphToRestore {@link ExecutionGraph} which is supposed to be restored * @param savepointRestoreSettings {@link SavepointRestoreSettings} containing information about the savepoint to restore from * @throws Exception if the {@link ExecutionGraph} could not be restored */ private void tryRestoreExecutionGraphFromSavepoint(ExecutionGraph executionGraphToRestore, SavepointRestoreSettings savepointRestoreSettings) throws Exception { if (savepointRestoreSettings.restoreSavepoint()) { final CheckpointCoordinator checkpointCoordinator = executionGraphToRestore.getCheckpointCoordinator(); if (checkpointCoordinator != null) { checkpointCoordinator.restoreSavepoint( savepointRestoreSettings.getRestorePath(), savepointRestoreSettings.allowNonRestoredState(), executionGraphToRestore.getAllVertices(), userCodeLoader); } } }
} catch (Exception e) { final String message = String.format("Could not restore from initial savepoint. This might indicate " + "that the savepoint %s got corrupted.", jobGraph.getSavepointRestoreSettings().getRestorePath());
} catch (Exception e) { final String message = String.format("Could not restore from initial savepoint. This might indicate " + "that the savepoint %s got corrupted.", jobGraph.getSavepointRestoreSettings().getRestorePath());
} catch (Exception e) { final String message = String.format("Could not restore from initial savepoint. This might indicate " + "that the savepoint %s got corrupted.", jobGraph.getSavepointRestoreSettings().getRestorePath());
/** * Tries to restore the given {@link ExecutionGraph} from the provided {@link SavepointRestoreSettings}. * * @param executionGraphToRestore {@link ExecutionGraph} which is supposed to be restored * @param savepointRestoreSettings {@link SavepointRestoreSettings} containing information about the savepoint to restore from * @throws Exception if the {@link ExecutionGraph} could not be restored */ private void tryRestoreExecutionGraphFromSavepoint(ExecutionGraph executionGraphToRestore, SavepointRestoreSettings savepointRestoreSettings) throws Exception { if (savepointRestoreSettings.restoreSavepoint()) { final CheckpointCoordinator checkpointCoordinator = executionGraphToRestore.getCheckpointCoordinator(); if (checkpointCoordinator != null) { checkpointCoordinator.restoreSavepoint( savepointRestoreSettings.getRestorePath(), savepointRestoreSettings.allowNonRestoredState(), savepointRestoreSettings.resumeFromLatestCheckpoint(), executionGraphToRestore.getAllVertices(), userCodeLoader); } } }