Author: pradeepkth Date: Thu Apr 15 17:22:49 2010 New Revision: 934492 URL: http://svn.apache.org/viewvc?rev=934492&view=rev Log: PIG-1372: Restore PigInputFormat.sJob for backward compatibility (pradeepkth)
Modified: hadoop/pig/branches/branch-0.7/CHANGES.txt hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java Modified: hadoop/pig/branches/branch-0.7/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.7/CHANGES.txt?rev=934492&r1=934491&r2=934492&view=diff ============================================================================== --- hadoop/pig/branches/branch-0.7/CHANGES.txt (original) +++ hadoop/pig/branches/branch-0.7/CHANGES.txt Thu Apr 15 17:22:49 2010 @@ -183,6 +183,8 @@ OPTIMIZATIONS 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/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java URL: http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java?rev=934492&r1=934491&r2=934492&view=diff ============================================================================== --- hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java (original) +++ hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java Thu Apr 15 17:22:49 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/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java URL: http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java?rev=934492&r1=934491&r2=934492&view=diff ============================================================================== --- hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java (original) +++ hadoop/pig/branches/branch-0.7/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigMapReduce.java Thu Apr 15 17:22:49 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; /** * This class is the static Mapper & Reducer classes that @@ -81,6 +82,15 @@ import org.apache.pig.impl.util.Spillabl 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;