Class 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.
    • Method Detail

      • open

        public CachedDataInputStream open​(org.apache.flink.core.fs.FSDataInputStream originalStream)
                                   throws IOException
        Opens a new CachedDataInputStream from 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 CachedDataInputStream for 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:
        referenceCountReachedZero in class org.apache.flink.runtime.asyncprocessing.ReferenceCounted<Object>