Myasuka commented on a change in pull request #15420:
URL: https://github.com/apache/flink/pull/15420#discussion_r656869033
##########
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:
I see, from my point of view, we could add this constructor or another
`ChangelogStateHandleStreamImpl#of(List<Tuple3<StreamStateHandle, Long, Long>>
sorted, KeyGroupRange keyGroupRange)` method in #14839 when needed.
--
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]