public class DataCacheSnapshot extends Object
| 构造器和说明 |
|---|
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.FileSystem |
getFileSystem() |
org.apache.flink.api.java.tuple.Tuple2<Integer,Integer> |
getReaderPosition() |
List<Segment> |
getSegments() |
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)
Recovers a data cache instance from the input stream.
|
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)
Replays cached records in the data cache from the input stream into the target feedback
consumer.
|
<T> void |
tryReadSegmentsToMemory(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
org.apache.flink.table.runtime.util.MemorySegmentPool segmentPool)
Attempts to cache the segments in memory.
|
void |
writeTo(OutputStream checkpointOutputStream)
Writes the information about this data cache to an output stream.
|
public org.apache.flink.core.fs.FileSystem getFileSystem()
@Nullable public org.apache.flink.api.java.tuple.Tuple2<Integer,Integer> getReaderPosition()
public void writeTo(OutputStream checkpointOutputStream) throws IOException
IOExceptionpublic 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
Exceptionpublic 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
IOExceptionpublic <T> void tryReadSegmentsToMemory(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
org.apache.flink.table.runtime.util.MemorySegmentPool segmentPool)
throws IOException
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.
IOExceptionCopyright © 2019–2022 The Apache Software Foundation. All rights reserved.