public class DataCacheSnapshot extends Object
Constructor and Description |
---|
DataCacheSnapshot(org.apache.flink.core.fs.FileSystem fileSystem,
org.apache.flink.api.java.tuple.Tuple2<Integer,Integer> readerPosition,
List<Segment> segments) |
Modifier and Type | Method and Description |
---|---|
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
IOException
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
Exception
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
IOException
public <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.
IOException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.