HBASE-5876 TestImportExport has been failing against hadoop 0.23 profile

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1333778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2012-05-04 07:08:18 +00:00
parent 41da06b7a6
commit 07082e8f69
3 changed files with 26 additions and 3 deletions

View File

@ -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");
}

View File

@ -55,6 +55,8 @@ abstract public class MapreduceTestingShim {
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 MapreduceTestingShim {
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 MapreduceTestingShim {
return null;
}
}
@Override
public String obtainMROutputDirProp() {
return "mapred.output.dir";
}
};
private static class MapreduceV2Shim extends MapreduceTestingShim {
@ -123,6 +134,13 @@ abstract public class MapreduceTestingShim {
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";
}
};
}

View File

@ -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());