afedulov commented on code in PR #24564: URL: https://github.com/apache/flink/pull/24564#discussion_r1571313741
########## flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java: ########## @@ -184,6 +184,21 @@ public synchronized ComponentMetricStore getJobManagerMetricStore() { return ComponentMetricStore.unmodifiable(jobManager); } + public synchronized ComponentMetricStore getJobManagerOperatorMetricStore( + String jobID, String taskID) { + JobMetricStore job = jobID == null ? null : jobs.get(jobID); + if (job == null || taskID == null) { + return null; + } + + TaskMetricStore task = job.getTaskMetricStore(taskID); + if (task == null) { + return null; + } + + return ComponentMetricStore.unmodifiable(task.getJobManagerOperatorMetricStore()); + } Review Comment: Feels like this could be a bit more readable ```suggestion public synchronized ComponentMetricStore getJobManagerOperatorMetricStore(String jobID, String taskID) { if (jobID == null || taskID == null) { return null; } JobMetricStore job = jobs.get(jobID); if (job == null) { return null; } TaskMetricStore task = job.getTaskMetricStore(taskID); if (task == null) { return null; } return ComponentMetricStore.unmodifiable(task.getJobManagerOperatorMetricStore()); } ``` -- 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