Java Code Examples for org.apache.flink.streaming.api.functions.sink.filesystem.utils.NoOpRecoverable

The following examples show how to use org.apache.flink.streaming.api.functions.sink.filesystem.utils.NoOpRecoverable. These examples are extracted from open source projects. 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 Project: flink   Source File: BucketTest.java    License: Apache License 2.0 6 votes vote down vote up
private Bucket<String, String> getRestoredBucketWithOnlyInProgressPart(final BaseStubWriter writer) throws IOException {
	final BucketState<String> stateWithOnlyInProgressFile =
			new BucketState<>(
				"test",
				new Path(),
				12345L,
				new OutputStreamBasedPartFileWriter.OutputStreamBasedInProgressFileRecoverable(new NoOpRecoverable()),
				new HashMap<>());

	return Bucket.restore(
		0,
		1L,
		new RowWiseBucketWriter<>(writer, ENCODER),
		rollingPolicy,
		stateWithOnlyInProgressFile,
		OutputFileConfig.builder().build());
}
 
Example 2
Source Project: Flink-CEPplus   Source File: BucketTest.java    License: Apache License 2.0 5 votes vote down vote up
private Map<Long, List<RecoverableWriter.CommitRecoverable>> createPendingPartsPerCheckpoint(int noOfCheckpoints) {
	final Map<Long, List<RecoverableWriter.CommitRecoverable>> pendingCommittablesPerCheckpoint = new HashMap<>();
	for (int checkpointId = 0; checkpointId < noOfCheckpoints; checkpointId++) {
		final List<RecoverableWriter.CommitRecoverable> pending = new ArrayList<>();
		pending.add(new NoOpRecoverable());
		pendingCommittablesPerCheckpoint.put((long) checkpointId, pending);
	}
	return pendingCommittablesPerCheckpoint;
}
 
Example 3
Source Project: flink   Source File: BucketTest.java    License: Apache License 2.0 5 votes vote down vote up
private Map<Long, List<RecoverableWriter.CommitRecoverable>> createPendingPartsPerCheckpoint(int noOfCheckpoints) {
	final Map<Long, List<RecoverableWriter.CommitRecoverable>> pendingCommittablesPerCheckpoint = new HashMap<>();
	for (int checkpointId = 0; checkpointId < noOfCheckpoints; checkpointId++) {
		final List<RecoverableWriter.CommitRecoverable> pending = new ArrayList<>();
		pending.add(new NoOpRecoverable());
		pendingCommittablesPerCheckpoint.put((long) checkpointId, pending);
	}
	return pendingCommittablesPerCheckpoint;
}
 
Example 4
Source Project: flink   Source File: BucketTest.java    License: Apache License 2.0 5 votes vote down vote up
private Map<Long, List<InProgressFileWriter.PendingFileRecoverable>> createPendingPartsPerCheckpoint(int noOfCheckpoints) {
	final Map<Long, List<InProgressFileWriter.PendingFileRecoverable>> pendingCommittablesPerCheckpoint = new HashMap<>();
	for (int checkpointId = 0; checkpointId < noOfCheckpoints; checkpointId++) {
		final List<InProgressFileWriter.PendingFileRecoverable> pending = new ArrayList<>();
		pending.add(new OutputStreamBasedPartFileWriter.OutputStreamBasedPendingFileRecoverable(new NoOpRecoverable()));
		pendingCommittablesPerCheckpoint.put((long) checkpointId, pending);
	}
	return pendingCommittablesPerCheckpoint;
}
 
Example 5
Source Project: Flink-CEPplus   Source File: BucketTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}
 
Example 6
Source Project: Flink-CEPplus   Source File: BucketTest.java    License: Apache License 2.0 4 votes vote down vote up
private Bucket<String, String> getRestoredBucketWithOnlyInProgressPart(final BaseStubWriter writer) throws IOException {
	final BucketState<String> stateWithOnlyInProgressFile =
			new BucketState<>("test", new Path(), 12345L, new NoOpRecoverable(), new HashMap<>());
	return Bucket.restore(writer, 0, 1L, partFileFactory, rollingPolicy, stateWithOnlyInProgressFile);
}
 
Example 7
Source Project: flink   Source File: BucketTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}
 
Example 8
Source Project: flink   Source File: BucketTest.java    License: Apache License 2.0 4 votes vote down vote up
private Bucket<String, String> getRestoredBucketWithOnlyInProgressPart(final BaseStubWriter writer) throws IOException {
	final BucketState<String> stateWithOnlyInProgressFile =
			new BucketState<>("test", new Path(), 12345L, new NoOpRecoverable(), new HashMap<>());
	return Bucket.restore(writer, 0, 1L, partFileFactory, rollingPolicy, stateWithOnlyInProgressFile, new PartFileConfig());
}
 
Example 9
Source Project: flink   Source File: BucketTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}