public class S3ACachingInputStream extends S3ARemoteInputStream
InputStream that allows reading from an S3 file.
Prefetched blocks are cached to local disk if a seek away from the
current block is issued.| Constructor and Description |
|---|
S3ACachingInputStream(S3AReadOpContext context,
S3ObjectAttributes s3Attributes,
S3AInputStream.InputStreamCallbacks client,
S3AInputStreamStatistics streamStatistics,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.LocalDirAllocator localDirAllocator)
Initializes a new instance of the
S3ACachingInputStream class. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and releases all acquired resources.
|
protected org.apache.hadoop.fs.impl.prefetch.BlockManager |
createBlockManager(org.apache.hadoop.fs.impl.prefetch.BlockManagerParameters blockManagerParameters,
S3ARemoteObjectReader reader) |
protected boolean |
ensureCurrentBuffer()
Ensures that a non-empty valid buffer is available for immediate reading.
|
String |
toString() |
available, getBlockData, getContext, getFile, getFilePosition, getIOStatistics, getName, getNextReadPos, getOffsetStr, getPos, getReader, getS3AStreamStatistics, getS3File, getS3ObjectAttributes, hasCapability, isClosed, mark, markSupported, read, read, read, reset, seek, setReadahead, skip, throwIfClosed, throwIfInvalidSeekpublic S3ACachingInputStream(S3AReadOpContext context, S3ObjectAttributes s3Attributes, S3AInputStream.InputStreamCallbacks client, S3AInputStreamStatistics streamStatistics, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.LocalDirAllocator localDirAllocator)
S3ACachingInputStream class.context - read-specific operation context.s3Attributes - attributes of the S3 object being read.client - callbacks used for interacting with the underlying S3 client.streamStatistics - statistics for this stream.conf - the configuration.localDirAllocator - the local dir allocator instance.IllegalArgumentException - if context is null.IllegalArgumentException - if s3Attributes is null.IllegalArgumentException - if client is null.public void close()
throws IOException
S3ARemoteInputStreamclose in interface Closeableclose in interface AutoCloseableclose in class S3ARemoteInputStreamIOException - if there is an IO error during this operation.protected boolean ensureCurrentBuffer()
throws IOException
S3ARemoteInputStreamensureCurrentBuffer in class S3ARemoteInputStreamIOException - if there is an IO error during this operation.public String toString()
toString in class S3ARemoteInputStreamprotected org.apache.hadoop.fs.impl.prefetch.BlockManager createBlockManager(@Nonnull org.apache.hadoop.fs.impl.prefetch.BlockManagerParameters blockManagerParameters, S3ARemoteObjectReader reader)
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.