incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tof...@apache.org
Subject svn commit: r1388165 - in /incubator/hcatalog/trunk: CHANGES.txt shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java
Date Thu, 20 Sep 2012 19:04:49 GMT
Author: toffer
Date: Thu Sep 20 19:04:48 2012
New Revision: 1388165

URL: http://svn.apache.org/viewvc?rev=1388165&view=rev
Log:
HCAT-494 MultiOutputFormat in 0.23 fails to setAliasConf() correctly. (mithun via toffer)

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java
    incubator/hcatalog/trunk/src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java
    incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1388165&r1=1388164&r2=1388165&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Thu Sep 20 19:04:48 2012
@@ -111,6 +111,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-494 MultiOutputFormat in 0.23 fails to setAliasConf() correctly. (mithun via toffer)
+
   HCAT-507 e2e harness failing on 0.23 (toffer)
 
   HCAT-502 HCatalog dependency resolution fails due to missing repo (traviscrawford)

Modified: incubator/hcatalog/trunk/shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java?rev=1388165&r1=1388164&r2=1388165&view=diff
==============================================================================
--- incubator/hcatalog/trunk/shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java
(original)
+++ incubator/hcatalog/trunk/shims/src/23/java/org/apache/hcatalog/shims/HCatHadoopShims23.java
Thu Sep 20 19:04:48 2012
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.Reporter;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.JobContext;
@@ -50,7 +51,9 @@ public class HCatHadoopShims23 implement
     @Override
     public org.apache.hadoop.mapreduce.TaskAttemptContext createTaskAttemptContext(Configuration
conf,
                                                                                    org.apache.hadoop.mapreduce.TaskAttemptID
taskId) {
-        return new org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl(conf, taskId);
+        return new org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl(
+					conf instanceof JobConf? new JobConf(conf) : conf, 
+					taskId);
     }
 
     @Override
@@ -62,7 +65,8 @@ public class HCatHadoopShims23 implement
                 org.apache.hadoop.mapred.JobConf.class, org.apache.hadoop.mapred.TaskAttemptID.class,
                 Reporter.class);
             construct.setAccessible(true);
-            newContext = (org.apache.hadoop.mapred.TaskAttemptContext) construct.newInstance(conf,
taskId, (Reporter) progressable);
+            newContext = (org.apache.hadoop.mapred.TaskAttemptContext) construct.newInstance(
+                           new JobConf(conf), taskId, (Reporter) progressable);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
@@ -72,17 +76,15 @@ public class HCatHadoopShims23 implement
     @Override
     public JobContext createJobContext(Configuration conf,
                                        JobID jobId) {
-        JobContext ctxt = new JobContextImpl(conf, jobId);
-
-        return ctxt;
+        return new JobContextImpl(conf instanceof JobConf? new JobConf(conf) : conf,
+                                  jobId);
     }
 
     @Override
     public org.apache.hadoop.mapred.JobContext createJobContext(org.apache.hadoop.mapred.JobConf
conf,
                                                                 org.apache.hadoop.mapreduce.JobID
jobId, Progressable progressable) {
-        org.apache.hadoop.mapred.JobContext newContext =
-            new org.apache.hadoop.mapred.JobContextImpl(conf, jobId, (org.apache.hadoop.mapred.Reporter)
progressable);
-        return newContext;
+        return new org.apache.hadoop.mapred.JobContextImpl(
+					new JobConf(conf), jobId, (org.apache.hadoop.mapred.Reporter) progressable);
     }
 
     @Override

Modified: incubator/hcatalog/trunk/src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java?rev=1388165&r1=1388164&r2=1388165&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java (original)
+++ incubator/hcatalog/trunk/src/java/org/apache/hadoop/mapred/HCatMapRedUtil.java Thu Sep
20 19:04:48 2012
@@ -39,9 +39,9 @@ public class HCatMapRedUtil {
     }
 
     public static org.apache.hadoop.mapred.JobContext createJobContext(org.apache.hadoop.mapreduce.JobContext
context) {
-        return createJobContext(new JobConf(context.getConfiguration()),
-                                            context.getJobID(),
-                                            Reporter.NULL);
+        return createJobContext((JobConf)context.getConfiguration(),
+                                context.getJobID(),
+                                Reporter.NULL);
     }
 
     public static JobContext createJobContext(JobConf conf, org.apache.hadoop.mapreduce.JobID
id, Progressable progressable) {

Modified: incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java?rev=1388165&r1=1388164&r2=1388165&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java
(original)
+++ incubator/hcatalog/trunk/src/java/org/apache/hcatalog/mapreduce/MultiOutputFormat.java
Thu Sep 20 19:04:48 2012
@@ -288,8 +288,10 @@ public class MultiOutputFormat extends O
                 }
             }
         }
-        builder.delete(builder.length() - CONF_VALUE_DELIM.length(), builder.length());
-        userConf.set(getAliasConfName(alias), builder.toString());
+        if (builder.length() > CONF_VALUE_DELIM.length()) {
+            builder.delete(builder.length() - CONF_VALUE_DELIM.length(), builder.length());
+            userConf.set(getAliasConfName(alias), builder.toString());
+        }
     }
 
     private static String getMergedConfValue(String originalValues, String newValues, String
separator) {



Mime
View raw message