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 ClassesModifier and TypeClassDescriptionstatic enumThe status of a file cache entry. -
Method Summary
Modifier and TypeMethodDescriptionopen(org.apache.flink.core.fs.FSDataInputStream originalStream) Opens a newCachedDataInputStreamfrom this cache entry.protected voidOnly two scenario that the reference count can reach 0. 1.Methods inherited from class org.apache.flink.runtime.asyncprocessing.ReferenceCounted
getReferenceCount, release, release, retain, tryRetain
-
Method Details
-
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
Only two scenario that the reference count can reach 0. 1. The cache entry is invalid the reference count is released. 2. The cache entry is closed and the reference count is scheduled released.- Specified by:
referenceCountReachedZeroin classorg.apache.flink.runtime.asyncprocessing.ReferenceCounted<Object>
-