Class CachedDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.flink.core.fs.FSDataInputStream
-
- org.apache.flink.state.forst.fs.cache.CachedDataInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.flink.core.fs.ByteBufferReadable
public class CachedDataInputStream extends org.apache.flink.core.fs.FSDataInputStream implements org.apache.flink.core.fs.ByteBufferReadableAFSDataInputStreamdelegates requests to other one and supports reading data withByteBuffer. One CachedDataInputStream only supports one thread reading which is guaranteed by ByteBufferReadableFSDataInputStream. The cached input stream might be closed by eviction by other thread, and the concurrency between reading and evicting is controlled by the reference count of the cache entry.
-
-
Constructor Summary
Constructors Constructor Description CachedDataInputStream(FileBasedCache fileBasedCache, FileCacheEntry cacheEntry, org.apache.flink.core.fs.FSDataInputStream originalStream)CachedDataInputStream(FileBasedCache fileBasedCache, FileCacheEntry cacheEntry, org.apache.flink.core.fs.FSDataInputStream cacheStream, org.apache.flink.core.fs.FSDataInputStream originalStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()longgetPos()booleanisClosed()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)intread(long position, ByteBuffer bb)intread(ByteBuffer bb)voidreset()voidseek(long desired)longskip(long n)-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
CachedDataInputStream
public CachedDataInputStream(FileBasedCache fileBasedCache, FileCacheEntry cacheEntry, org.apache.flink.core.fs.FSDataInputStream cacheStream, org.apache.flink.core.fs.FSDataInputStream originalStream)
-
CachedDataInputStream
public CachedDataInputStream(FileBasedCache fileBasedCache, FileCacheEntry cacheEntry, org.apache.flink.core.fs.FSDataInputStream originalStream)
-
-
Method Detail
-
seek
public void seek(long desired) throws IOException- Specified by:
seekin classorg.apache.flink.core.fs.FSDataInputStream- Throws:
IOException
-
getPos
public long getPos() throws IOException- Specified by:
getPosin classorg.apache.flink.core.fs.FSDataInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
isClosed
public boolean isClosed()
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read(ByteBuffer bb) throws IOException
- Specified by:
readin interfaceorg.apache.flink.core.fs.ByteBufferReadable- Throws:
IOException
-
read
public int read(long position, ByteBuffer bb) throws IOException- Specified by:
readin interfaceorg.apache.flink.core.fs.ByteBufferReadable- Throws:
IOException
-
-