gaborgsomogyi commented on code in PR #25267:
URL: https://github.com/apache/flink/pull/25267#discussion_r1757059964


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/metadata/MetadataV5Serializer.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.checkpoint.metadata;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.runtime.checkpoint.FinishedOperatorSubtaskState;
+import org.apache.flink.runtime.checkpoint.FullyFinishedOperatorState;
+import org.apache.flink.runtime.checkpoint.OperatorState;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.runtime.jobgraph.OperatorID;
+import org.apache.flink.runtime.state.memory.ByteStreamStateHandle;
+
+import javax.annotation.Nullable;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import static org.apache.flink.util.Preconditions.checkState;
+
+/** V5 serializer that adds Operator name and uid. */
+@Internal
+public class MetadataV5Serializer extends MetadataV4Serializer {
+
+    public static final MetadataSerializer INSTANCE = new 
MetadataV5Serializer();
+    public static final int VERSION = 5;
+
+    @Override
+    public int getVersion() {
+        return VERSION;
+    }
+
+    @Override
+    protected void serializeOperatorState(OperatorState operatorState, 
DataOutputStream dos)
+            throws IOException {
+        if (operatorState.getOperatorName().isPresent()
+                && operatorState.getOperatorName().get().isEmpty()) {
+            throw new IllegalArgumentException("Empty string operator name is 
not allowed");
+        }
+        if (operatorState.getOperatorUid().isPresent()
+                && operatorState.getOperatorUid().get().isEmpty()) {
+            throw new IllegalArgumentException("Empty string operator uid is 
not allowed");
+        }

Review Comment:
   The existing job will blow-up in startup time since we've added eager checks 
too which I think is fine when we consider 2.0.



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