Search in sources :

Example 1 with CheckpointStorageCoordinatorView

use of org.apache.flink.runtime.state.CheckpointStorageCoordinatorView in project flink by apache.

the class DispatcherTest method createTestingSavepoint.

@Nonnull
private URI createTestingSavepoint() throws IOException, URISyntaxException {
    final CheckpointStorage storage = Checkpoints.loadCheckpointStorage(configuration, Thread.currentThread().getContextClassLoader(), log);
    final CheckpointStorageCoordinatorView checkpointStorage = storage.createCheckpointStorage(jobGraph.getJobID());
    final File savepointFile = temporaryFolder.newFolder();
    final long checkpointId = 1L;
    final CheckpointStorageLocation checkpointStorageLocation = checkpointStorage.initializeLocationForSavepoint(checkpointId, savepointFile.getAbsolutePath());
    final CheckpointMetadataOutputStream metadataOutputStream = checkpointStorageLocation.createMetadataOutputStream();
    Checkpoints.storeCheckpointMetadata(new CheckpointMetadata(checkpointId, Collections.emptyList(), Collections.emptyList()), metadataOutputStream);
    final CompletedCheckpointStorageLocation completedCheckpointStorageLocation = metadataOutputStream.closeAndFinalizeCheckpoint();
    return new URI(completedCheckpointStorageLocation.getExternalPointer());
}
Also used : CheckpointMetadataOutputStream(org.apache.flink.runtime.state.CheckpointMetadataOutputStream) CheckpointStorage(org.apache.flink.runtime.state.CheckpointStorage) CheckpointStorageCoordinatorView(org.apache.flink.runtime.state.CheckpointStorageCoordinatorView) CheckpointStorageLocation(org.apache.flink.runtime.state.CheckpointStorageLocation) CompletedCheckpointStorageLocation(org.apache.flink.runtime.state.CompletedCheckpointStorageLocation) CompletedCheckpointStorageLocation(org.apache.flink.runtime.state.CompletedCheckpointStorageLocation) File(java.io.File) URI(java.net.URI) CheckpointMetadata(org.apache.flink.runtime.checkpoint.metadata.CheckpointMetadata) Nonnull(javax.annotation.Nonnull)

Aggregations

File (java.io.File)1 URI (java.net.URI)1 Nonnull (javax.annotation.Nonnull)1 CheckpointMetadata (org.apache.flink.runtime.checkpoint.metadata.CheckpointMetadata)1 CheckpointMetadataOutputStream (org.apache.flink.runtime.state.CheckpointMetadataOutputStream)1 CheckpointStorage (org.apache.flink.runtime.state.CheckpointStorage)1 CheckpointStorageCoordinatorView (org.apache.flink.runtime.state.CheckpointStorageCoordinatorView)1 CheckpointStorageLocation (org.apache.flink.runtime.state.CheckpointStorageLocation)1 CompletedCheckpointStorageLocation (org.apache.flink.runtime.state.CompletedCheckpointStorageLocation)1