Java Code Examples for org.apache.flink.fs.s3.common.utils.RefCountedBufferingFileStream#openNew()

The following examples show how to use org.apache.flink.fs.s3.common.utils.RefCountedBufferingFileStream#openNew() . 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: S3RecoverableFsDataOutputStreamTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Before
public void beforeTest() throws IOException {
	fileProvider = new TestFileProvider(TEMP_FOLDER);

	multipartUploadUnderTest = new TestMultipartUpload(fileProvider);

	RefCountedBufferingFileStream fileStream = RefCountedBufferingFileStream.openNew(fileProvider);

	streamUnderTest = new S3RecoverableFsDataOutputStream(
			multipartUploadUnderTest,
			fileProvider,
			fileStream,
			USER_DEFINED_MIN_PART_SIZE,
			0L
	);
}
 
Example 2
Source File: S3RecoverableFsDataOutputStreamTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void beforeTest() throws IOException {
	fileProvider = new TestFileProvider(TEMP_FOLDER);

	multipartUploadUnderTest = new TestMultipartUpload(fileProvider);

	RefCountedBufferingFileStream fileStream = RefCountedBufferingFileStream.openNew(fileProvider);

	streamUnderTest = new S3RecoverableFsDataOutputStream(
			multipartUploadUnderTest,
			fileProvider,
			fileStream,
			USER_DEFINED_MIN_PART_SIZE,
			0L
	);
}
 
Example 3
Source File: S3RecoverableFsDataOutputStreamTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Before
public void beforeTest() throws IOException {
	fileProvider = new TestFileProvider(TEMP_FOLDER);

	multipartUploadUnderTest = new TestMultipartUpload(fileProvider);

	RefCountedBufferingFileStream fileStream = RefCountedBufferingFileStream.openNew(fileProvider);

	streamUnderTest = new S3RecoverableFsDataOutputStream(
			multipartUploadUnderTest,
			fileProvider,
			fileStream,
			USER_DEFINED_MIN_PART_SIZE,
			0L
	);
}
 
Example 4
Source File: S3RecoverableFsDataOutputStream.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private void uploadCurrentAndOpenNewPart(long fileLength) throws IOException {
	bytesBeforeCurrentPart += fileLength;
	closeAndUploadPart();

	// initialize a new temp file
	fileStream = RefCountedBufferingFileStream.openNew(tmpFileProvider);
}
 
Example 5
Source File: S3RecoverableFsDataOutputStream.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static RefCountedBufferingFileStream boundedBufferingFileStream(
		final FunctionWithException<File, RefCountedFile, IOException> tmpFileCreator,
		final Optional<File> incompletePart) throws IOException {

	if (!incompletePart.isPresent()) {
		return RefCountedBufferingFileStream.openNew(tmpFileCreator);
	}

	final File file = incompletePart.get();
	return RefCountedBufferingFileStream.restore(tmpFileCreator, file);
}
 
Example 6
Source File: S3RecoverableFsDataOutputStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private void uploadCurrentAndOpenNewPart(long fileLength) throws IOException {
	bytesBeforeCurrentPart += fileLength;
	closeAndUploadPart();

	// initialize a new temp file
	fileStream = RefCountedBufferingFileStream.openNew(tmpFileProvider);
}
 
Example 7
Source File: S3RecoverableFsDataOutputStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private static RefCountedBufferingFileStream boundedBufferingFileStream(
		final FunctionWithException<File, RefCountedFile, IOException> tmpFileCreator,
		final Optional<File> incompletePart) throws IOException {

	if (!incompletePart.isPresent()) {
		return RefCountedBufferingFileStream.openNew(tmpFileCreator);
	}

	final File file = incompletePart.get();
	return RefCountedBufferingFileStream.restore(tmpFileCreator, file);
}
 
Example 8
Source File: S3RecoverableFsDataOutputStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private void uploadCurrentAndOpenNewPart(long fileLength) throws IOException {
	bytesBeforeCurrentPart += fileLength;
	closeAndUploadPart();

	// initialize a new temp file
	fileStream = RefCountedBufferingFileStream.openNew(tmpFileProvider);
}
 
Example 9
Source File: S3RecoverableFsDataOutputStream.java    From flink with Apache License 2.0 5 votes vote down vote up
private static RefCountedBufferingFileStream boundedBufferingFileStream(
		final FunctionWithException<File, RefCountedFileWithStream, IOException> tmpFileCreator,
		final Optional<File> incompletePart) throws IOException {

	if (!incompletePart.isPresent()) {
		return RefCountedBufferingFileStream.openNew(tmpFileCreator);
	}

	final File file = incompletePart.get();
	return RefCountedBufferingFileStream.restore(tmpFileCreator, file);
}