Author: pradeepkth
Date: Thu Apr 15 17:04:25 2010
New Revision: 934488

URL: http://svn.apache.org/viewvc?rev=934488&view=rev
Log:
PIG-1372: Restore PigInputFormat.sJob for backward compatibility (pradeepkth)

Modified:
    hadoop/pig/trunk/CHANGES.txt
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=934488&r1=934487&r2=934488&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Thu Apr 15 17:04:25 2010
@@ -43,6 +43,8 @@ PIG-1309: Map-side Cogroup (ashutoshc)
 
 BUG FIXES
 
+PIG-1372: Restore PigInputFormat.sJob for backward compatibility (pradeepkth)
+
 PIG-1369: POProject does not handle null tuples and non existent fields in
 some cases (pradeepkth)
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java?rev=934488&r1=934487&r2=934488&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
 Thu Apr 15 17:04:25 2010
@@ -47,6 +47,7 @@ import org.apache.pig.impl.io.FileSpec;
 import org.apache.pig.impl.plan.OperatorKey;
 import org.apache.pig.impl.util.ObjectSerializer;
 import org.apache.pig.impl.util.Pair;
+import org.apache.pig.impl.util.UDFContext;
 
 public class PigInputFormat extends InputFormat<Text, Tuple> {
 
@@ -62,6 +63,14 @@ public class PigInputFormat extends Inpu
     
     public static final String PIG_INPUTS = "pig.inputs";
 
+    /**
+     * @deprecated Use {...@link UDFContext} instead in the following way to 
get 
+     * the job's {...@link Configuration}:
+     * <pre>UdfContext.getUdfContext().getJobConf()</pre>
+     */
+    @Deprecated
+    public static Configuration sJob;
+
     /* (non-Javadoc)
      * @see 
org.apache.hadoop.mapreduce.InputFormat#createRecordReader(org.apache.hadoop.mapreduce.InputSplit,
 org.apache.hadoop.mapreduce.TaskAttemptContext)
      */
@@ -93,6 +102,10 @@ public class PigInputFormat extends Inpu
         
         // merge entries from split specific conf into the conf we got
         PigInputFormat.mergeSplitSpecificConf(loadFunc, pigSplit, conf);
+        
+        // for backward compatibility
+        PigInputFormat.sJob = conf;
+        
         InputFormat inputFormat = loadFunc.getInputFormat();
         // now invoke the createRecordReader() with this "adjusted" conf
         RecordReader reader = inputFormat.createRecordReader(

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java?rev=934488&r1=934487&r2=934488&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java
 Thu Apr 15 17:04:25 2010
@@ -54,6 +54,7 @@ import org.apache.pig.impl.plan.Dependen
 import org.apache.pig.impl.plan.VisitorException;
 import org.apache.pig.impl.util.ObjectSerializer;
 import org.apache.pig.impl.util.SpillableMemoryManager;
+import org.apache.pig.impl.util.UDFContext;
 import org.apache.pig.tools.pigstats.PigStatusReporter;
 
 /**
@@ -82,6 +83,15 @@ import org.apache.pig.tools.pigstats.Pig
 public class PigMapReduce {
 
     public static JobContext sJobContext = null;
+    
+    /**
+     * @deprecated Use {...@link UDFContext} instead in the following way to 
get 
+     * the job's {...@link Configuration}:
+     * <pre>UdfContext.getUdfContext().getJobConf()</pre>
+     */
+    // This is used by internal pig code - it is deprecated for user code but 
is
+    // used by Pig internal code to set up UDFContext's conf among other 
things.
+    @Deprecated
     public static Configuration sJobConf = null;
     private final static Tuple DUMMYTUPLE = null;
     


Reply via email to