banmoy commented on a change in pull request #8611: [FLINK-12693][state] Store
state per key-group in CopyOnWriteStateTable
URL: https://github.com/apache/flink/pull/8611#discussion_r300210740
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/AbstractStateTableSnapshot.java
##########
@@ -19,34 +19,106 @@
package org.apache.flink.runtime.state.heap;
import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.core.memory.DataOutputView;
import org.apache.flink.runtime.state.StateSnapshot;
+import org.apache.flink.runtime.state.StateSnapshotTransformer;
+import org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot;
import org.apache.flink.util.Preconditions;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.io.IOException;
+
/**
* Abstract base class for snapshots of a {@link StateTable}. Offers a way to
serialize the snapshot (by key-group).
* All snapshots should be released after usage.
*/
@Internal
-abstract class AbstractStateTableSnapshot<K, N, S, T extends StateTable<K, N,
S>> implements StateSnapshot {
+abstract class AbstractStateTableSnapshot<K, N, S, T extends StateTable<K, N,
S>>
Review comment:
I think there is no need to introduce `getStateMapSnapshotArray` for
`NestedStateTable`. For `CopyOnWriteStateTable`, we should create snapshots for
all `StateMap`s in the sync part of the snapshot for backend, hold them
somewhere like in an array, and use them to write state to output in the async
part. But for `NestedStateTable` which only supports synchronous snapshot, we
can create the snapshot of `StateMap` and write state to output one by one, and
there is no need to hold all `StateMap`'s snapshots firstly and then write
state to output, which will introduces a cost to create array object.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services