diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 233323b..185935c 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -6059,11 +6059,8 @@ public void run() { // Wrap the start of the threads in a catch Throwable loop so that any failures // 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); - } + ShimLoader.getHadoopShims().startPauseMonitor(conf); + try { // Per the javadocs on Condition, do not depend on the condition alone as a start gate // since spurious wake ups are possible. @@ -6083,18 +6080,6 @@ public void run() { 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 = 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 d5f2603..2520d2a 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 @@ -156,6 +156,11 @@ public TaskAttemptID newTaskAttemptID(JobID jobId, boolean isMap, int taskId, in } @Override + public void startPauseMonitor(Configuration conf) { + /* no supported */ + } + + @Override public boolean isLocalMode(Configuration conf) { return "local".equals(getJobLauncherRpcAddress(conf)); } 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 bb4a190..02c9c2a 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 @@ -210,6 +210,19 @@ public TaskAttemptID newTaskAttemptID(JobID jobId, boolean isMap, int taskId, in } @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")); } 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 93379cf..9d076da 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 @@ -144,6 +144,8 @@ MiniDFSShim getMiniDfs(Configuration conf, public JobContext newJobContext(Job job); + public void startPauseMonitor(Configuration conf); + /** * Check wether MR is configured to run in local-mode * @param conf