You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2012/03/08 00:42:57 UTC

svn commit: r1298226 - in /pig/branches/branch-0.10: CHANGES.txt build.xml src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java src/org/apache/pig/impl/util/UDFContext.java

Author: daijy
Date: Wed Mar  7 23:42:57 2012
New Revision: 1298226

URL: http://svn.apache.org/viewvc?rev=1298226&view=rev
Log:
PIG-2532: Registered classes fail deserialization in frontend

Modified:
    pig/branches/branch-0.10/CHANGES.txt
    pig/branches/branch-0.10/build.xml
    pig/branches/branch-0.10/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java
    pig/branches/branch-0.10/src/org/apache/pig/impl/util/UDFContext.java

Modified: pig/branches/branch-0.10/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/CHANGES.txt?rev=1298226&r1=1298225&r2=1298226&view=diff
==============================================================================
--- pig/branches/branch-0.10/CHANGES.txt (original)
+++ pig/branches/branch-0.10/CHANGES.txt Wed Mar  7 23:42:57 2012
@@ -336,6 +336,8 @@ Release 0.9.3 - Unreleased
 
 BUG FIXES
 
+PIG-2532: Registered classes fail deserialization in frontend (traviscrawford via julien)
+
 PIG-2572: e2e harness deploy fails when using pig that does not bundle hadoop (thw via daijy)
 
 PIG-2568: PigOutputCommitter hide exception in commitJob (daijy)

Modified: pig/branches/branch-0.10/build.xml
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/build.xml?rev=1298226&r1=1298225&r2=1298226&view=diff
==============================================================================
--- pig/branches/branch-0.10/build.xml (original)
+++ pig/branches/branch-0.10/build.xml Wed Mar  7 23:42:57 2012
@@ -405,7 +405,7 @@
             <param name="dist" value="${test.build.classes}" />
             <param name="cp" value="test.classpath" />
             <!-- don't compile PigTestLoader -->
-            <param name="excludes" value="**/PigTestLoader.java" />
+            <param name="excludes" value="**/PigTestLoader.java **/resources/**" />
         </antcall>
 
         <antcall target="compile-sources-all-warnings" inheritRefs="true" inheritall="true">
@@ -413,7 +413,7 @@
             <param name="dist" value="${test.build.classes}" />
             <param name="cp" value="test.classpath" />
             <!-- don't compile PigTestLoader -->
-            <param name="excludes" value="**/PigTestLoader.java" />            
+            <param name="excludes" value="**/PigTestLoader.java **/resources/**" />
         </antcall>
     	
     	<copy file="${basedir}/test/hbase-site.xml" tofile="${test.build.classes}/hbase-site.xml"/>

Modified: pig/branches/branch-0.10/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java?rev=1298226&r1=1298225&r2=1298226&view=diff
==============================================================================
--- pig/branches/branch-0.10/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java (original)
+++ pig/branches/branch-0.10/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReduceLauncher.java Wed Mar  7 23:42:57 2012
@@ -64,6 +64,7 @@ import org.apache.pig.impl.plan.VisitorE
 import org.apache.pig.impl.plan.CompilationMessageCollector.MessageType;
 import org.apache.pig.impl.util.ConfigurationValidator;
 import org.apache.pig.impl.util.LogUtils;
+import org.apache.pig.impl.util.UDFContext;
 import org.apache.pig.impl.util.Utils;
 import org.apache.pig.tools.pigstats.PigStats;
 import org.apache.pig.tools.pigstats.PigStatsUtil;
@@ -249,8 +250,17 @@ public class MapReduceLauncher extends L
             }
             
             completeFailedJobsInThisRun.clear();
-            
-            Thread jcThread = new Thread(jc);
+
+            // Set the thread UDFContext so registered classes are available.
+            final UDFContext udfContext = UDFContext.getUDFContext();
+            Thread jcThread = new Thread(jc) {
+                @Override
+                public void run() {
+                    UDFContext.setUdfContext(udfContext);
+                    super.run();
+                }
+            };
+
             jcThread.setUncaughtExceptionHandler(jctExceptionHandler);
             
             jcThread.setContextClassLoader(PigContext.getClassLoader());

Modified: pig/branches/branch-0.10/src/org/apache/pig/impl/util/UDFContext.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/src/org/apache/pig/impl/util/UDFContext.java?rev=1298226&r1=1298225&r2=1298226&view=diff
==============================================================================
--- pig/branches/branch-0.10/src/org/apache/pig/impl/util/UDFContext.java (original)
+++ pig/branches/branch-0.10/src/org/apache/pig/impl/util/UDFContext.java Wed Mar  7 23:42:57 2012
@@ -54,6 +54,13 @@ public class UDFContext {
     /*
      *  internal pig use only - should NOT be called from user code
      */
+    public static void setUdfContext(UDFContext udfContext) {
+        tss.set(udfContext);
+    }
+
+    /*
+     *  internal pig use only - should NOT be called from user code
+     */
     public void setClientSystemProps(Properties properties) {
         clientSysProps = properties;
     }