public class BmcReadAheadFSInputStream extends BmcFSInputStream
FSInputStream
implementation that reads ahead to cache chunks of
data. Like in-memory, but memory usage is limited making it suitable for all
files.Modifier and Type | Class and Description |
---|---|
static class |
BmcReadAheadFSInputStream.ParquetFooterInfo
Parquet caching.
|
closed, currentPosition, objectStorage, readMaxRetries, requestBuilder, retryMetricsCollector, retryPolicy, sourceInputStream, statistics, status
Constructor and Description |
---|
BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
int readMaxRetries,
FileSystem.Statistics statistics,
int ociReadAheadBlockSize,
com.google.common.cache.Cache<String,BmcReadAheadFSInputStream.ParquetFooterInfo> parquetCache,
RetryMetricsCollector retryMetricsCollector,
boolean firstReadOptimizationForTTFBEnabled,
boolean parquetCacheEnabled) |
BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
int readMaxRetries,
FileSystem.Statistics statistics,
int ociReadAheadBlockSize,
String parquetCacheString,
RetryMetricsCollector retryMetricsCollector,
boolean firstReadOptimizationForTTFBEnabled,
boolean parquetCacheEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected long |
doSeek(long pos)
Perform the requested seek operation.
|
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer) |
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
boolean |
seekToNewSource(long targetPos)
There are no new sources, this method always returns false.
|
String |
toString() |
available, checkNotClosed, getPos, getSourceInputStream, getStatistics, readAllBytes, readAllBytes, retryPolicy, seek, setSourceInputStream, validateState, wrap
validatePositionedReadArgs
mark, markSupported, read, reset, skip
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
maxReadSizeForVectorReads, minSeekForVectorReads, readVectored
public BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage, FileStatus status, Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder, int readMaxRetries, FileSystem.Statistics statistics, int ociReadAheadBlockSize, com.google.common.cache.Cache<String,BmcReadAheadFSInputStream.ParquetFooterInfo> parquetCache, RetryMetricsCollector retryMetricsCollector, boolean firstReadOptimizationForTTFBEnabled, boolean parquetCacheEnabled)
public BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage, FileStatus status, Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder, int readMaxRetries, FileSystem.Statistics statistics, int ociReadAheadBlockSize, String parquetCacheString, RetryMetricsCollector retryMetricsCollector, boolean firstReadOptimizationForTTFBEnabled, boolean parquetCacheEnabled)
public int read() throws IOException
read
in class BmcFSInputStream
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
read
in interface PositionedReadable
read
in class FSInputStream
IOException
public int read(byte[] buffer, int offset, int length) throws IOException
read
in class BmcFSInputStream
IOException
public void readFully(long position, byte[] buffer) throws IOException
readFully
in interface PositionedReadable
readFully
in class FSInputStream
IOException
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
readFully
in interface PositionedReadable
readFully
in class FSInputStream
IOException
protected long doSeek(long pos) throws IOException
BmcFSInputStream
BmcFSInputStream.setSourceInputStream(InputStream)
before returning. The input stream that was
originally created (and wrapped by BmcFSInputStream.wrap(InputStream)
can be obtained from
BmcFSInputStream.getSourceInputStream()
.doSeek
in class BmcFSInputStream
pos
- The position to seek to.IOException
- if the operation could not be completedpublic boolean seekToNewSource(long targetPos)
BmcFSInputStream
seekToNewSource
in interface Seekable
seekToNewSource
in class BmcFSInputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class BmcFSInputStream
IOException
public String toString()
toString
in class FSInputStream
Copyright © 2016–2025. All rights reserved.