Class FileCacheEntry
- java.lang.Object
-
- org.apache.flink.runtime.asyncprocessing.ReferenceCounted<Object>
-
- org.apache.flink.state.forst.fs.cache.FileCacheEntry
-
public final class FileCacheEntry extends org.apache.flink.runtime.asyncprocessing.ReferenceCounted<Object>
A file cache entry that encapsulates file and the size of the file, and provides methods to read or write file. Not thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileCacheEntry.EntryStatusThe status of a file cache entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedDataInputStreamopen(org.apache.flink.core.fs.FSDataInputStream originalStream)Opens a newCachedDataInputStreamfrom this cache entry.protected voidreferenceCountReachedZero(Object o)Only two scenario that the reference count can reach 0. 1.
-
-
-
Method Detail
-
open
public CachedDataInputStream open(org.apache.flink.core.fs.FSDataInputStream originalStream) throws IOException
Opens a newCachedDataInputStreamfrom this cache entry. If the cache stream is available, it will be used; otherwise, the original stream will be used. But the cache stream will be used once available. The opened stream is added to the queue of opened streams associated with this cache entry.- Parameters:
originalStream- the original input stream to be used if the cache stream is not available- Returns:
- a new
CachedDataInputStreamfor reading data - Throws:
IOException- if an I/O error occurs while opening the stream
-
referenceCountReachedZero
protected void referenceCountReachedZero(@Nullable Object o)Only two scenario that the reference count can reach 0. 1. The cache entry is invalid the reference count is released. {@see invalidate()} 2. The cache entry is closed and the reference count is scheduled released. {@see close()}- Specified by:
referenceCountReachedZeroin classorg.apache.flink.runtime.asyncprocessing.ReferenceCounted<Object>
-
-