org.apache.flink.runtime.state.filesystem.FsCheckpointStorageLocation Java Examples

The following examples show how to use org.apache.flink.runtime.state.filesystem.FsCheckpointStorageLocation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PendingCheckpointTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private PendingCheckpoint createPendingCheckpoint(CheckpointProperties props, Executor executor) throws IOException {

		final Path checkpointDir = new Path(tmpFolder.newFolder().toURI());
		final FsCheckpointStorageLocation location = new FsCheckpointStorageLocation(
				LocalFileSystem.getSharedInstance(),
				checkpointDir, checkpointDir, checkpointDir,
				CheckpointStorageLocationReference.getDefault(),
				1024);

		final Map<ExecutionAttemptID, ExecutionVertex> ackTasks = new HashMap<>(ACK_TASKS);

		return new PendingCheckpoint(
			new JobID(),
			0,
			1,
			ackTasks,
			props,
			location,
			executor);
	}
 
Example #2
Source File: PendingCheckpointTest.java    From flink with Apache License 2.0 6 votes vote down vote up
private PendingCheckpoint createPendingCheckpoint(CheckpointProperties props, Executor executor) throws IOException {

		final Path checkpointDir = new Path(tmpFolder.newFolder().toURI());
		final FsCheckpointStorageLocation location = new FsCheckpointStorageLocation(
				LocalFileSystem.getSharedInstance(),
				checkpointDir, checkpointDir, checkpointDir,
				CheckpointStorageLocationReference.getDefault(),
				1024,
				4096);

		final Map<ExecutionAttemptID, ExecutionVertex> ackTasks = new HashMap<>(ACK_TASKS);

		return new PendingCheckpoint(
			new JobID(),
			0,
			1,
			ackTasks,
			props,
			location,
			executor);
	}
 
Example #3
Source File: SylphFsCheckpointStorage.java    From sylph with Apache License 2.0 6 votes vote down vote up
@Override
public CheckpointStorageLocation initializeLocationForCheckpoint(long checkpointId)
        throws IOException
{
    checkArgument(checkpointId >= 0);

    // prepare all the paths needed for the checkpoints
    final Path checkpointDir = createCheckpointDirectory(checkpointsDirectory, checkpointId);

    // create the checkpoint exclusive directory
    fileSystem.mkdirs(checkpointDir);

    return new FsCheckpointStorageLocation(
            fileSystem,
            checkpointDir,
            sharedStateDirectory,
            taskOwnedStateDirectory,
            CheckpointStorageLocationReference.getDefault(),
            fileSizeThreshold,
            writeBufferSize);
}
 
Example #4
Source File: SavepointOutputFormat.java    From flink with Apache License 2.0 5 votes vote down vote up
private static CheckpointStorageLocation createSavepointLocation(Path location) throws IOException {
	final CheckpointStorageLocationReference reference = AbstractFsCheckpointStorage.encodePathAsReference(location);
	return new FsCheckpointStorageLocation(
		location.getFileSystem(),
		location,
		location,
		location,
		reference,
		CheckpointingOptions.FS_SMALL_FILE_THRESHOLD.defaultValue(),
		CheckpointingOptions.FS_WRITE_BUFFER_SIZE.defaultValue());
}
 
Example #5
Source File: SylphFsCheckpointStorage.java    From sylph with Apache License 2.0 5 votes vote down vote up
@Override
public CheckpointStreamFactory resolveCheckpointStorageLocation(
        long checkpointId,
        CheckpointStorageLocationReference reference)
        throws IOException
{
    if (reference.isDefaultReference()) {
        // default reference, construct the default location for that particular checkpoint
        final Path checkpointDir = createCheckpointDirectory(checkpointsDirectory, checkpointId);

        return new FsCheckpointStorageLocation(
                fileSystem,
                checkpointDir,
                sharedStateDirectory,
                taskOwnedStateDirectory,
                reference,
                fileSizeThreshold,
                writeBufferSize);
    }
    else {
        // location encoded in the reference
        final Path path = decodePathFromReference(reference);

        return new FsCheckpointStorageLocation(
                path.getFileSystem(),
                path,
                path,
                path,
                reference,
                fileSizeThreshold,
                writeBufferSize);
    }
}
 
Example #6
Source File: SylphFsCheckpointStorage.java    From sylph with Apache License 2.0 5 votes vote down vote up
@Override
protected CheckpointStorageLocation createSavepointLocation(FileSystem fs, Path location)
        throws IOException
{
    final CheckpointStorageLocationReference reference = encodePathAsReference(location);
    return new FsCheckpointStorageLocation(fs, location, location, location, reference, fileSizeThreshold, writeBufferSize);
}
 
Example #7
Source File: SavepointOutputFormat.java    From flink with Apache License 2.0 5 votes vote down vote up
private static CheckpointStorageLocation createSavepointLocation(Path location) throws IOException {
	final CheckpointStorageLocationReference reference = AbstractFsCheckpointStorage.encodePathAsReference(location);
	return new FsCheckpointStorageLocation(
		location.getFileSystem(),
		location,
		location,
		location,
		reference,
		(int) CheckpointingOptions.FS_SMALL_FILE_THRESHOLD.defaultValue().getBytes(),
		CheckpointingOptions.FS_WRITE_BUFFER_SIZE.defaultValue());
}
 
Example #8
Source File: PendingCheckpointTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private PendingCheckpoint createPendingCheckpoint(
		CheckpointProperties props,
		Collection<OperatorID> operatorCoordinators,
		Collection<String> masterStateIdentifiers,
		Executor executor) throws IOException {

	final Path checkpointDir = new Path(tmpFolder.newFolder().toURI());
	final FsCheckpointStorageLocation location = new FsCheckpointStorageLocation(
			LocalFileSystem.getSharedInstance(),
			checkpointDir, checkpointDir, checkpointDir,
			CheckpointStorageLocationReference.getDefault(),
			1024,
			4096);

	final Map<ExecutionAttemptID, ExecutionVertex> ackTasks = new HashMap<>(ACK_TASKS);

	return new PendingCheckpoint(
		new JobID(),
		0,
		1,
		ackTasks,
		operatorCoordinators,
		masterStateIdentifiers,
		props,
		location,
		executor,
		new CompletableFuture<>());
}