Revert "HBASE-14684 Try to remove all MiniMapReduceCluster in unit tests (Heng Chen)"
This reverts commit ef7f8467af52cd1d6563ad5b1f6624be6872a165. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f9efeaad Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f9efeaad Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f9efeaad Branch: refs/heads/hbase-12439 Commit: f9efeaad1d5396e7cfca461ddeaa5931dc473f5f Parents: 418c442 Author: stack <st...@apache.org> Authored: Sat Oct 24 10:00:27 2015 -0700 Committer: stack <st...@apache.org> Committed: Sat Oct 24 10:00:27 2015 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/mapred/TestTableInputFormat.java | 8 ++++---- .../apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java | 2 ++ .../hbase/mapreduce/MultiTableInputFormatTestBase.java | 3 +++ .../hbase/mapreduce/TableSnapshotInputFormatTestBase.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestCellCounter.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestCopyTable.java | 2 ++ .../apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java | 6 ++++++ .../hadoop/hbase/mapreduce/TestHFileOutputFormat2.java | 6 ++++++ .../hadoop/hbase/mapreduce/TestHRegionPartitioner.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestHashTable.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestImportExport.java | 2 ++ .../mapreduce/TestImportTSVWithOperationAttributes.java | 2 ++ .../apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java | 2 ++ .../hbase/mapreduce/TestImportTSVWithVisibilityLabels.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestImportTsv.java | 2 ++ .../hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestRowCounter.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestSyncTable.java | 2 ++ .../apache/hadoop/hbase/mapreduce/TestTableInputFormat.java | 2 ++ .../hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java | 3 +++ .../hadoop/hbase/mapreduce/TestTableMapReduceBase.java | 2 ++ .../apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java | 2 ++ .../org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java | 2 ++ .../org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java | 2 ++ .../apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java | 1 + .../hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java | 1 + .../hadoop/hbase/snapshot/TestSecureExportSnapshot.java | 1 + 27 files changed, 63 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java index 1975c59..8498341 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java @@ -34,7 +34,6 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.client.Connection; @@ -81,7 +80,7 @@ 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 }; @@ -89,10 +88,12 @@ public class TestTableInputFormat { @BeforeClass public static void beforeClass() throws Exception { UTIL.startMiniCluster(); + mrCluster = UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } @@ -343,8 +344,7 @@ public class TestTableInputFormat { } void testInputFormat(Class<? extends InputFormat> clazz) throws IOException { - Configuration conf = UTIL.getConfiguration(); - final JobConf job = new JobConf(conf); + final JobConf job = MapreduceTestingShim.getJobConf(mrCluster); job.setInputFormat(clazz); job.setOutputFormat(NullOutputFormat.class); job.setMapperClass(ExampleVerifier.class); http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java index daa6e71..628bb96 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java @@ -90,10 +90,12 @@ public class TestTableMapReduceUtil { public static void beforeClass() throws Exception { UTIL.startMiniCluster(); presidentsTable = createAndFillTable(TableName.valueOf(TABLE_NAME)); + UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java ---------------------------------------------------------------------- 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 3cd8b4d..38e97b3 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 @@ -83,10 +83,13 @@ public abstract class MultiTableInputFormatTestBase { 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java ---------------------------------------------------------------------- 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 58db63e..d6c5d32 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 @@ -154,12 +154,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(); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java ---------------------------------------------------------------------- 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 54a81b7..78707fd 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 @@ -63,12 +63,14 @@ public class TestCellCounter { @BeforeClass public static void beforeClass() throws Exception { 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java ---------------------------------------------------------------------- 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 626383b..1c13157 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,10 +62,12 @@ public class TestCopyTable { @BeforeClass public static void beforeClass() throws Exception { TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java ---------------------------------------------------------------------- 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 25642fe..90b92bb 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 @@ -403,6 +403,7 @@ public class TestHFileOutputFormat { assertEquals("Should make 5 regions", numRegions, 5); // Generate the bulk load files + util.startMiniMapReduceCluster(); runIncrementalPELoad(conf, table, r, testDir); // This doesn't write into the table, just makes files assertEquals("HFOF should not touch actual table", @@ -472,6 +473,7 @@ public class TestHFileOutputFormat { assertEquals("Data should remain after reopening of regions", tableDigestBefore, util.checksumRows(table)); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -935,6 +937,7 @@ public class TestHFileOutputFormat { // Generate two bulk load files conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); try (RegionLocator regionLocator = util.getConnection().getRegionLocator(TABLE_NAME)) { for (int i = 0; i < 2; i++) { @@ -975,6 +978,7 @@ public class TestHFileOutputFormat { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -1015,6 +1019,7 @@ public class TestHFileOutputFormat { // Generate a bulk load file with more rows conf.setBoolean("hbase.mapreduce.hfileoutputformat.compaction.exclude", true); + util.startMiniMapReduceCluster(); try (RegionLocator locator = util.getConnection().getRegionLocator(TABLE_NAME)) { runIncrementalPELoad(conf, table, locator, testDir); @@ -1053,6 +1058,7 @@ public class TestHFileOutputFormat { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java ---------------------------------------------------------------------- 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 69b3276..7a13e5d 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 @@ -430,6 +430,7 @@ public class TestHFileOutputFormat2 { assertEquals("Should make " + regionNum + " regions", numRegions, regionNum); // Generate the bulk load files + util.startMiniMapReduceCluster(); runIncrementalPELoad(conf, table.getTableDescriptor(), r, testDir); // This doesn't write into the table, just makes files assertEquals("HFOF should not touch actual table", 0, util.countRows(table)); @@ -510,6 +511,7 @@ public class TestHFileOutputFormat2 { } finally { testDir.getFileSystem(conf).delete(testDir, true); util.deleteTable(TABLE_NAME); + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -974,6 +976,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); @@ -1015,6 +1018,7 @@ public class TestHFileOutputFormat2 { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } @@ -1056,6 +1060,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); @@ -1095,6 +1100,7 @@ public class TestHFileOutputFormat2 { }, 5000); } finally { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java ---------------------------------------------------------------------- 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 9b461d7..33d0e74 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 @@ -36,10 +36,12 @@ public class TestHRegionPartitioner { @BeforeClass public static void beforeClass() throws Exception { UTIL.startMiniCluster(); + UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java ---------------------------------------------------------------------- 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 34020b5..2d03ac1 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 @@ -57,10 +57,12 @@ public class TestHashTable { @BeforeClass public static void beforeClass() throws Exception { TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java ---------------------------------------------------------------------- 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 b9ad6af..a3fc4f6 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 @@ -111,12 +111,14 @@ public class TestImportExport { // Up the handlers; this test needs more than usual. UTIL.getConfiguration().setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java ---------------------------------------------------------------------- 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 66cf0ff..7360a63 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 @@ -99,10 +99,12 @@ public class TestImportTSVWithOperationAttributes implements Configurable { conf.set("hbase.coprocessor.master.classes", OperationAttributesTestController.class.getName()); conf.set("hbase.coprocessor.region.classes", OperationAttributesTestController.class.getName()); util.startMiniCluster(); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java ---------------------------------------------------------------------- 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 3fc129f..445620f 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 @@ -90,10 +90,12 @@ public class TestImportTSVWithTTLs implements Configurable { conf.setInt("hfile.format.version", 3); conf.set("hbase.coprocessor.region.classes", TTLCheckingObserver.class.getName()); util.startMiniCluster(); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java index 2b96d8c..3aec669 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java @@ -124,6 +124,7 @@ public class TestImportTSVWithVisibilityLabels implements Configurable { // Wait for the labels table to become available util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000); createLabels(); + util.startMiniMapReduceCluster(); } private static void createLabels() throws IOException, InterruptedException { @@ -147,6 +148,7 @@ public class TestImportTSVWithVisibilityLabels implements Configurable { @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java ---------------------------------------------------------------------- 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 9b7c4ae..66fdf93 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 @@ -104,10 +104,12 @@ public class TestImportTsv implements Configurable { @BeforeClass public static void provisionCluster() throws Exception { util.startMiniCluster(); + util.startMiniMapReduceCluster(); } @AfterClass public static void releaseCluster() throws Exception { + util.shutdownMiniMapReduceCluster(); util.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java ---------------------------------------------------------------------- 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 03052fb..9e1d2bf 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 @@ -76,11 +76,13 @@ public class TestMultithreadedTableMapper { 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java ---------------------------------------------------------------------- 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 fe78844..b0bf558 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 @@ -64,6 +64,7 @@ public class TestRowCounter { @BeforeClass public static void setUpBeforeClass() throws Exception { TEST_UTIL.startMiniCluster(); + TEST_UTIL.startMiniMapReduceCluster(); Table table = TEST_UTIL.createTable(TableName.valueOf(TABLE_NAME), Bytes.toBytes(COL_FAM)); writeRows(table); table.close(); @@ -75,6 +76,7 @@ public class TestRowCounter { @AfterClass public static void tearDownAfterClass() throws Exception { TEST_UTIL.shutdownMiniCluster(); + TEST_UTIL.shutdownMiniMapReduceCluster(); } /** http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java ---------------------------------------------------------------------- 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 aca1705..841d8cb 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 @@ -60,10 +60,12 @@ public class TestSyncTable { @BeforeClass public static void beforeClass() throws Exception { TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java ---------------------------------------------------------------------- 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 b0a4243..0ec46e4 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 @@ -84,10 +84,12 @@ public class TestTableInputFormat { @BeforeClass public static void beforeClass() throws Exception { UTIL.startMiniCluster(); + mrCluster = UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + UTIL.shutdownMiniMapReduceCluster(); UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java index 46e1a0e..23714b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java @@ -84,10 +84,13 @@ public abstract class TestTableInputFormatScanBase { // create and fill table table = TEST_UTIL.createMultiRegionTable(TABLE_NAME, INPUT_FAMILY); 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java ---------------------------------------------------------------------- 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 77ebb48..5436a1d 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,10 +79,12 @@ public abstract class TestTableMapReduceBase { 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(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java ---------------------------------------------------------------------- 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 7e75830..03da1ed 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 @@ -168,6 +168,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 +185,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"))); http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java ---------------------------------------------------------------------- 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 60b050f..a12887e 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 @@ -73,10 +73,12 @@ public class TestWALPlayer { @BeforeClass public static void beforeClass() throws Exception { cluster = TEST_UTIL.startMiniCluster(); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void afterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java index a7ac1bb..9b85ac7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java @@ -87,10 +87,12 @@ public class TestExportSnapshot { public static void setUpBeforeClass() throws Exception { setUpBaseConf(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass public static void tearDownAfterClass() throws Exception { + TEST_UTIL.shutdownMiniMapReduceCluster(); TEST_UTIL.shutdownMiniCluster(); } http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java index 64c5bc0..b6cb339 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobExportSnapshot.java @@ -45,6 +45,7 @@ public class TestMobExportSnapshot extends TestExportSnapshot { public static void setUpBeforeClass() throws Exception { setUpBaseConf(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @Override http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java index 403e8bb..4a89db8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobSecureExportSnapshot.java @@ -45,6 +45,7 @@ public class TestMobSecureExportSnapshot extends TestMobExportSnapshot { SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); // Wait for the ACL table to become available TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME); http://git-wip-us.apache.org/repos/asf/hbase/blob/f9efeaad/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java index ea9a584..19d5965 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSecureExportSnapshot.java @@ -46,6 +46,7 @@ public class TestSecureExportSnapshot extends TestExportSnapshot { SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); // Wait for the ACL table to become available TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);