hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1333778 - in /hbase/trunk/src/test/java/org/apache/hadoop/hbase: HBaseTestingUtility.java mapreduce/MapreduceTestingShim.java mapreduce/TestImportExport.java
Date Fri, 04 May 2012 07:08:19 GMT
Author: jmhsieh
Date: Fri May  4 07:08:18 2012
New Revision: 1333778

URL: http://svn.apache.org/viewvc?rev=1333778&view=rev
Log:
HBASE-5876 TestImportExport has been failing against hadoop 0.23 profile

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/MapreduceTestingShim.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1333778&r1=1333777&r2=1333778&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Fri May  4
07:08:18 2012
@@ -452,7 +452,7 @@ public class HBaseTestingUtility {
     createDirAndSetProperty("cache_data", "test.cache.data");
     createDirAndSetProperty("hadoop_tmp", "hadoop.tmp.dir");
     hadoopLogDir = createDirAndSetProperty("hadoop_logs", "hadoop.log.dir");
-    createDirAndSetProperty("mapred_output", "mapred.output.dir");
+    createDirAndSetProperty("mapred_output", MapreduceTestingShim.getMROutputDirProp());
     createDirAndSetProperty("mapred_local", "mapred.local.dir");
     createDirAndSetProperty("mapred_system", "mapred.system.dir");
     createDirAndSetProperty("mapred_temp", "mapred.temp.dir");
@@ -1339,9 +1339,11 @@ public class HBaseTestingUtility {
           conf.get("mapred.local.dir")); //Hadoop MiniMR overwrites this while it should
not
     }
     LOG.info("Mini mapreduce cluster started");
+
+    // Needed for TestImportTsv.
     conf.set("mapred.job.tracker",
         mrCluster.createJobConf().get("mapred.job.tracker"));
-    /* this for mrv2 support */
+    // this for mrv2 support; mr1 ignores this 
     conf.set("mapreduce.framework.name", "yarn");
   }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/MapreduceTestingShim.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/MapreduceTestingShim.java?rev=1333778&r1=1333777&r2=1333778&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/MapreduceTestingShim.java
(original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/MapreduceTestingShim.java
Fri May  4 07:08:18 2012
@@ -55,6 +55,8 @@ abstract public class MapreduceTestingSh
   
   abstract public JobConf obtainJobConf(MiniMRCluster cluster);
 
+  abstract public String obtainMROutputDirProp();
+  
   public static JobContext createJobContext(Configuration jobConf)
       throws IOException {
     return instance.newJobContext(jobConf);
@@ -64,6 +66,10 @@ abstract public class MapreduceTestingSh
     return instance.obtainJobConf(cluster);
   }
 
+  public static String getMROutputDirProp() {
+    return instance.obtainMROutputDirProp();
+  }
+  
   private static class MapreduceV1Shim extends MapreduceTestingShim {
     public JobContext newJobContext(Configuration jobConf) throws IOException {
       // Implementing:
@@ -95,6 +101,11 @@ abstract public class MapreduceTestingSh
         return null;
       }
     }
+
+    @Override
+    public String obtainMROutputDirProp() {
+      return "mapred.output.dir";
+    }
   };
 
   private static class MapreduceV2Shim extends MapreduceTestingShim {
@@ -123,6 +134,13 @@ abstract public class MapreduceTestingSh
         return null;
       }
     }
+
+    @Override
+    public String obtainMROutputDirProp() {
+      // This is a copy of o.a.h.mapreduce.lib.output.FileOutputFormat.OUTDIR 
+      // from Hadoop 0.23.x.  If we use the source directly we break the hadoop 1.x compile.

+      return "mapreduce.output.fileoutputformat.outputdir";
+    }
   };
 
 }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java?rev=1333778&r1=1333777&r2=1333778&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java Fri
May  4 07:08:18 2012
@@ -24,7 +24,6 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.MediumTests;
@@ -111,6 +110,7 @@ public class TestImportExport {
     args = opts.getRemainingArgs();
 
     Job job = Export.createSubmittableJob(conf, args);
+    job.getConfiguration().set("mapreduce.framework.name", "yarn");
     job.waitForCompletion(false);
     assertTrue(job.isSuccessful());
 
@@ -128,6 +128,7 @@ public class TestImportExport {
     args = opts.getRemainingArgs();
 
     job = Import.createSubmittableJob(conf, args);
+    job.getConfiguration().set("mapreduce.framework.name", "yarn");
     job.waitForCompletion(false);
     assertTrue(job.isSuccessful());
 
@@ -178,6 +179,7 @@ public class TestImportExport {
     args = opts.getRemainingArgs();
 
     Job job = Export.createSubmittableJob(conf, args);
+    job.getConfiguration().set("mapreduce.framework.name", "yarn");
     job.waitForCompletion(false);
     assertTrue(job.isSuccessful());
 
@@ -201,6 +203,7 @@ public class TestImportExport {
     args = opts.getRemainingArgs();
 
     job = Import.createSubmittableJob(conf, args);
+    job.getConfiguration().set("mapreduce.framework.name", "yarn");
     job.waitForCompletion(false);
     assertTrue(job.isSuccessful());
 



Mime
View raw message