HBASE-5966 MapReduce based tests broken on Hadoop 2.0.0-alpha

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1337448 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-05-12 05:48:04 +00:00
parent 273852209a
commit d529ab5e94
1 changed files with 14 additions and 5 deletions

View File

@ -1334,17 +1334,26 @@ public class HBaseTestingUtility {
mrCluster = new MiniMRCluster(servers,
FS_URI != null ? FS_URI : FileSystem.get(conf).getUri().toString(), 1);
JobConf jobConf = MapreduceTestingShim.getJobConf(mrCluster);
if (jobConf != null) {
jobConf.set("mapred.local.dir",
conf.get("mapred.local.dir")); //Hadoop MiniMR overwrites this while it should not
if (jobConf == null) {
jobConf = mrCluster.createJobConf();
}
jobConf.set("mapred.local.dir",
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"));
conf.set("mapred.job.tracker", jobConf.get("mapred.job.tracker"));
// this for mrv2 support; mr1 ignores this
conf.set("mapreduce.framework.name", "yarn");
String rmAdress = jobConf.get("yarn.resourcemanager.address");
if (rmAdress != null) {
conf.set("yarn.resourcemanager.address", rmAdress);
}
String schedulerAdress =
jobConf.get("yarn.resourcemanager.scheduler.address");
if (schedulerAdress != null) {
conf.set("yarn.resourcemanager.scheduler.address", schedulerAdress);
}
}
/**