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, requestBuilder, sourceInputStream, statistics, status
Constructor and Description |
---|
BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
FileSystem.Statistics statistics,
int ociReadAheadBlockSize,
com.google.common.cache.Cache<String,BmcReadAheadFSInputStream.ParquetFooterInfo> parquetCache) |
BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage,
FileStatus status,
Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder,
FileSystem.Statistics statistics,
int ociReadAheadBlockSize,
String parquetCacheString) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected long |
doSeek(long pos)
Perform the requested seek operation.
|
long |
getPos() |
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) |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos)
There are no new sources, this method always returns false.
|
String |
toString() |
available, getSourceInputStream, getStatistics, setSourceInputStream, validateState, wrap
validatePositionedReadArgs
mark, markSupported, read, reset, skip
public BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage, FileStatus status, Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder, FileSystem.Statistics statistics, int ociReadAheadBlockSize, com.google.common.cache.Cache<String,BmcReadAheadFSInputStream.ParquetFooterInfo> parquetCache)
public BmcReadAheadFSInputStream(com.oracle.bmc.objectstorage.ObjectStorage objectStorage, FileStatus status, Supplier<com.oracle.bmc.objectstorage.requests.GetObjectRequest.Builder> requestBuilder, FileSystem.Statistics statistics, int ociReadAheadBlockSize, String parquetCacheString)
public long getPos()
getPos
in interface Seekable
getPos
in class BmcFSInputStream
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 void seek(long pos)
seek
in interface Seekable
seek
in class BmcFSInputStream
public boolean seekToNewSource(long targetPos)
BmcFSInputStream
seekToNewSource
in interface Seekable
seekToNewSource
in class BmcFSInputStream
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class BmcFSInputStream
public String toString()
toString
in class FSInputStream
Copyright © 2016–2023. All rights reserved.