@InterfaceStability.Unstable public class S3AFastOutputStream extends OutputStream
Uploads are managed low-level rather than through the AWS TransferManager. This allows for uploading each part of a multi-part upload as soon as the bytes are in memory, rather than waiting until the file is closed.
Unstable: statistics and error handling might evolve
| Constructor and Description |
|---|
S3AFastOutputStream(com.amazonaws.services.s3.AmazonS3Client client,
S3AFileSystem fs,
String bucket,
String key,
Progressable progress,
FileSystem.Statistics statistics,
com.amazonaws.services.s3.model.CannedAccessControlList cannedACL,
String serverSideEncryptionAlgorithm,
long partSize,
long multiPartThreshold,
ThreadPoolExecutor threadPoolExecutor)
Creates a fast OutputStream that uploads to S3 from memory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
write(byte[] b,
int off,
int len)
Writes a range of bytes from to the memory buffer.
|
void |
write(int b)
Writes a byte to the memory buffer.
|
flush, writepublic S3AFastOutputStream(com.amazonaws.services.s3.AmazonS3Client client,
S3AFileSystem fs,
String bucket,
String key,
Progressable progress,
FileSystem.Statistics statistics,
com.amazonaws.services.s3.model.CannedAccessControlList cannedACL,
String serverSideEncryptionAlgorithm,
long partSize,
long multiPartThreshold,
ThreadPoolExecutor threadPoolExecutor)
throws IOException
client - AmazonS3Client used for S3 callsfs - S3AFilesystembucket - S3 bucket namekey - S3 key nameprogress - report progress in order to prevent timeoutsstatistics - track FileSystem.Statistics on the performed operationscannedACL - used CannedAccessControlListserverSideEncryptionAlgorithm - algorithm for server side encryptionpartSize - size of a single part in a multi-part upload (except
last part)multiPartThreshold - files at least this size use multi-part uploadIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamb - the int of which the lowest byte is writtenIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamb - byte array containingoff - offset in array where to startlen - number of bytes to be writtenIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2018 CERN. All Rights Reserved.