fredia commented on code in PR #21405:
URL: https://github.com/apache/flink/pull/21405#discussion_r1044999240


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/changelog/StateChange.java:
##########
@@ -26,14 +26,21 @@
 @Internal
 public class StateChange implements Serializable {
 
+    /* For metadata, see FLINK-23035.*/
+    public static final int META_KEY_GROUP = -1;
+
     private static final long serialVersionUID = 1L;
 
     private final int keyGroup;
     private final byte[] change;
 
+    public StateChange(byte[] change) {
+        this.keyGroup = META_KEY_GROUP;
+        this.change = Preconditions.checkNotNull(change);
+    }
+
     public StateChange(int keyGroup, byte[] change) {
-        // todo: enable check in FLINK-23035
-        // Preconditions.checkArgument(keyGroup >= 0);
+        Preconditions.checkArgument(keyGroup >= 0);

Review Comment:
   Nice suggestion, this can reduce the probability of error, fixed.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to