From d529ab5e947f1f7136b06fde3fadad9b8fa43daa Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Sat, 12 May 2012 05:48:04 +0000 Subject: [PATCH] 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 --- .../hadoop/hbase/HBaseTestingUtility.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 9fba339f697..be932d7c429 100644 --- a/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -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); + } } /**