diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 2723dad..93141aa 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -790,6 +790,12 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal METASTORE_AGGREGATE_STATS_CACHE_CLEAN_UNTIL("hive.metastore.aggregate.stats.cache.clean.until", (float) 0.8, "The cleaner thread cleans until cache reaches this % full size."), METASTORE_METRICS("hive.metastore.metrics.enabled", false, "Enable metrics on the metastore."), + METASTORE_METRICS_JSON_FILE_LOCATION("hive.metastore.metrics.file.location", + "/tmp/metastore.json", + "For HiveMetaStore metric class " + + "org.apache.hadoop.hive.common.metrics.metrics2.CodahaleMetrics JSON_FILE reporter, " + + "the location of local JSON metrics file.\n" + + "This file will get overwritten at every interval."), METASTORE_INIT_METADATA_COUNT_ENABLED("hive.metastore.initial.metadata.count.enabled", true, "Enable a metadata count at metastore startup for metrics."), @@ -2057,6 +2063,12 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal // Enable metric collection for HiveServer2 HIVE_SERVER2_METRICS_ENABLED("hive.server2.metrics.enabled", false, "Enable metrics on the HiveServer2."), + HIVE_SERVER2_METRICS_JSON_FILE_LOCATION("hive.server2.metrics.file.location", + "/tmp/hiveserver2.json", + "For HiveServer2 metric class " + + "org.apache.hadoop.hive.common.metrics.metrics2.CodahaleMetrics JSON_FILE reporter, " + + "the location of local JSON metrics file.\n" + + "This file will get overwritten at every interval."), // http (over thrift) transport settings HIVE_SERVER2_THRIFT_HTTP_PORT("hive.server2.thrift.http.port", 10001, diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index bfebfdc..9925476 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -6129,6 +6129,8 @@ public void run() { //Start Metrics for Standalone (Remote) Mode if (conf.getBoolVar(ConfVars.METASTORE_METRICS)) { try { + conf.setVar(ConfVars.HIVE_METRICS_JSON_FILE_LOCATION, + conf.getVar(ConfVars.METASTORE_METRICS_JSON_FILE_LOCATION)); MetricsFactory.init(conf); } catch (Exception e) { // log exception, but ignore inability to start diff --git service/src/java/org/apache/hive/service/server/HiveServer2.java service/src/java/org/apache/hive/service/server/HiveServer2.java index 892a476..a23bb94 100644 --- service/src/java/org/apache/hive/service/server/HiveServer2.java +++ service/src/java/org/apache/hive/service/server/HiveServer2.java @@ -104,6 +104,8 @@ public synchronized void init(HiveConf hiveConf) { //Initialize metrics first, as some metrics are for initialization stuff. try { if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_METRICS_ENABLED)) { + hiveConf.setVar(ConfVars.HIVE_METRICS_JSON_FILE_LOCATION, + hiveConf.getVar(ConfVars.HIVE_SERVER2_METRICS_JSON_FILE_LOCATION)); MetricsFactory.init(hiveConf); } } catch (Throwable t) {