[ 
https://issues.apache.org/jira/browse/HIVE-25959?focusedWorklogId=728852&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-728852
 ]

ASF GitHub Bot logged work on HIVE-25959:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Feb/22 11:02
            Start Date: 17/Feb/22 11:02
    Worklog Time Spent: 10m 
      Work Description: vcsomor commented on a change in pull request #3032:
URL: https://github.com/apache/hive/pull/3032#discussion_r808928144



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java
##########
@@ -160,6 +159,47 @@ public Integer getValue() {
     }
   }
 
+  /**
+   * Get a Map that represents a multi-field metric,
+   * or create a new one if it does not already exist.
+   * @param name Name of map metric.  This should come from MetricConstants
+   * @return MapMetric .
+   */
+  public static MapMetrics getOrCreateMapMetrics(String name) {
+    if (self == null) {
+      return dummyMapMetrics;
+    }
+
+    Map<String, Metric> metrics = self.registry.getMetrics();
+    Metric map = metrics.get(name);
+    if (map instanceof MapMetrics) {
+      return (MapMetrics) map;
+    }
+
+    // Looks like it doesn't exist.  Lock so that two threads don't create it 
at once.
+    synchronized (Metrics.class) {
+      // Recheck to make sure someone didn't create it while we waited.

Review comment:
       ```java
       Object val = null;
       if (val instanceof String) {
         LOG.info("Not null safe");
       } else {
         LOG.info("Null safe");
       }
   ```
   output
   ```log
   [INFO ] OMITTED - Null safe
   ```




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 728852)
    Time Spent: 1h 50m  (was: 1h 40m)

> Expose Compaction Observability delta metrics using the JsonReporter
> --------------------------------------------------------------------
>
>                 Key: HIVE-25959
>                 URL: https://issues.apache.org/jira/browse/HIVE-25959
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>    Affects Versions: 4.0.0
>            Reporter: Viktor Csomor
>            Assignee: Viktor Csomor
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> As part of the HIVE-25897 the Delta metrics collection has been moved from 
> HiveServer2 to HMS. Hence the HMS does not have any jmx endpoint exposed by 
> default we'd like to expose these metrics through the JsonReporter



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to