Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4840#discussion_r146825259
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java
 ---
    @@ -181,74 +265,23 @@ private void addMetric(Map<String, String> target, 
String name, MetricDump metri
        }
     
        // 
-----------------------------------------------------------------------------------------------------------------
    -   // Accessors for sub MetricStores
    +   // sub MetricStore classes
        // 
-----------------------------------------------------------------------------------------------------------------
     
        /**
    -    * Returns the {@link JobManagerMetricStore}.
    -    *
    -    * @return JobManagerMetricStore
    -    */
    -   public JobManagerMetricStore getJobManagerMetricStore() {
    -           return jobManager;
    -   }
    -
    -   /**
    -    * Returns the {@link TaskManagerMetricStore} for the given taskmanager 
ID.
    -    *
    -    * @param tmID taskmanager ID
    -    * @return TaskManagerMetricStore for the given ID, or null if no store 
for the given argument exists
    +    * Structure containing metrics of a single component.
         */
    -   public TaskManagerMetricStore getTaskManagerMetricStore(String tmID) {
    -           return taskManagers.get(tmID);
    -   }
    +   @ThreadSafe
    +   public static class ComponentMetricStore {
    +           public final Map<String, String> metrics;
     
    -   /**
    -    * Returns the {@link JobMetricStore} for the given job ID.
    -    *
    -    * @param jobID job ID
    -    * @return JobMetricStore for the given ID, or null if no store for the 
given argument exists
    -    */
    -   public JobMetricStore getJobMetricStore(String jobID) {
    -           return jobs.get(jobID);
    -   }
    -
    -   /**
    -    * Returns the {@link TaskMetricStore} for the given job/task ID.
    -    *
    -    * @param jobID  job ID
    -    * @param taskID task ID
    -    * @return TaskMetricStore for given IDs, or null if no store for the 
given arguments exists
    -    */
    -   public TaskMetricStore getTaskMetricStore(String jobID, String taskID) {
    -           JobMetricStore job = getJobMetricStore(jobID);
    -           if (job == null) {
    -                   return null;
    +           public ComponentMetricStore() {
    --- End diff --
    
    all constructors can be private


---

Reply via email to