You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/08/30 19:27:39 UTC
[1/3] hive git commit: HIVE-13610 : Hive exec module won't compile
with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Repository: hive
Updated Branches:
refs/heads/branch-2.0 1ccefa329 -> 6f60710a1
refs/heads/branch-2.1 f8f896f06 -> 4ec43e7ce
refs/heads/master ebad27d51 -> c2da750a1
HIVE-13610 : Hive exec module won't compile with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/c2da750a
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c2da750a
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c2da750a
Branch: refs/heads/master
Commit: c2da750a14c18fdf23d6967c64fcfa3b04bfd992
Parents: ebad27d
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue Aug 30 12:21:04 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Aug 30 12:21:04 2016 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hive/ql/debug/Utils.java | 56 +++++++++++++++-----
1 file changed, 43 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/c2da750a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
index 439b46a..5d98b82 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
@@ -19,21 +19,46 @@
package org.apache.hadoop.hive.ql.debug;
import java.io.File;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
import javax.management.MBeanServer;
import org.apache.commons.lang.StringUtils;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Debug utility methods for Hive.
*/
public class Utils {
+ private static final Logger LOG = LoggerFactory.getLogger(Utils.class.getName());
private static final String HOTSPOT_BEAN_NAME = "com.sun.management:type=HotSpotDiagnostic";
- private static volatile HotSpotDiagnosticMXBean hotspotMBean;
+ private static volatile Object hotspotMBean;
+ private static final Method DUMP_HEAP_METHOD;
+ private static final Class HOTSPOT_MXBEAN_CLASS;
+
+ static {
+ Class clazz;
+ Method method;
+ try{
+ clazz = Class.forName("com.sun.management.HotSpotDiagnosticMXBean");
+ method = clazz.getMethod("dumpHeap", String.class, Boolean.class);
+ } catch (ClassNotFoundException ce) {
+ LOG.error("com.sun.management.HotSpotDiagnosticMXBean is not supported.", ce);
+ throw new RuntimeException(ce);
+ } catch (NoSuchMethodException ne) {
+ LOG.error("Failed to inject operation dumpHeap.", ne);
+ throw new RuntimeException(ne);
+ } catch (Exception e){
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
+ }
+ HOTSPOT_MXBEAN_CLASS = clazz;
+ DUMP_HEAP_METHOD = method;
+ }
/**
* Dumps process heap to a file in temp directoty.
@@ -62,23 +87,28 @@ public class Utils {
try {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
hotspotMBean = ManagementFactory.newPlatformMXBeanProxy(server,
- HOTSPOT_BEAN_NAME, HotSpotDiagnosticMXBean.class);
- } catch (RuntimeException re) {
- throw re;
- } catch (Exception exp) {
- throw new RuntimeException(exp);
+ HOTSPOT_BEAN_NAME, HOTSPOT_MXBEAN_CLASS);
+ } catch (IOException e) {
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
}
}
- try {
- hotspotMBean.dumpHeap(fileName, live);
- } catch (RuntimeException re) {
+ if(DUMP_HEAP_METHOD != null) {
+ try {
+ DUMP_HEAP_METHOD.invoke(hotspotMBean, new Object[]{fileName, Boolean.valueOf(live)});
+ } catch (RuntimeException re) {
+ LOG.error(re.getMessage());
throw re;
- } catch (Exception exp) {
+ } catch (Exception exp) {
+ LOG.error(exp.getMessage());
throw new RuntimeException(exp);
+ }
+ } else {
+ LOG.error("Cannot find method dumpHeap() in com.sun.management.HotSpotDiagnosticMXBean.");
}
}
- /**
+ /**
* Outputs some bytes as hex w/printable characters prints.
* Helpful debug method; c/p from HBase Bytes.
* @param b Bytes.
[2/3] hive git commit: HIVE-13610 : Hive exec module won't compile
with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Posted by se...@apache.org.
HIVE-13610 : Hive exec module won't compile with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4ec43e7c
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4ec43e7c
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4ec43e7c
Branch: refs/heads/branch-2.1
Commit: 4ec43e7ce6b1be17ebc4c49be8e56cd7b8059ffa
Parents: f8f896f
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue Aug 30 12:21:04 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Aug 30 12:21:15 2016 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hive/ql/debug/Utils.java | 56 +++++++++++++++-----
1 file changed, 43 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/4ec43e7c/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
index 439b46a..5d98b82 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
@@ -19,21 +19,46 @@
package org.apache.hadoop.hive.ql.debug;
import java.io.File;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
import javax.management.MBeanServer;
import org.apache.commons.lang.StringUtils;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Debug utility methods for Hive.
*/
public class Utils {
+ private static final Logger LOG = LoggerFactory.getLogger(Utils.class.getName());
private static final String HOTSPOT_BEAN_NAME = "com.sun.management:type=HotSpotDiagnostic";
- private static volatile HotSpotDiagnosticMXBean hotspotMBean;
+ private static volatile Object hotspotMBean;
+ private static final Method DUMP_HEAP_METHOD;
+ private static final Class HOTSPOT_MXBEAN_CLASS;
+
+ static {
+ Class clazz;
+ Method method;
+ try{
+ clazz = Class.forName("com.sun.management.HotSpotDiagnosticMXBean");
+ method = clazz.getMethod("dumpHeap", String.class, Boolean.class);
+ } catch (ClassNotFoundException ce) {
+ LOG.error("com.sun.management.HotSpotDiagnosticMXBean is not supported.", ce);
+ throw new RuntimeException(ce);
+ } catch (NoSuchMethodException ne) {
+ LOG.error("Failed to inject operation dumpHeap.", ne);
+ throw new RuntimeException(ne);
+ } catch (Exception e){
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
+ }
+ HOTSPOT_MXBEAN_CLASS = clazz;
+ DUMP_HEAP_METHOD = method;
+ }
/**
* Dumps process heap to a file in temp directoty.
@@ -62,23 +87,28 @@ public class Utils {
try {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
hotspotMBean = ManagementFactory.newPlatformMXBeanProxy(server,
- HOTSPOT_BEAN_NAME, HotSpotDiagnosticMXBean.class);
- } catch (RuntimeException re) {
- throw re;
- } catch (Exception exp) {
- throw new RuntimeException(exp);
+ HOTSPOT_BEAN_NAME, HOTSPOT_MXBEAN_CLASS);
+ } catch (IOException e) {
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
}
}
- try {
- hotspotMBean.dumpHeap(fileName, live);
- } catch (RuntimeException re) {
+ if(DUMP_HEAP_METHOD != null) {
+ try {
+ DUMP_HEAP_METHOD.invoke(hotspotMBean, new Object[]{fileName, Boolean.valueOf(live)});
+ } catch (RuntimeException re) {
+ LOG.error(re.getMessage());
throw re;
- } catch (Exception exp) {
+ } catch (Exception exp) {
+ LOG.error(exp.getMessage());
throw new RuntimeException(exp);
+ }
+ } else {
+ LOG.error("Cannot find method dumpHeap() in com.sun.management.HotSpotDiagnosticMXBean.");
}
}
- /**
+ /**
* Outputs some bytes as hex w/printable characters prints.
* Helpful debug method; c/p from HBase Bytes.
* @param b Bytes.
[3/3] hive git commit: HIVE-13610 : Hive exec module won't compile
with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Posted by se...@apache.org.
HIVE-13610 : Hive exec module won't compile with IBM JDK (Pan Yuxuan, reviewed by Sergey Shelukhin)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/6f60710a
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6f60710a
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6f60710a
Branch: refs/heads/branch-2.0
Commit: 6f60710a1aadfd2cc927ecafeea9a6a798218ded
Parents: 1ccefa3
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue Aug 30 12:21:04 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Aug 30 12:21:24 2016 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hive/ql/debug/Utils.java | 56 +++++++++++++++-----
1 file changed, 43 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/6f60710a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
index 439b46a..5d98b82 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java
@@ -19,21 +19,46 @@
package org.apache.hadoop.hive.ql.debug;
import java.io.File;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
import javax.management.MBeanServer;
import org.apache.commons.lang.StringUtils;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Debug utility methods for Hive.
*/
public class Utils {
+ private static final Logger LOG = LoggerFactory.getLogger(Utils.class.getName());
private static final String HOTSPOT_BEAN_NAME = "com.sun.management:type=HotSpotDiagnostic";
- private static volatile HotSpotDiagnosticMXBean hotspotMBean;
+ private static volatile Object hotspotMBean;
+ private static final Method DUMP_HEAP_METHOD;
+ private static final Class HOTSPOT_MXBEAN_CLASS;
+
+ static {
+ Class clazz;
+ Method method;
+ try{
+ clazz = Class.forName("com.sun.management.HotSpotDiagnosticMXBean");
+ method = clazz.getMethod("dumpHeap", String.class, Boolean.class);
+ } catch (ClassNotFoundException ce) {
+ LOG.error("com.sun.management.HotSpotDiagnosticMXBean is not supported.", ce);
+ throw new RuntimeException(ce);
+ } catch (NoSuchMethodException ne) {
+ LOG.error("Failed to inject operation dumpHeap.", ne);
+ throw new RuntimeException(ne);
+ } catch (Exception e){
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
+ }
+ HOTSPOT_MXBEAN_CLASS = clazz;
+ DUMP_HEAP_METHOD = method;
+ }
/**
* Dumps process heap to a file in temp directoty.
@@ -62,23 +87,28 @@ public class Utils {
try {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
hotspotMBean = ManagementFactory.newPlatformMXBeanProxy(server,
- HOTSPOT_BEAN_NAME, HotSpotDiagnosticMXBean.class);
- } catch (RuntimeException re) {
- throw re;
- } catch (Exception exp) {
- throw new RuntimeException(exp);
+ HOTSPOT_BEAN_NAME, HOTSPOT_MXBEAN_CLASS);
+ } catch (IOException e) {
+ LOG.error(e.getMessage());
+ throw new RuntimeException(e);
}
}
- try {
- hotspotMBean.dumpHeap(fileName, live);
- } catch (RuntimeException re) {
+ if(DUMP_HEAP_METHOD != null) {
+ try {
+ DUMP_HEAP_METHOD.invoke(hotspotMBean, new Object[]{fileName, Boolean.valueOf(live)});
+ } catch (RuntimeException re) {
+ LOG.error(re.getMessage());
throw re;
- } catch (Exception exp) {
+ } catch (Exception exp) {
+ LOG.error(exp.getMessage());
throw new RuntimeException(exp);
+ }
+ } else {
+ LOG.error("Cannot find method dumpHeap() in com.sun.management.HotSpotDiagnosticMXBean.");
}
}
- /**
+ /**
* Outputs some bytes as hex w/printable characters prints.
* Helpful debug method; c/p from HBase Bytes.
* @param b Bytes.