hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [37/50] [abbrv] hive git commit: HIVE-10761 : Create codahale-based metrics system for Hive (Szehon, reviewed by Xuefu)
Date Fri, 05 Jun 2015 23:16:50 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/a96fbdee/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e60bb35..9b40909 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,6 +116,7 @@
     <commons-pool.version>1.5.4</commons-pool.version>
     <commons-dbcp.version>1.4</commons-dbcp.version>
     <derby.version>10.11.1.1</derby.version>
+    <dropwizard.version>3.1.0</dropwizard.version>
     <guava.version>14.0.1</guava.version>
     <groovy.version>2.1.6</groovy.version>
     <hadoop-20S.version>1.2.1</hadoop-20S.version>
@@ -128,6 +129,8 @@
     <httpcomponents.core.version>4.4</httpcomponents.core.version>
     <ivy.version>2.4.0</ivy.version>
     <jackson.version>1.9.2</jackson.version>
+    <!-- jackson 1 and 2 lines can coexist without issue, as they have different artifactIds
-->
+    <jackson.new.version>2.4.2</jackson.new.version>
     <javaewah.version>0.3.2</javaewah.version>
     <javolution.version>5.5.1</javolution.version>
     <jdo-api.version>3.0.1</jdo-api.version>

http://git-wip-us.apache.org/repos/asf/hive/blob/a96fbdee/service/src/java/org/apache/hive/service/server/HiveServer2.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/server/HiveServer2.java b/service/src/java/org/apache/hive/service/server/HiveServer2.java
index 58e8e49..7820ed5 100644
--- a/service/src/java/org/apache/hive/service/server/HiveServer2.java
+++ b/service/src/java/org/apache/hive/service/server/HiveServer2.java
@@ -42,14 +42,15 @@ import org.apache.curator.framework.api.CuratorEvent;
 import org.apache.curator.framework.api.CuratorEventType;
 import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
 import org.apache.curator.retry.ExponentialBackoffRetry;
+import org.apache.hadoop.hive.common.JvmPauseMonitor;
 import org.apache.hadoop.hive.common.LogUtils;
 import org.apache.hadoop.hive.common.LogUtils.LogInitializationException;
+import org.apache.hadoop.hive.common.metrics.common.MetricsFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionManagerImpl;
 import org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager;
 import org.apache.hadoop.hive.ql.util.ZooKeeperHiveHelper;
-import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hadoop.hive.shims.Utils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hive.common.util.HiveStringUtils;
@@ -305,6 +306,15 @@ public class HiveServer2 extends CompositeService {
     LOG.info("Shutting down HiveServer2");
     HiveConf hiveConf = this.getHiveConf();
     super.stop();
+    // Shutdown Metrics
+    if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_METRICS_ENABLED)) {
+      try {
+        MetricsFactory.getMetricsInstance().deInit();
+      } catch (Exception e) {
+        LOG.error("error in Metrics deinit: " + e.getClass().getName() + " "
+          + e.getMessage(), e);
+      }
+    }
     // Remove this server instance from ZooKeeper if dynamic service discovery is set
     if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY)) {
       try {
@@ -344,7 +354,18 @@ public class HiveServer2 extends CompositeService {
         server = new HiveServer2();
         server.init(hiveConf);
         server.start();
-        ShimLoader.getHadoopShims().startPauseMonitor(hiveConf);
+
+        if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_METRICS_ENABLED)) {
+          MetricsFactory.getMetricsInstance().init(hiveConf);
+        }
+        try {
+          JvmPauseMonitor pauseMonitor = new JvmPauseMonitor(hiveConf);
+          pauseMonitor.start();
+        } catch (Throwable t) {
+          LOG.warn("Could not initiate the JvmPauseMonitor thread." + " GCs and Pauses may
not be " +
+            "warned upon.", t);
+        }
+
         // If we're supporting dynamic service discovery, we'll add the service uri for this
         // HiveServer2 instance to Zookeeper as a znode.
         if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY))
{

http://git-wip-us.apache.org/repos/asf/hive/blob/a96fbdee/shims/0.20S/src/main/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
----------------------------------------------------------------------
diff --git a/shims/0.20S/src/main/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java b/shims/0.20S/src/main/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
index 6d8166c..ffffcb7 100644
--- a/shims/0.20S/src/main/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
+++ b/shims/0.20S/src/main/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
@@ -159,11 +159,6 @@ public class Hadoop20SShims extends HadoopShimsSecure {
   }
 
   @Override
-  public void startPauseMonitor(Configuration conf) {
-    /* no supported */
-  }
-
-  @Override
   public boolean isLocalMode(Configuration conf) {
     return "local".equals(getJobLauncherRpcAddress(conf));
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/a96fbdee/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
----------------------------------------------------------------------
diff --git a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
index 19324b8..5ddab98 100644
--- a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
+++ b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
@@ -212,19 +212,6 @@ public class Hadoop23Shims extends HadoopShimsSecure {
   }
 
   @Override
-  public void startPauseMonitor(Configuration conf) {
-    try {
-      Class.forName("org.apache.hadoop.util.JvmPauseMonitor");
-      org.apache.hadoop.util.JvmPauseMonitor pauseMonitor = new org.apache.hadoop.util
-          .JvmPauseMonitor(conf);
-      pauseMonitor.start();
-    } catch (Throwable t) {
-      LOG.warn("Could not initiate the JvmPauseMonitor thread." + " GCs and Pauses may not
be " +
-          "warned upon.", t);
-    }
-  }
-
-  @Override
   public boolean isLocalMode(Configuration conf) {
     return "local".equals(conf.get("mapreduce.framework.name"));
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/a96fbdee/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java
----------------------------------------------------------------------
diff --git a/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java b/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java
index 5a6bc44..5b7e7f6 100644
--- a/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java
+++ b/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java
@@ -146,8 +146,6 @@ public interface HadoopShims {
 
   public JobContext newJobContext(Job job);
 
-  public void startPauseMonitor(Configuration conf);
-
   /**
    * Check wether MR is configured to run in local-mode
    * @param conf


Mime
View raw message