Package org.apache.hadoop.fs.s3a
Class S3ADataBlocks.BlockUploadData
java.lang.Object
org.apache.hadoop.fs.s3a.S3ADataBlocks.BlockUploadData
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- S3ADataBlocks
The output information for an upload.
The data is accessed via the content provider; other constructors create the appropriate content provider for the data.
When close() is called, the content provider is itself closed.
-
Constructor Summary
ConstructorsConstructorDescriptionBlockUploadData(byte[] bytes, int offset, int size, Supplier<Boolean> isOpen) Byte array constructor, with support for uploading just a slice of the array.BlockUploadData(byte[] bytes, Supplier<Boolean> isOpen) Byte array constructor to upload all of the array.BlockUploadData(File file, Supplier<Boolean> isOpen) File constructor; input stream will be null.BlockUploadData(UploadContentProviders.BaseContentProvider<?> contentProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close: closes any upload stream provided in the constructor.The content provider.
-
Constructor Details
-
BlockUploadData
-
BlockUploadData
File constructor; input stream will be null.- Parameters:
file- file to uploadisOpen- optional predicate to check if the stream is open.
-
BlockUploadData
Byte array constructor, with support for uploading just a slice of the array.- Parameters:
bytes- buffer to read.offset- offset in buffer.size- size of the data.isOpen- optional predicate to check if the stream is open.- Throws:
IllegalArgumentException- if the arguments are invalid.NullPointerException- if the buffer is null.
-
BlockUploadData
Byte array constructor to upload all of the array.- Parameters:
bytes- buffer to read.isOpen- optional predicate to check if the stream is open.- Throws:
IllegalArgumentException- if the arguments are invalid.NullPointerException- if the buffer is null.
-
-
Method Details
-
getContentProvider
The content provider.- Returns:
- the content provider
-
close
Close: closes any upload stream provided in the constructor.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- inherited exception
-