Java源码示例:org.apache.flink.streaming.api.functions.sink.filesystem.utils.NoOpRecoverable

示例1
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());
}
 
示例2
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;
}
 
示例3
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;
}
 
示例4
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;
}
 
示例5
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}
 
示例6
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);
}
 
示例7
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}
 
示例8
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());
}
 
示例9
@Override
public RecoverableFsDataOutputStream.Committer recoverForCommit(CommitRecoverable resumable) throws IOException {
	checkArgument(resumable instanceof NoOpRecoverable);
	recoverForCommitCallCounter++;
	return new NoOpCommitter();
}