incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1300173 - /incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java
Date Tue, 13 Mar 2012 15:06:14 GMT
Author: gates
Date: Tue Mar 13 15:06:14 2012
New Revision: 1300173

URL: http://svn.apache.org/viewvc?rev=1300173&view=rev
Log:
HCATALOG-276 Yet more fixes for this.

Modified:
    incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java

Modified: incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java?rev=1300173&r1=1300172&r2=1300173&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java
(original)
+++ incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java
Tue Mar 13 15:06:14 2012
@@ -95,6 +95,9 @@ class FileOutputCommitterContainer exten
     @Override
     public void abortTask(TaskAttemptContext context) throws IOException {
         if (!dynamicPartitioningUsed){
+            // TODO: Hack! Pig messes up mapred.output.dir, when 2 Storers are used in the
same Pig script.
+            // Workaround: Set mapred.output.dir from OutputJobInfo.
+            resetMapRedOutputDirFromJobInfo(context.getConfiguration());
             getBaseOutputCommitter().abortTask(HCatMapRedUtil.createTaskAttemptContext(context));
         }
     }
@@ -114,6 +117,9 @@ class FileOutputCommitterContainer exten
     @Override
     public boolean needsTaskCommit(TaskAttemptContext context) throws IOException {
         if (!dynamicPartitioningUsed){
+            // TODO: Hack! Pig messes up mapred.output.dir, when 2 Storers are used in the
same Pig script.
+            // Workaround: Set mapred.output.dir from OutputJobInfo.
+            resetMapRedOutputDirFromJobInfo(context.getConfiguration());
             return getBaseOutputCommitter().needsTaskCommit(HCatMapRedUtil.createTaskAttemptContext(context));
         }else{
             // called explicitly through FileRecordWriterContainer.close() if dynamic - return
false by default
@@ -126,7 +132,7 @@ class FileOutputCommitterContainer exten
         if(getBaseOutputCommitter() != null && !dynamicPartitioningUsed) {
             // TODO: Hack! Pig messes up mapred.output.dir, when 2 Storers are used in the
same Pig script.
             // Workaround: Set mapred.output.dir from OutputJobInfo.
-            context.getConfiguration().set("mapred.output.dir", jobInfo.getLocation());
+            resetMapRedOutputDirFromJobInfo(context.getConfiguration());
             getBaseOutputCommitter().setupJob(HCatMapRedUtil.createJobContext(context));
         }
         // in dynamic usecase, called through FileRecordWriterContainer
@@ -135,6 +141,9 @@ class FileOutputCommitterContainer exten
     @Override
     public void setupTask(TaskAttemptContext context) throws IOException {
         if (!dynamicPartitioningUsed){
+            // TODO: Hack! Pig messes up mapred.output.dir, when 2 Storers are used in the
same Pig script.
+            // Workaround: Set mapred.output.dir from OutputJobInfo.
+            resetMapRedOutputDirFromJobInfo(context.getConfiguration());
             getBaseOutputCommitter().setupTask(HCatMapRedUtil.createTaskAttemptContext(context));
         }
     }



Mime
View raw message