You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/18 05:54:43 UTC

[GitHub] [flink] zhuzhurk commented on a diff in pull request #19747: [FLINK-17295][runtime] Refactor the ExecutionAttemptID to consist of ExecutionGraphID, ExecutionVertexID and attemptNumber

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


##########
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:
   > logging the EG ID is fine, but this can't be done in isolation. There must be a way to correlate this id with a specific job submission; for example we could log the EG ID when the EG for a given job was created.
   
   Totally agree. Will add a log when creating the EG.



-- 
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-unsubscribe@flink.apache.org

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