public final class UploadContentProviders extends Object
software.amazon.awssdk.http.ContentStreamProvider.
These are required to ensure that retry of multipart uploads are reliable, while also avoiding memory copy/consumption overhead.
For these reasons the providers built in to the AWS SDK are not used.
See HADOOP-19221 for details.
| Modifier and Type | Class and Description |
|---|---|
static class |
UploadContentProviders.BaseContentProvider<T extends InputStream>
Base class for content providers; tracks the number of times a stream
has been opened.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method and Description |
|---|---|
static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> |
byteArrayContentProvider(byte[] bytes)
Create a content provider for all of a byte array.
|
static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> |
byteArrayContentProvider(byte[] bytes,
int offset,
int size)
Create a content provider for all or part of a byte array.
|
static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> |
byteArrayContentProvider(byte[] bytes,
int offset,
int size,
Supplier<Boolean> isOpen)
Create a content provider for all or part of a byte array.
|
static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> |
byteArrayContentProvider(byte[] bytes,
Supplier<Boolean> isOpen)
Create a content provider for all of a byte array.
|
static UploadContentProviders.BaseContentProvider<org.apache.hadoop.fs.store.ByteBufferInputStream> |
byteBufferContentProvider(ByteBuffer byteBuffer,
int size)
Create a content provider from a byte buffer.
|
static UploadContentProviders.BaseContentProvider<org.apache.hadoop.fs.store.ByteBufferInputStream> |
byteBufferContentProvider(ByteBuffer byteBuffer,
int size,
Supplier<Boolean> isOpen)
Create a content provider from a byte buffer.
|
static UploadContentProviders.BaseContentProvider<BufferedInputStream> |
fileContentProvider(File file,
long offset,
int size)
Create a content provider from a file.
|
static UploadContentProviders.BaseContentProvider<BufferedInputStream> |
fileContentProvider(File file,
long offset,
int size,
Supplier<Boolean> isOpen)
Create a content provider from a file.
|
public static UploadContentProviders.BaseContentProvider<BufferedInputStream> fileContentProvider(File file, long offset, int size)
file - file to read.offset - offset in file.size - of data.IllegalArgumentException - if the offset is negative.public static UploadContentProviders.BaseContentProvider<BufferedInputStream> fileContentProvider(File file, long offset, int size, Supplier<Boolean> isOpen)
file - file to read.offset - offset in file.size - of data.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the offset is negative.public static UploadContentProviders.BaseContentProvider<org.apache.hadoop.fs.store.ByteBufferInputStream> byteBufferContentProvider(ByteBuffer byteBuffer, int size)
byteBuffer - buffer to read.size - size of the data.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is nullpublic static UploadContentProviders.BaseContentProvider<org.apache.hadoop.fs.store.ByteBufferInputStream> byteBufferContentProvider(ByteBuffer byteBuffer, int size, @Nullable Supplier<Boolean> isOpen)
byteBuffer - buffer to read.size - size of the data.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is nullpublic static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> byteArrayContentProvider(byte[] bytes, int offset, int size)
bytes - buffer to read.offset - offset in buffer.size - size of the data.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.public static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> byteArrayContentProvider(byte[] bytes, int offset, int size, @Nullable Supplier<Boolean> isOpen)
bytes - buffer to read.offset - offset in buffer.size - size of the data.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.public static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> byteArrayContentProvider(byte[] bytes)
bytes - buffer to read.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.public static UploadContentProviders.BaseContentProvider<ByteArrayInputStream> byteArrayContentProvider(byte[] bytes, @Nullable Supplier<Boolean> isOpen)
bytes - buffer to read.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.