KarmaGYZ commented on code in PR #19747:
URL: https://github.com/apache/flink/pull/19747#discussion_r875506253


##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionAttemptID.java:
##########
@@ -19,47 +19,96 @@
 package org.apache.flink.runtime.executiongraph;
 
 import org.apache.flink.annotation.VisibleForTesting;
-import org.apache.flink.util.AbstractID;
+import org.apache.flink.runtime.jobgraph.JobVertexID;
+import org.apache.flink.runtime.scheduler.strategy.ExecutionVertexID;
 
 import org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf;
 
+import java.util.Objects;
+
+import static org.apache.flink.util.Preconditions.checkArgument;
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
 /**
  * Unique identifier for the attempt to execute a tasks. Multiple attempts 
happen in cases of
  * failures and recovery.
  */
 public class ExecutionAttemptID implements java.io.Serializable {
 
     private static final long serialVersionUID = -1169683445778281344L;

Review Comment:
   According to the code style guide[1], we should change it to "1L".
   
   [1] https://flink.apache.org/contributing/code-style-and-quality-java.html 



##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionAttemptID.java:
##########
@@ -68,19 +117,32 @@ public boolean equals(Object obj) {
             return true;
         } else if (obj != null && obj.getClass() == getClass()) {
             ExecutionAttemptID that = (ExecutionAttemptID) obj;
-            return that.executionAttemptId.equals(this.executionAttemptId);
+            return that.executionGraphId.equals(this.executionGraphId)
+                    && that.executionVertexId.equals(this.executionVertexId)
+                    && that.attemptNumber == this.attemptNumber;
         } else {
             return false;
         }
     }
 
     @Override
     public int hashCode() {
-        return executionAttemptId.hashCode();
+        return Objects.hash(executionGraphId, executionVertexId, 
attemptNumber);
     }
 
     @Override
     public String toString() {
-        return executionAttemptId.toString();
+        return String.format(
+                "%s_%s_%d", executionGraphId.toString(), executionVertexId, 
attemptNumber);
+    }
+
+    public String getLogString() {
+        if (DefaultExecutionGraph.LOG.isDebugEnabled()) {
+            return toString();
+        } else {
+            return String.format(
+                    "%s_%s_%d",
+                    executionGraphId.toString().substring(0, 4), 
executionVertexId, attemptNumber);

Review Comment:
   Can we put the work of introducing EG ID into a separate commit?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraphID.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.executiongraph;
+
+import org.apache.flink.util.AbstractID;
+
+import org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf;
+
+/** A class for statistically unique execution graph IDs. */
+public class ExecutionGraphID extends AbstractID {
+
+    private static final long serialVersionUID = -1084434764056797648L;

Review Comment:
   Ditto. Should be 1L.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/ExecutionVertexID.java:
##########
@@ -29,6 +29,13 @@
 
 /** Id identifying {@link ExecutionVertex}. */
 public class ExecutionVertexID implements VertexID {
+

Review Comment:
   `serialVersionUID` is missing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to