FAQ
Author: vgumashta
Date: Mon Apr 6 09:45:07 2015
New Revision: 1671502

URL: http://svn.apache.org/r1671502
Log:
HIVE-9870: Add JvmPauseMonitor threads to HMS and HS2 daemons (Harsh J reviewed by Vaibhav Gumashta)

Modified:
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
     hive/trunk/service/src/java/org/apache/hive/service/server/HiveServer2.java

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1671502&r1=1671501&r2=1671502&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Mon Apr 6 09:45:07 2015
@@ -6060,6 +6060,11 @@ public class HiveMetaStore extends Thrif
          // don't doom the rest of the metastore.
          startLock.lock();
          try {
+ startPauseMonitor(conf);
+ } catch (Throwable t) {
+ LOG.warn("Error starting the JVM pause monitor", t);
+ }
+ try {
            // Per the javadocs on Condition, do not depend on the condition alone as a start gate
            // since spurious wake ups are possible.
            while (!startedServing.get()) startCondition.await();
@@ -6078,6 +6083,18 @@ public class HiveMetaStore extends Thrif
      t.start();
    }

+ private static void startPauseMonitor(HiveConf conf) throws Exception {
+ 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);
+ }
+ }
+
    private static void startCompactorInitiator(HiveConf conf) throws Exception {
      if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_COMPACTOR_INITIATOR_ON)) {
        MetaStoreThread initiator =

Modified: hive/trunk/service/src/java/org/apache/hive/service/server/HiveServer2.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/server/HiveServer2.java?rev=1671502&r1=1671501&r2=1671502&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/server/HiveServer2.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/server/HiveServer2.java Mon Apr 6 09:45:07 2015
@@ -297,6 +297,18 @@ public class HiveServer2 extends Composi
      }
    }

+ private static void startPauseMonitor(HiveConf conf) throws Exception {
+ 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);
+ }
+ }
+
    private static void startHiveServer2() throws Throwable {
      long attempts = 0, maxAttempts = 1;
      while (true) {
@@ -308,6 +320,7 @@ public class HiveServer2 extends Composi
          server = new HiveServer2();
          server.init(hiveConf);
          server.start();
+ startPauseMonitor(hiveConf);
          // 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)) {

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedApr 6, '15 at 9:45a
activeApr 6, '15 at 9:45a
posts1
users1
websitehive.apache.org

1 user in discussion

Vgumashta: 1 post

People

Translate

site design / logo © 2021 Grokbase