You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2018/06/29 22:51:14 UTC

hive git commit: HIVE-19989: Metastore uses wrong application name for HADOOP2 metrics (Vineet Garg, reviewed by Alan Gates)

Repository: hive
Updated Branches:
  refs/heads/master 35cec21d2 -> 7eac7f605


HIVE-19989: Metastore uses wrong application name for HADOOP2 metrics (Vineet Garg, reviewed by Alan Gates)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/7eac7f60
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/7eac7f60
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/7eac7f60

Branch: refs/heads/master
Commit: 7eac7f60569d4d1ec01ff86c094690b9af4f38dc
Parents: 35cec21
Author: Vineet Garg <vg...@apache.org>
Authored: Fri Jun 29 15:50:24 2018 -0700
Committer: Vineet Garg <vg...@apache.org>
Committed: Fri Jun 29 15:50:24 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/conf/MetastoreConf.java    | 2 ++
 .../java/org/apache/hadoop/hive/metastore/metrics/Metrics.java  | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/7eac7f60/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
index f3b909c..19da432 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
@@ -602,6 +602,8 @@ public class MetastoreConf {
             "alongside the dropped table data. This ensures that the metadata will be cleaned up along with the dropped table data."),
     METRICS_ENABLED("metastore.metrics.enabled", "hive.metastore.metrics.enabled", false,
         "Enable metrics on the metastore."),
+    METRICS_HADOOP2_COMPONENT_NAME("metastore.metrics.hadoop2.component", "hive.service.metrics.hadoop2.component", "hivemetastore",
+                    "Component name to provide to Hadoop2 Metrics system."),
     METRICS_JSON_FILE_INTERVAL("metastore.metrics.file.frequency",
         "hive.service.metrics.file.frequency", 1, TimeUnit.MINUTES,
         "For json metric reporter, the frequency of updating JSON metrics file."),

http://git-wip-us.apache.org/repos/asf/hive/blob/7eac7f60/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java
index b081026..e4866a6 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java
@@ -220,11 +220,12 @@ public class Metrics {
           reporters.add(reporter);
           scheduledReporters.add(reporter);
         } else if (reporterName.startsWith("hadoop") || reporterName.endsWith("metrics2reporter")) {
+          String applicationName = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.METRICS_HADOOP2_COMPONENT_NAME);
           HadoopMetrics2Reporter reporter = HadoopMetrics2Reporter.forRegistry(registry)
               .convertRatesTo(TimeUnit.SECONDS)
               .convertDurationsTo(TimeUnit.MILLISECONDS)
-              .build(DefaultMetricsSystem.initialize("metastore"), "metastore", "Runtime metadata" +
-                  " catalog", "general-metadata");
+              .build(DefaultMetricsSystem.initialize(applicationName), applicationName, "Runtime metadata" +
+                  " catalog", "General");
           reporter.start(1, TimeUnit.MINUTES);
           reporters.add(reporter);
           scheduledReporters.add(reporter);