pltbkd commented on code in PR #20296:
URL: https://github.com/apache/flink/pull/20296#discussion_r932427401


##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java:
##########
@@ -156,6 +179,27 @@ public synchronized ComponentMetricStore 
getSubtaskMetricStore(
         return 
ComponentMetricStore.unmodifiable(task.getSubtaskMetricStore(subtaskIndex));
     }
 
+    public synchronized ComponentMetricStore getSubtaskAttemptMetricStore(
+            String jobID, String taskID, int subtaskIndex, int attemptId) {
+        JobMetricStore job = jobID == null ? null : jobs.get(jobID);
+        if (job == null) {
+            return null;
+        }
+        TaskMetricStore task = job.getTaskMetricStore(taskID);
+        if (task == null) {
+            return null;
+        }
+        SubtaskMetricStore subtask = task.getSubtaskMetricStore(subtaskIndex);
+        if (attemptId < 0) {

Review Comment:
   A negative attempt number is considered valid before when there were 
constructors using -1 as the default value, and was used to acquire the subtask 
level metrics instead of the attempt level one. Now that we have removed those 
constructors, a negative attempt  number is indeed invalid. I'll cleanup the 
relating codes.



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