use of org.apache.flink.fs.s3.common.utils.RefCountedBufferingFileStream in project flink by apache.
the class RecoverableMultiPartUploadImplTest method uploadingNonClosedFileAsCompleteShouldThroughException.
@Test(expected = IllegalStateException.class)
public void uploadingNonClosedFileAsCompleteShouldThroughException() throws IOException {
final byte[] incompletePart = bytesOf("!!!");
final RefCountedBufferingFileStream incompletePartFile = writeContent(incompletePart);
multiPartUploadUnderTest.uploadPart(incompletePartFile);
}
use of org.apache.flink.fs.s3.common.utils.RefCountedBufferingFileStream in project flink by apache.
the class RecoverableMultiPartUploadImplTest method writeContent.
private RefCountedBufferingFileStream writeContent(byte[] content) throws IOException {
final File newFile = new File(temporaryFolder.getRoot(), ".tmp_" + UUID.randomUUID());
final OutputStream out = Files.newOutputStream(newFile.toPath(), StandardOpenOption.CREATE_NEW);
final RefCountedBufferingFileStream testStream = new RefCountedBufferingFileStream(RefCountedFileWithStream.newFile(newFile, out), BUFFER_SIZE);
testStream.write(content, 0, content.length);
return testStream;
}
use of org.apache.flink.fs.s3.common.utils.RefCountedBufferingFileStream in project flink by apache.
the class RecoverableMultiPartUploadImplTest method uploadObject.
private S3Recoverable uploadObject(byte[] content) throws IOException {
final RefCountedBufferingFileStream incompletePartFile = writeContent(content);
incompletePartFile.flush();
return multiPartUploadUnderTest.snapshotAndGetRecoverable(incompletePartFile);
}
Aggregations