类 DataCacheSnapshot
- java.lang.Object
-
- org.apache.flink.iteration.datacache.nonkeyed.DataCacheSnapshot
-
public class DataCacheSnapshot extends Object
The snapshot of a data cache. It could be written out or read from an external stream.
-
-
构造器概要
构造器 构造器 说明 DataCacheSnapshot(org.apache.flink.core.fs.FileSystem fileSystem, org.apache.flink.api.java.tuple.Tuple2<Integer,Integer> readerPosition, List<Segment> segments)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 org.apache.flink.core.fs.FileSystemgetFileSystem()org.apache.flink.api.java.tuple.Tuple2<Integer,Integer>getReaderPosition()List<Segment>getSegments()static DataCacheSnapshotrecover(InputStream checkpointInputStream, org.apache.flink.core.fs.FileSystem fileSystem, org.apache.flink.util.function.SupplierWithException<org.apache.flink.core.fs.Path,IOException> pathGenerator)Recovers a data cache instance from the input stream.static <T> voidreplay(InputStream checkpointInputStream, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, org.apache.flink.statefun.flink.core.feedback.FeedbackConsumer<T> feedbackConsumer)Replays cached records in the data cache from the input stream into the target feedback consumer.<T> voidtryReadSegmentsToMemory(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, org.apache.flink.table.runtime.util.MemorySegmentPool segmentPool)Attempts to cache the segments in memory.voidwriteTo(OutputStream checkpointOutputStream)Writes the information about this data cache to an output stream.
-
-
-
方法详细资料
-
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 IOExceptionAttempts 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
-
-