public class BmcParallelReadAheadFSInputStream extends BmcFSInputStream
FSInputStream implementation that reads ahead to cache chunks of
data using parallel ranged GET requests. Like in-memory, but memory usage
is limited making it suitable for all files.closed, currentPosition, FIRST_READ_WINDOW_SIZE, firstRead, objectStorage, readMaxRetries, requestBuilder, retryPolicy, sourceInputStream, statistics, status| Constructor and Description |
|---|
BmcParallelReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
int readMaxRetries,
FileSystem.Statistics statistics,
ExecutorService executor,
int ociReadAheadBlockSize,
int readAheadBlockCount) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected long |
doSeek(long position)
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) |
protected int |
readAtPosition(long position,
byte[] buffer,
int offset,
int length)
Reads a specified number of bytes from the input stream at the given absolute position,
without changing the current file offset.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
String |
toString() |
available, checkNotClosed, getPos, getSourceInputStream, getStatistics, readAllBytes, readAllBytes, retryPolicy, seek, seekToNewSource, setSourceInputStream, validateState, wrapreadFully, validatePositionedReadArgsmark, markSupported, read, reset, skipclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmaxReadSizeForVectorReads, minSeekForVectorReads, readVectoredpublic BmcParallelReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
int readMaxRetries,
FileSystem.Statistics statistics,
ExecutorService executor,
int ociReadAheadBlockSize,
int readAheadBlockCount)
public int read()
throws IOException
read in class BmcFSInputStreamIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
read in interface PositionedReadableread in class FSInputStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws IOException
read in class BmcFSInputStreamIOExceptionpublic void readFully(long position,
byte[] buffer,
int offset,
int length)
throws IOException
readFully in interface PositionedReadablereadFully in class FSInputStreamIOExceptionprotected int readAtPosition(long position,
byte[] buffer,
int offset,
int length)
throws IOException
position - the absolute position in the input stream from where the data should be read.buffer - the buffer into which the data is read.offset - the start offset in the buffer at which the data should be written.length - the maximum number of bytes to be read from the input stream.IOException - if an I/O error occurs during the read operation.protected long doSeek(long position)
throws IOException
BmcFSInputStreamBmcFSInputStream.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 BmcFSInputStreamposition - The position to seek to.IOException - if the operation could not be completedpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class BmcFSInputStreamIOExceptionpublic String toString()
toString in class FSInputStreamCopyright © 2016–2025. All rights reserved.