Author: rohini
Date: Fri May 22 17:28:59 2015
New Revision: 1681164
URL: http://svn.apache.org/r1681164
Log:
PIG-4418: NullPointerException in JVMReuseImpl (rohini)
Modified:
pig/branches/branch-0.15/CHANGES.txt
pig/branches/branch-0.15/src/org/apache/pig/JVMReuseImpl.java
Modified: pig/branches/branch-0.15/CHANGES.txt
URL:
http://svn.apache.org/viewvc/pig/branches/branch-0.15/CHANGES.txt?rev=1681164&r1=1681163&r2=1681164&view=diff
==============================================================================
--- pig/branches/branch-0.15/CHANGES.txt (original)
+++ pig/branches/branch-0.15/CHANGES.txt Fri May 22 17:28:59 2015
@@ -66,6 +66,8 @@ PIG-4333: Split BigData tests into multi
BUG FIXES
+PIG-4418: NullPointerException in JVMReuseImpl (rohini)
+
PIG-4562: Typo in DataType.toDateTime (daijy)
PIG-4559: Fix several new tez e2e test failures (daijy)
@@ -94,8 +96,7 @@ PIG-4377: Skewed outer join produce wron
PIG-4538: Pig script fail with CNF in follow up MR job (daijy)
-PIG-4537: Fix unit test failure introduced by TEZ-2392: TestCollectedGroup,
TestLimitVariable,
- TestMapSideCogroup, etc (daijy)
+PIG-4537: Fix unit test failure introduced by TEZ-2392: TestCollectedGroup,
TestLimitVariable, TestMapSideCogroup, etc (daijy)
PIG-4530: StackOverflow in TestMultiQueryLocal running under hadoop20
(nielsbasjes via rohini)
Modified: pig/branches/branch-0.15/src/org/apache/pig/JVMReuseImpl.java
URL:
http://svn.apache.org/viewvc/pig/branches/branch-0.15/src/org/apache/pig/JVMReuseImpl.java?rev=1681164&r1=1681163&r2=1681164&view=diff
==============================================================================
--- pig/branches/branch-0.15/src/org/apache/pig/JVMReuseImpl.java (original)
+++ pig/branches/branch-0.15/src/org/apache/pig/JVMReuseImpl.java Fri May 22
17:28:59 2015
@@ -28,23 +28,42 @@ public class JVMReuseImpl {
private static Log LOG = LogFactory.getLog(JVMReuseImpl.class);
public void cleanupStaticData() {
+ String className = null;
+ String msg = null;
List<Method> staticCleanupMethods = JVMReuseManager.getInstance()
.getStaticDataCleanupMethods();
for (Method m : staticCleanupMethods) {
try {
- String msg = "Invoking method " + m.getName() + " in class "
- + m.getDeclaringClass().getName() + " for static data
cleanup";
- if
(m.getDeclaringClass().getName().startsWith("org.apache.pig")) {
+ className = m.getDeclaringClass() == null ? "anonymous" :
m.getDeclaringClass().getName();
+ msg = "Invoking method " + m.getName() + " in class "
+ + className + " for static data cleanup";
+ if (className.startsWith("org.apache.pig")) {
LOG.debug(msg);
} else {
LOG.info(msg);
}
m.invoke(null);
+ msg = null;
} catch (Exception e) {
- throw new RuntimeException("Error while invoking method "
- + m.getName() + " in class " +
m.getDeclaringClass().getName()
- + " for static data cleanup", e);
+ LOG.error("Exception while calling static methods:" +
getMethodNames() + ". " + msg, e);
+ throw new RuntimeException("Error while " + msg, e);
}
}
}
+
+ private String getMethodNames() {
+ StringBuilder sb = new StringBuilder();
+ for (Method m :
JVMReuseManager.getInstance().getStaticDataCleanupMethods()) {
+ if (m == null) {
+ sb.append("null,");
+ } else {
+ sb.append(m.getDeclaringClass() == null ? "anonymous" :
m.getDeclaringClass().getName());
+ sb.append(".").append(m.getName()).append(",");
+ }
+ }
+ if (sb.length() > 1) {
+ sb.deleteCharAt(sb.length() - 1);
+ }
+ return sb.toString();
+ }
}