From 62327bc08dc6682c47fae75af3a3390387fdc54f Mon Sep 17 00:00:00 2001 From: ndimiduk Date: Tue, 1 Apr 2014 23:27:56 +0000 Subject: [PATCH] HBASE-10830 Integration test MR jobs attempt to load htrace jars from the wrong location git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1583826 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/mapreduce/IntegrationTestImportTsv.java | 7 +++++++ .../hbase/test/IntegrationTestBigLinkedList.java | 14 +++++++++++++- .../hbase/test/IntegrationTestLoadAndVerify.java | 9 +++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java index cfeb3dc9842..a24e70be994 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestImportTsv.java @@ -123,11 +123,18 @@ public class IntegrationTestImportTsv implements Configurable, Tool { util = new IntegrationTestingUtility(); } util.initializeCluster(1); + if (!util.isDistributedCluster()) { + // also need MR when running without a real cluster + util.startMiniMapReduceCluster(); + } } @AfterClass public static void releaseCluster() throws Exception { util.restoreCluster(); + if (!util.isDistributedCluster()) { + util.shutdownMiniMapReduceCluster(); + } util = null; } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index fb1f3e4415c..62440716f70 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -1024,10 +1024,22 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { @Override public void setUpCluster() throws Exception { util = getTestingUtil(getConf()); - util.initializeCluster(util.isDistributedCluster() ? 1 : this.NUM_SLAVES_BASE); + boolean isDistributed = util.isDistributedCluster(); + util.initializeCluster(isDistributed ? 1 : this.NUM_SLAVES_BASE); + if (!isDistributed) { + util.startMiniMapReduceCluster(); + } this.setConf(util.getConfiguration()); } + @Override + public void cleanUpCluster() throws Exception { + super.cleanUpCluster(); + if (util.isDistributedCluster()) { + util.shutdownMiniMapReduceCluster(); + } + } + @Test public void testContinuousIngest() throws IOException, Exception { //Loop diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java index 40d7a492527..0bc5e5c0fdd 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java @@ -127,9 +127,18 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase { getConf().setLong(NUM_TO_WRITE_KEY, NUM_TO_WRITE_DEFAULT / 100); getConf().setInt(NUM_MAP_TASKS_KEY, NUM_MAP_TASKS_DEFAULT / 100); getConf().setInt(NUM_REDUCE_TASKS_KEY, NUM_REDUCE_TASKS_DEFAULT / 10); + util.startMiniMapReduceCluster(); } } +@Override +public void cleanUpCluster() throws Exception { + super.cleanUpCluster(); + if (!util.isDistributedCluster()) { + util.shutdownMiniMapReduceCluster(); + } +} + /** * Converts a "long" value between endian systems. * Borrowed from Apache Commons IO