pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From knogu...@apache.org
Subject svn commit: r1741439 - in /pig/trunk: src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java test/org/apache/pig/test/Util.java
Date Thu, 28 Apr 2016 14:51:07 GMT
Author: knoguchi
Date: Thu Apr 28 14:51:07 2016
New Revision: 1741439

URL: http://svn.apache.org/viewvc?rev=1741439&view=rev
Log:
PIG-4833 Fixing test build failure for hadoop 1.x caused from previous patch (knoguchi)

Modified:
    pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
    pig/trunk/test/org/apache/pig/test/Util.java

Modified: pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java?rev=1741439&r1=1741438&r2=1741439&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
(original)
+++ pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
Thu Apr 28 14:51:07 2016
@@ -39,6 +39,8 @@ import org.apache.pig.PigConfiguration;
 import org.apache.pig.impl.PigContext;
 import org.apache.pig.impl.io.FileLocalizer;
 
+import com.google.common.annotations.VisibleForTesting;
+
 public class TezResourceManager {
     private static TezResourceManager instance = null;
     private boolean inited = false;
@@ -59,6 +61,7 @@ public class TezResourceManager {
     /**
      * This method is only used by test code to reset state.
      */
+    @VisibleForTesting
     public static void dropInstance() {
         instance = null;
     }

Modified: pig/trunk/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/Util.java?rev=1741439&r1=1741438&r2=1741439&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/Util.java (original)
+++ pig/trunk/test/org/apache/pig/test/Util.java Thu Apr 28 14:51:07 2016
@@ -75,7 +75,7 @@ import org.apache.pig.backend.hadoop.exe
 import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher;
 import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans.MROperPlan;
 import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan;
-import org.apache.pig.backend.hadoop.executionengine.tez.TezResourceManager;
+import org.apache.pig.backend.hadoop.executionengine.shims.HadoopShims;
 import org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil;
 import org.apache.pig.builtin.Utf8StorageConverter;
 import org.apache.pig.data.BagFactory;
@@ -1344,7 +1344,16 @@ public class Util {
 
         // For tez testing, we want to avoid TezResourceManager/LocalResource reuse
         // (when switching between local and mapreduce/tez)
-        TezResourceManager.dropInstance();
+        if( HadoopShims.isHadoopYARN() ) {
+            try {
+                java.lang.reflect.Method tez_dropInstance = Class.forName(
+                  "org.apache.pig.backend.hadoop.executionengine.tez.TezResourceManager").getDeclaredMethod(
+                  "dropInstance", (Class<?>[]) null );
+                tez_dropInstance.invoke(null);
+            } catch (Exception e){
+                throw new RuntimeException(e);
+            }
+        }
 
         // TODO: once we have Tez local mode, we can get rid of this. For now,
         // if we run this test suite in Tez mode and there are some tests



Mime
View raw message