类 DataCacheSnapshot


  • public class DataCacheSnapshot
    extends Object
    The snapshot of a data cache. It could be written out or read from an external stream.
    • 构造器详细资料

      • DataCacheSnapshot

        public DataCacheSnapshot​(org.apache.flink.core.fs.FileSystem fileSystem,
                                 @Nullable
                                 org.apache.flink.api.java.tuple.Tuple2<Integer,​Integer> readerPosition,
                                 List<Segment> segments)
    • 方法详细资料

      • getFileSystem

        public org.apache.flink.core.fs.FileSystem getFileSystem()
      • getReaderPosition

        @Nullable
        public org.apache.flink.api.java.tuple.Tuple2<Integer,​Integer> getReaderPosition()
      • writeTo

        public void writeTo​(OutputStream checkpointOutputStream)
                     throws IOException
        Writes the information about this data cache to an output stream.
        抛出:
        IOException
      • replay

        public static <T> void replay​(InputStream checkpointInputStream,
                                      org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
                                      org.apache.flink.statefun.flink.core.feedback.FeedbackConsumer<T> feedbackConsumer)
                               throws Exception
        Replays cached records in the data cache from the input stream into the target feedback consumer.
        抛出:
        Exception
      • recover

        public static DataCacheSnapshot recover​(InputStream checkpointInputStream,
                                                org.apache.flink.core.fs.FileSystem fileSystem,
                                                org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.Path,​IOException> pathGenerator)
                                         throws IOException
        Recovers a data cache instance from the input stream.
        抛出:
        IOException
      • tryReadSegmentsToMemory

        public <T> void tryReadSegmentsToMemory​(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
                                                org.apache.flink.table.runtime.util.MemorySegmentPool segmentPool)
                                         throws IOException
        Attempts to cache the segments in memory.

        The attempt is made at segment granularity, which means there might be only part of the segments are cached.

        This method does not throw exceptions if there is not enough memory space for caching a segment.

        抛出:
        IOException