use of org.apache.flink.core.execution.SavepointFormatType in project flink by apache.
the class SavepointFormatITCase method testTriggerSavepointAndResumeWithFileBasedCheckpointsAndRelocateBasePath.
@ParameterizedTest(name = "[{index}] {0}, {1}")
@MethodSource("parameters")
public void testTriggerSavepointAndResumeWithFileBasedCheckpointsAndRelocateBasePath(SavepointFormatType formatType, StateBackendConfig stateBackendConfig) throws Exception {
final int numTaskManagers = 2;
final int numSlotsPerTaskManager = 2;
final Configuration config = stateBackendConfig.getConfiguration();
config.set(CheckpointingOptions.CHECKPOINTS_DIRECTORY, checkpointsDir.toUri().toString());
final MiniClusterWithClientResource miniClusterResource = new MiniClusterWithClientResource(new MiniClusterResourceConfiguration.Builder().setConfiguration(config).setNumberTaskManagers(numTaskManagers).setNumberSlotsPerTaskManager(numSlotsPerTaskManager).build());
miniClusterResource.before();
try {
final String savepointPath = submitJobAndTakeSavepoint(miniClusterResource, formatType, stateBackendConfig.getCheckpointsBeforeSavepoint(), config);
final CheckpointMetadata metadata = loadCheckpointMetadata(savepointPath);
final OperatorState operatorState = metadata.getOperatorStates().stream().filter(hasKeyedState()).findFirst().get();
operatorState.getStates().stream().flatMap(subtaskState -> subtaskState.getManagedKeyedState().stream()).forEach(handle -> validateState(handle, formatType, stateBackendConfig));
relocateAndVerify(miniClusterResource, savepointPath, renamedSavepointDir, config);
} finally {
miniClusterResource.after();
}
}
Aggregations