rkhachatryan commented on a change in pull request #15420:
URL: https://github.com/apache/flink/pull/15420#discussion_r647766567
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/changelog/StateChangelogHandleStreamImpl.java
##########
@@ -29,28 +30,45 @@
import org.apache.flink.util.CloseableIterator;
import org.apache.flink.util.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
+import java.util.stream.Collectors;
/** {@link StateChangelogHandle} implementation based on {@link
StreamStateHandle}. */
@Internal
public final class StateChangelogHandleStreamImpl
implements
StateChangelogHandle<StateChangelogHandleStreamImpl.StateChangeStreamReader> {
private static final long serialVersionUID = -8070326169926626355L;
+ private static final Logger LOG =
LoggerFactory.getLogger(StateChangelogHandleStreamImpl.class);
private final KeyGroupRange keyGroupRange;
/** NOTE: order is important as it reflects the order of changes. */
private final List<Tuple2<StreamStateHandle, Long>> handlesAndOffsets;
private transient SharedStateRegistry stateRegistry;
+ private final long size;
public StateChangelogHandleStreamImpl(
- List<Tuple2<StreamStateHandle, Long>> handlesAndOffsets,
KeyGroupRange keyGroupRange) {
+ List<Tuple2<StreamStateHandle, Long>> handlesAndOffsets,
+ KeyGroupRange keyGroupRange,
+ long size) {
this.handlesAndOffsets = handlesAndOffsets;
this.keyGroupRange = keyGroupRange;
+ this.size = size;
+ }
+
+ public StateChangelogHandleStreamImpl(
Review comment:
Yes, it is used in the actual implementations (e.g. #14839).
OTH, this handle can not be moved out of `flink-runtime` easily because it
needs to be (de)serialized on JM.
That's why I introduced it (and its constructors) independently in this PR
(rather than with changelog implementation).
WDYT?
--
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]