From cf059e54b589ac45769c6f16863aed2debb638b4 Mon Sep 17 00:00:00 2001 From: chenheng Date: Tue, 22 Dec 2015 16:10:58 +0800 Subject: [PATCH] Revert "HBASE-14684 Try to remove all MiniMapReduceCluster in unit tests" This reverts commit b0965b1805f577b634052191d0c337d3cafabbca. --- .../mapreduce/MultiTableInputFormatTestBase.java | 4 +++- .../mapreduce/TableSnapshotInputFormatTestBase.java | 3 ++- .../hadoop/hbase/mapreduce/TestCellCounter.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestCopyTable.java | 3 ++- .../hadoop/hbase/mapreduce/TestHFileOutputFormat.java | 11 +++++++---- .../hbase/mapreduce/TestHFileOutputFormat2.java | 11 ++++++++--- .../hbase/mapreduce/TestHRegionPartitioner.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestHashTable.java | 3 ++- .../hadoop/hbase/mapreduce/TestImportExport.java | 3 ++- .../TestImportTSVWithOperationAttributes.java | 4 +++- .../hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestImportTsv.java | 3 ++- .../hbase/mapreduce/TestMultiTableInputFormat.java | 4 +++- .../hbase/mapreduce/TestMultithreadedTableMapper.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestRowCounter.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestSyncTable.java | 3 ++- .../hadoop/hbase/mapreduce/TestTableInputFormat.java | 4 +++- .../hbase/mapreduce/TestTableMapReduceBase.java | 3 ++- .../hadoop/hbase/mapreduce/TestTimeRangeMapRed.java | 3 ++- .../apache/hadoop/hbase/mapreduce/TestWALPlayer.java | 3 ++- 20 files changed, 55 insertions(+), 25 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java index 3ecf28d9576..eaedebf846a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java @@ -78,7 +78,6 @@ public abstract class MultiTableInputFormatTestBase { public static void setUpBeforeClass() throws Exception { // switch TIF to log at DEBUG level TEST_UTIL.enableDebug(MultiTableInputFormatBase.class); - TEST_UTIL.setJobWithoutMRCluster(); // start mini hbase cluster TEST_UTIL.startMiniCluster(3); // create and fill table @@ -93,10 +92,13 @@ public abstract class MultiTableInputFormatTestBase { } } } + // start MR cluster + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void tearDownAfterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java index 2941286b3af..38088069a24 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java @@ -60,7 +60,6 @@ public abstract class TableSnapshotInputFormatTestBase { public void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(NUM_REGION_SERVERS, true); rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir(); fs = rootDir.getFileSystem(UTIL.getConfiguration()); @@ -159,12 +158,14 @@ public abstract class TableSnapshotInputFormatTestBase { protected void testWithMapReduce(HBaseTestingUtility util, String snapshotName, int numRegions, int expectedNumSplits, boolean shutdownCluster) throws Exception { setupCluster(); + util.startMiniMapReduceCluster(); try { Path tableDir = util.getDataTestDirOnTestFS(snapshotName); TableName tableName = TableName.valueOf("testWithMapReduce"); testWithMapReduceImpl(util, tableName, snapshotName, tableDir, numRegions, expectedNumSplits, shutdownCluster); } finally { + util.shutdownMiniMapReduceCluster(); tearDownCluster(); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java index 41b76ba8af2..e3d03b8fafb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java @@ -60,14 +60,15 @@ public class TestCellCounter { @BeforeClass public static void beforeClass() throws Exception { - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); + UTIL.startMiniMapReduceCluster(); FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(new LocalFileSystem()); FileUtil.fullyDelete(new File(OUTPUT_DIR)); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java index b8ad5be6981..5492938294e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java @@ -62,12 +62,13 @@ public class TestCopyTable { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL.setJobWithoutMRCluster(); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java index b4bae992ea3..2bdcbc1fc37 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java @@ -390,7 +390,6 @@ public class TestHFileOutputFormat { byte[][] splitKeys = generateRandomSplitKeys(4); HBaseAdmin admin = null; try { - util.setJobWithoutMRCluster(); util.startMiniCluster(); Path testDir = util.getDataTestDirOnTestFS("testLocalMRIncrementalLoad"); admin = util.getHBaseAdmin(); @@ -404,6 +403,7 @@ public class TestHFileOutputFormat { assertEquals("Should make 5 regions", numRegions, 5); // Generate the bulk load files + util.startMiniMapReduceCluster(); runIncrementalPELoad(conf, table, testDir); // This doesn't write into the table, just makes files assertEquals("HFOF should not touch actual table", @@ -472,6 +472,7 @@ public class TestHFileOutputFormat { tableDigestBefore, util.checksumRows(table)); } finally { if (admin != null) admin.close(); + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -918,7 +919,6 @@ public class TestHFileOutputFormat { generateRandomStartKeys(5); try { - util.setJobWithoutMRCluster(); util.startMiniCluster(); final FileSystem fs = util.getDFSCluster().getFileSystem(); HBaseAdmin admin = new HBaseAdmin(conf); @@ -935,6 +935,7 @@ public class TestHFileOutputFormat { // Generate two bulk load files conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); for (int i = 0; i < 2; i++) { Path testDir = util.getDataTestDirOnTestFS("testExcludeAllFromMinorCompaction_" + i); @@ -973,6 +974,7 @@ public class TestHFileOutputFormat { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -984,10 +986,9 @@ public class TestHFileOutputFormat { generateRandomStartKeys(5); try { - util.setJobWithoutMRCluster(); util.startMiniCluster(); Path testDir = util.getDataTestDirOnTestFS("testExcludeMinorCompaction"); - final FileSystem fs = util.getTestFileSystem(); + final FileSystem fs = util.getDFSCluster().getFileSystem(); HBaseAdmin admin = new HBaseAdmin(conf); HTable table = util.createTable(TABLE_NAME, FAMILIES); assertEquals("Should start with empty table", 0, util.countRows(table)); @@ -1014,6 +1015,7 @@ public class TestHFileOutputFormat { // Generate a bulk load file with more rows conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); runIncrementalPELoad(conf, table, testDir); // Perform the actual load @@ -1049,6 +1051,7 @@ public class TestHFileOutputFormat { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java index bb1a073e5f5..e55affcabfb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java @@ -421,7 +421,6 @@ public class TestHFileOutputFormat2 { for (int i = 0; i < hostCount; ++i) { hostnames[i] = "datanode_" + i; } - util.setJobWithoutMRCluster(); util.startMiniCluster(1, hostCount, hostnames); HTable table = util.createTable(TABLE_NAME, FAMILIES, splitKeys); @@ -432,6 +431,7 @@ public class TestHFileOutputFormat2 { assertEquals("Should make " + regionNum + " regions", numRegions, regionNum); // Generate the bulk load files + util.startMiniMapReduceCluster(); runIncrementalPELoad(conf, table.getTableDescriptor(), table.getRegionLocator(), testDir); // This doesn't write into the table, just makes files assertEquals("HFOF should not touch actual table", 0, util.countRows(table)); @@ -511,6 +511,7 @@ public class TestHFileOutputFormat2 { } finally { testDir.getFileSystem(conf).delete(testDir, true); util.deleteTable(TABLE_NAME); + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -955,7 +956,7 @@ public class TestHFileOutputFormat2 { Configuration conf = util.getConfiguration(); conf.setInt("hbase.hstore.compaction.min", 2); generateRandomStartKeys(5); - util.setJobWithoutMRCluster(); + util.startMiniCluster(); try (Connection conn = ConnectionFactory.createConnection(); Admin admin = conn.getAdmin()) { @@ -973,6 +974,7 @@ public class TestHFileOutputFormat2 { // Generate two bulk load files conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); for (int i = 0; i < 2; i++) { Path testDir = util.getDataTestDirOnTestFS("testExcludeAllFromMinorCompaction_" + i); @@ -1014,6 +1016,7 @@ public class TestHFileOutputFormat2 { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -1023,7 +1026,7 @@ public class TestHFileOutputFormat2 { Configuration conf = util.getConfiguration(); conf.setInt("hbase.hstore.compaction.min", 2); generateRandomStartKeys(5); - util.setJobWithoutMRCluster(); + util.startMiniCluster(); try (Connection conn = ConnectionFactory.createConnection(conf); Admin admin = conn.getAdmin()){ @@ -1055,6 +1058,7 @@ public class TestHFileOutputFormat2 { // Generate a bulk load file with more rows conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); RegionLocator regionLocator = conn.getRegionLocator(TABLE_NAME); runIncrementalPELoad(conf, table.getTableDescriptor(), regionLocator, testDir); @@ -1094,6 +1098,7 @@ public class TestHFileOutputFormat2 { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java index 4354da5c9a2..220bc025aa5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java @@ -34,12 +34,13 @@ public class TestHRegionPartitioner { @BeforeClass public static void beforeClass() throws Exception { - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); + UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java index eae33a60b0e..762f5301634 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java @@ -56,12 +56,13 @@ public class TestHashTable { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL.setJobWithoutMRCluster(); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index 2154f990922..2e06fab3aa8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -107,14 +107,15 @@ public class TestImportExport { public static void beforeClass() throws Exception { // Up the handlers; this test needs more than usual. UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); + UTIL.startMiniMapReduceCluster(); FQ_OUTPUT_DIR = new Path(OUTPUT_DIR).makeQualified(FileSystem.get(UTIL.getConfiguration())).toString(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java index acb0e7cbe7d..eba843e7a6b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java @@ -102,12 +102,14 @@ public class TestImportTSVWithOperationAttributes implements Configurable { conf = util.getConfiguration(); conf.set("hbase.coprocessor.master.classes", OperationAttributesTestController.class.getName()); conf.set("hbase.coprocessor.region.classes", OperationAttributesTestController.class.getName()); - util.setJobWithoutMRCluster(); util.startMiniCluster(); + Admin admin = new HBaseAdmin(util.getConfiguration()); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java index 5add5d4e51a..268bba2a10d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java @@ -88,12 +88,13 @@ public class TestImportTSVWithTTLs implements Configurable { // need this where the default hfile version is not 3 (i.e. 0.98) conf.setInt("hfile.format.version", 3); conf.set("hbase.coprocessor.region.classes", TTLCheckingObserver.class.getName()); - util.setJobWithoutMRCluster(); util.startMiniCluster(); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java index 40c4b4d3a19..5adc04a7656 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java @@ -103,12 +103,13 @@ public class TestImportTsv implements Configurable { @BeforeClass public static void provisionCluster() throws Exception { - util.setJobWithoutMRCluster(); util.startMiniCluster(); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableInputFormat.java index 14edc30b452..a54df0830e0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultiTableInputFormat.java @@ -71,7 +71,6 @@ public class TestMultiTableInputFormat { // switch TIF to log at DEBUG level TEST_UTIL.enableDebug(MultiTableInputFormat.class); TEST_UTIL.enableDebug(MultiTableInputFormatBase.class); - TEST_UTIL.setJobWithoutMRCluster(); // start mini hbase cluster TEST_UTIL.startMiniCluster(3); // create and fill table @@ -82,10 +81,13 @@ public class TestMultiTableInputFormat { TEST_UTIL.loadTable(table, INPUT_FAMILY, false); } } + // start MR cluster + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void tearDownAfterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java index 9a81990688d..6b2ee753a99 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java @@ -72,17 +72,18 @@ public class TestMultithreadedTableMapper { public static void beforeClass() throws Exception { // Up the handlers; this test needs more than usual. UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); HTable table = UTIL.createMultiRegionTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY, OUTPUT_FAMILY }); UTIL.loadTable(table, INPUT_FAMILY, false); + UTIL.startMiniMapReduceCluster(); UTIL.waitUntilAllRegionsAssigned(MULTI_REGION_TABLE_NAME); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java index 0e04c673003..817e7a9a318 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java @@ -80,8 +80,8 @@ public class TestRowCounter { @BeforeClass public static void setUpBeforeClass() throws Exception { - TEST_UTIL.setJobWithoutMRCluster(); TEST_UTIL.startMiniCluster(); + TEST_UTIL.startMiniMapReduceCluster(); Table table = TEST_UTIL.createTable(TableName.valueOf(TABLE_NAME), Bytes.toBytes(COL_FAM)); writeRows(table); table.close(); @@ -94,6 +94,7 @@ public class TestRowCounter { public static void tearDownAfterClass() throws Exception { TEST_UTIL.shutdownMiniCluster(); + TEST_UTIL.shutdownMiniMapReduceCluster(); } /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java index 1b356e6253e..2f1bee3199b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java @@ -64,12 +64,13 @@ public class TestSyncTable { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL.setJobWithoutMRCluster(); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java index d404833716b..c53510fcc9e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java @@ -77,18 +77,20 @@ public class TestTableInputFormat { private static final Log LOG = LogFactory.getLog(TestTableInputFormat.class); private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static MiniMRCluster mrCluster; static final byte[] FAMILY = Bytes.toBytes("family"); private static final byte[][] columns = new byte[][] { FAMILY }; @BeforeClass public static void beforeClass() throws Exception { - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); + mrCluster = UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java index 022d4c9351b..8aed5884094 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java @@ -79,16 +79,17 @@ public abstract class TestTableMapReduceBase { @BeforeClass public static void beforeClass() throws Exception { - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); HTable table = UTIL.createMultiRegionTable(MULTI_REGION_TABLE_NAME, new byte[][] { INPUT_FAMILY, OUTPUT_FAMILY }); UTIL.loadTable(table, INPUT_FAMILY, false); + UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java index 207f256f291..cd85756062a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java @@ -83,7 +83,6 @@ public class TestTimeRangeMapRed { @BeforeClass public static void beforeClass() throws Exception { - UTIL.setJobWithoutMRCluster(); UTIL.startMiniCluster(); } @@ -168,6 +167,7 @@ public class TestTimeRangeMapRed { private void runTestOnTable() throws IOException, InterruptedException, ClassNotFoundException { + UTIL.startMiniMapReduceCluster(); Job job = null; try { job = new Job(UTIL.getConfiguration(), "test123"); @@ -184,6 +184,7 @@ public class TestTimeRangeMapRed { // TODO Auto-generated catch block e.printStackTrace(); } finally { + UTIL.shutdownMiniMapReduceCluster(); if (job != null) { FileUtil.fullyDelete( new File(job.getConfiguration().get("hadoop.tmp.dir"))); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java index 343fc64b409..d6929a255bb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java @@ -70,12 +70,13 @@ public class TestWALPlayer { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL.setJobWithoutMRCluster(); cluster = TEST_UTIL.startMiniCluster(); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); }