diff --git a/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java b/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java index 9a92e606ffb..a7c7a5e5ad2 100644 --- a/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java +++ b/hbase-archetypes/hbase-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/client/TestHelloHBase.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Get; @@ -46,8 +46,8 @@ public class TestHelloHBase { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHelloHBase.class); - private static final HBaseTestingUtility TEST_UTIL - = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL + = new HBaseTestingUtil(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java b/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java index 0f0f7d91ade..0282ff68a33 100644 --- a/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java +++ b/hbase-archetypes/hbase-shaded-client-project/src/test/java/org/apache/hbase/archetypes/exemplars/shaded_client/TestHelloHBase.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Get; @@ -46,8 +46,8 @@ public class TestHelloHBase { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHelloHBase.class); - private static final HBaseTestingUtility TEST_UTIL - = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL + = new HBaseTestingUtil(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java index e1bc83ca684..51a4aa0b89c 100644 --- a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java +++ b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/AsyncFSTestBase.java @@ -21,7 +21,7 @@ import java.io.File; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +30,7 @@ public abstract class AsyncFSTestBase { private static final Logger LOG = LoggerFactory.getLogger(AsyncFSTestBase.class); - protected static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + protected static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); protected static File CLUSTER_TEST_DIR; @@ -49,7 +49,7 @@ public abstract class AsyncFSTestBase { // Using randomUUID ensures that multiple clusters can be launched by // a same test, if it stops & starts them Path testDir = - UTIL.getDataTestDir("cluster_" + HBaseCommonTestingUtility.getRandomUUID().toString()); + UTIL.getDataTestDir("cluster_" + HBaseCommonTestingUtil.getRandomUUID().toString()); CLUSTER_TEST_DIR = new File(testDir.toString()).getAbsoluteFile(); // Have it cleaned up on exit boolean b = deleteOnExit(); diff --git a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestLocalAsyncOutput.java b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestLocalAsyncOutput.java index d2fdf172cbe..48c6a6799ca 100644 --- a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestLocalAsyncOutput.java +++ b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestLocalAsyncOutput.java @@ -22,7 +22,7 @@ import java.util.concurrent.ExecutionException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.CommonFSUtils; @@ -47,7 +47,7 @@ public class TestLocalAsyncOutput { private static Class CHANNEL_CLASS = NioSocketChannel.class; - private static final HBaseCommonTestingUtility TEST_UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil TEST_UTIL = new HBaseCommonTestingUtil(); @AfterClass public static void tearDownAfterClass() throws IOException { diff --git a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/security/HBaseKerberosUtils.java b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/security/HBaseKerberosUtils.java index 5d0b2ebfff3..a91c95ac4db 100644 --- a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/security/HBaseKerberosUtils.java +++ b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/security/HBaseKerberosUtils.java @@ -23,7 +23,7 @@ import java.net.InetAddress; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.hbase.AuthUtil; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.http.ssl.KeyStoreTestUtil; import org.apache.hadoop.hdfs.DFSConfigKeys; @@ -159,7 +159,7 @@ public final class HBaseKerberosUtils { * @param clazz the caller test class. * @throws Exception if unable to set up SSL configuration */ - public static void setSSLConfiguration(HBaseCommonTestingUtility utility, Class clazz) + public static void setSSLConfiguration(HBaseCommonTestingUtil utility, Class clazz) throws Exception { Configuration conf = utility.getConfiguration(); conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, HttpConfig.Policy.HTTPS_ONLY.name()); diff --git a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/util/TestRecoverLeaseFSUtils.java b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/util/TestRecoverLeaseFSUtils.java index 3931dfd5ba2..3c58d9c5c78 100644 --- a/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/util/TestRecoverLeaseFSUtils.java +++ b/hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/util/TestRecoverLeaseFSUtils.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hdfs.DistributedFileSystem; @@ -43,7 +43,7 @@ public class TestRecoverLeaseFSUtils { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRecoverLeaseFSUtils.class); - private static final HBaseCommonTestingUtility HTU = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil HTU = new HBaseCommonTestingUtil(); static { Configuration conf = HTU.getConfiguration(); conf.setInt("hbase.lease.recovery.first.pause", 10); diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupBase.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupBase.java index bacb2d4413d..80ffe55e112 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupBase.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupBase.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -78,8 +78,8 @@ import org.slf4j.LoggerFactory; public class TestBackupBase { private static final Logger LOG = LoggerFactory.getLogger(TestBackupBase.class); - protected static HBaseTestingUtility TEST_UTIL; - protected static HBaseTestingUtility TEST_UTIL2; + protected static HBaseTestingUtil TEST_UTIL; + protected static HBaseTestingUtil TEST_UTIL2; protected static Configuration conf1; protected static Configuration conf2; @@ -296,7 +296,7 @@ public class TestBackupBase { if (useSecondCluster) { conf2 = HBaseConfiguration.create(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - TEST_UTIL2 = new HBaseTestingUtility(conf2); + TEST_UTIL2 = new HBaseTestingUtil(conf2); TEST_UTIL2.setZkCluster(TEST_UTIL.getZkCluster()); TEST_UTIL2.startMiniDFSCluster(3); String root2 = TEST_UTIL2.getConfiguration().get("fs.defaultFS"); @@ -329,7 +329,7 @@ public class TestBackupBase { */ @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf1 = TEST_UTIL.getConfiguration(); autoRestoreOnFailure = true; useSecondCluster = false; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java index 04650330b7a..2ab6f55f5b0 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDeleteWithFailures.java @@ -27,7 +27,7 @@ import java.util.Optional; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.impl.BackupSystemTable; @@ -120,7 +120,7 @@ public class TestBackupDeleteWithFailures extends TestBackupBase{ */ @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf1 = TEST_UTIL.getConfiguration(); conf1.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, MasterSnapshotObserver.class.getName()); diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupHFileCleaner.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupHFileCleaner.java index 1680dc643d8..8393087477d 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupHFileCleaner.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupHFileCleaner.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.impl.BackupSystemTable; import org.apache.hadoop.hbase.client.Connection; @@ -56,7 +56,7 @@ public class TestBackupHFileCleaner { HBaseClassTestRule.forClass(TestBackupHFileCleaner.class); private static final Logger LOG = LoggerFactory.getLogger(TestBackupHFileCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static TableName tableName = TableName.valueOf("backup.hfile.cleaner"); private static String famName = "fam"; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupManager.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupManager.java index 625fbab0a8e..91bd185b872 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupManager.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupManager.java @@ -26,8 +26,8 @@ import java.util.concurrent.atomic.AtomicLongArray; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.backup.impl.BackupManager; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -53,9 +53,9 @@ public class TestBackupManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBackupManager.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static Configuration conf = UTIL.getConfiguration(); - protected static MiniHBaseCluster cluster; + protected static SingleProcessHBaseCluster cluster; protected static Connection conn; protected BackupManager backupManager; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java index 450cf2ff222..b01a136070a 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java @@ -38,8 +38,8 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.BackupInfo.BackupState; import org.apache.hadoop.hbase.backup.impl.BackupManager; @@ -66,9 +66,9 @@ public class TestBackupSystemTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBackupSystemTable.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static Configuration conf = UTIL.getConfiguration(); - protected static MiniHBaseCluster cluster; + protected static SingleProcessHBaseCluster cluster; protected static Connection conn; protected BackupSystemTable table; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java index 01481a0f65b..fddbec2e31e 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.backup.util.BackupUtils; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.security.UserGroupInformation; @@ -42,7 +42,7 @@ public class TestBackupUtils { HBaseClassTestRule.forClass(TestBackupUtils.class); private static final Logger LOG = LoggerFactory.getLogger(TestBackupUtils.class); - protected static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static Configuration conf = TEST_UTIL.getConfiguration(); @Test diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackup.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackup.java index 5ed40255424..ea552b7945a 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackup.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackup.java @@ -23,8 +23,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.impl.BackupAdminImpl; import org.apache.hadoop.hbase.backup.util.BackupUtils; @@ -103,7 +103,7 @@ public class TestIncrementalBackup extends TestBackupBase { // #2 - insert some data to table Table t1 = insertIntoTable(conn, table1, famName, 1, ADD_ROWS); LOG.debug("writing " + ADD_ROWS + " rows to " + table1); - Assert.assertEquals(HBaseTestingUtility.countRows(t1), + Assert.assertEquals(HBaseTestingUtil.countRows(t1), NB_ROWS_IN_BATCH + ADD_ROWS + NB_ROWS_FAM3); LOG.debug("written " + ADD_ROWS + " rows to " + table1); // additionally, insert rows to MOB cf @@ -111,7 +111,7 @@ public class TestIncrementalBackup extends TestBackupBase { insertIntoTable(conn, table1, mobName, 3, NB_ROWS_MOB); LOG.debug("written " + NB_ROWS_MOB + " rows to " + table1 + " to Mob enabled CF"); t1.close(); - Assert.assertEquals(HBaseTestingUtility.countRows(t1), + Assert.assertEquals(HBaseTestingUtil.countRows(t1), NB_ROWS_IN_BATCH + ADD_ROWS + NB_ROWS_MOB); Table t2 = conn.getTable(table2); Put p2; @@ -120,11 +120,11 @@ public class TestIncrementalBackup extends TestBackupBase { p2.addColumn(famName, qualName, Bytes.toBytes("val" + i)); t2.put(p2); } - Assert.assertEquals(NB_ROWS_IN_BATCH + 5, HBaseTestingUtility.countRows(t2)); + Assert.assertEquals(NB_ROWS_IN_BATCH + 5, HBaseTestingUtil.countRows(t2)); t2.close(); LOG.debug("written " + 5 + " rows to " + table2); // split table1 - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); List regions = cluster.getRegions(table1); byte[] name = regions.get(0).getRegionInfo().getRegionName(); long startSplitTime = EnvironmentEdgeManager.currentTime(); @@ -184,11 +184,11 @@ public class TestIncrementalBackup extends TestBackupBase { // #6.2 - checking row count of tables for full restore Table hTable = conn.getTable(table1_restore); - Assert.assertEquals(HBaseTestingUtility.countRows(hTable), NB_ROWS_IN_BATCH + NB_ROWS_FAM3); + Assert.assertEquals(HBaseTestingUtil.countRows(hTable), NB_ROWS_IN_BATCH + NB_ROWS_FAM3); hTable.close(); hTable = conn.getTable(table2_restore); - Assert.assertEquals(NB_ROWS_IN_BATCH, HBaseTestingUtility.countRows(hTable)); + Assert.assertEquals(NB_ROWS_IN_BATCH, HBaseTestingUtil.countRows(hTable)); hTable.close(); // #7 - restore incremental backup for multiple tables, with overwrite @@ -213,7 +213,7 @@ public class TestIncrementalBackup extends TestBackupBase { hTable.close(); hTable = conn.getTable(table2_restore); - Assert.assertEquals(NB_ROWS_IN_BATCH + 5, HBaseTestingUtility.countRows(hTable)); + Assert.assertEquals(NB_ROWS_IN_BATCH + 5, HBaseTestingUtil.countRows(hTable)); hTable.close(); admin.close(); } diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteBackup.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteBackup.java index 6db63495e09..4150d3fd2fc 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteBackup.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteBackup.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.util.BackupUtils; @@ -64,7 +64,7 @@ public class TestRemoteBackup extends TestBackupBase { */ @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf1 = TEST_UTIL.getConfiguration(); conf1.setInt(HConstants.REGION_SERVER_HANDLER_COUNT, 10); useSecondCluster = true; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteRestore.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteRestore.java index 9b08d2549cc..8dd4f792470 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteRestore.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestRemoteRestore.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.backup; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.util.BackupUtils; import org.apache.hadoop.hbase.client.Admin; @@ -48,7 +48,7 @@ public class TestRemoteRestore extends TestBackupBase { */ @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf1 = TEST_UTIL.getConfiguration(); useSecondCluster = true; setUpHelper(); diff --git a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/LoadBalancerPerformanceEvaluation.java b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/LoadBalancerPerformanceEvaluation.java index 1dd092dea28..59433137f65 100644 --- a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/LoadBalancerPerformanceEvaluation.java +++ b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/LoadBalancerPerformanceEvaluation.java @@ -25,8 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; @@ -57,7 +56,7 @@ public class LoadBalancerPerformanceEvaluation extends AbstractHBaseTool { private static final Logger LOG = LoggerFactory.getLogger(LoadBalancerPerformanceEvaluation.class.getName()); - protected static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + protected static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); private static final int DEFAULT_NUM_REGIONS = 1000000; private static Option NUM_REGIONS_OPT = new Option("regions", true, diff --git a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCost.java b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCost.java index cee76dba060..04e852813fc 100644 --- a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCost.java +++ b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCost.java @@ -35,7 +35,7 @@ import java.util.TreeMap; import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -61,7 +61,7 @@ public class TestStochasticLoadBalancerHeterogeneousCost extends StochasticBalan private static final Logger LOG = LoggerFactory.getLogger(TestStochasticLoadBalancerHeterogeneousCost.class); private static final double ALLOWED_WINDOW = 1.20; - private static final HBaseCommonTestingUtility HTU = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil HTU = new HBaseCommonTestingUtil(); private static String RULES_FILE; @BeforeClass diff --git a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRules.java b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRules.java index b7c66ba9be4..11e3f650ea4 100644 --- a/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRules.java +++ b/hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRules.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.Before; @@ -47,7 +47,7 @@ public class TestStochasticLoadBalancerHeterogeneousCostRules extends Stochastic public TestName name = new TestName(); private HeterogeneousRegionCountCostFunction costFunction; - private static final HBaseCommonTestingUtility HTU = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil HTU = new HBaseCommonTestingUtil(); /** * Make a file for rules that is inside a temporary test dir named for the method so it doesn't diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistryHedgedReads.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistryHedgedReads.java index 40a38c706a1..d1cd05c1657 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistryHedgedReads.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistryHedgedReads.java @@ -32,7 +32,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.ipc.RpcClient; @@ -69,7 +69,7 @@ public class TestMasterRegistryHedgedReads { private static final Logger LOG = LoggerFactory.getLogger(TestMasterRegistryHedgedReads.class); - private static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setDaemon(true).build()); diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestKeyOnlyFilter.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestKeyOnlyFilter.java index 3e03a0796a5..df63523b24c 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestKeyOnlyFilter.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/filter/TestKeyOnlyFilter.java @@ -25,7 +25,7 @@ import java.util.Collection; import org.apache.hadoop.hbase.ByteBufferKeyValue; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.KeyValueUtil; @@ -54,7 +54,7 @@ public class TestKeyOnlyFilter { @Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } @Test diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtil.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtil.java new file mode 100644 index 00000000000..f78e9de9a38 --- /dev/null +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtil.java @@ -0,0 +1,346 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import java.io.File; +import java.io.IOException; +import java.net.ServerSocket; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; +import org.apache.commons.io.FileUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.Waiter.Predicate; +import org.apache.hadoop.hbase.io.compress.Compression; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Common helpers for testing HBase that do not depend on specific server/etc. things. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public class HBaseCommonTestingUtil { + protected static final Logger LOG = LoggerFactory.getLogger(HBaseCommonTestingUtil.class); + + /** + * Compression algorithms to use in parameterized JUnit 4 tests + */ + public static final List COMPRESSION_ALGORITHMS_PARAMETERIZED = + Arrays.asList(new Object[][] { + { Compression.Algorithm.NONE }, + { Compression.Algorithm.GZ } + }); + + /** + * This is for unit tests parameterized with a two booleans. + */ + public static final List BOOLEAN_PARAMETERIZED = + Arrays.asList(new Object[][] { + {false}, + {true} + }); + + /** + * Compression algorithms to use in testing + */ + public static final Compression.Algorithm[] COMPRESSION_ALGORITHMS = { + Compression.Algorithm.NONE, Compression.Algorithm.GZ + }; + + protected final Configuration conf; + + public HBaseCommonTestingUtil() { + this(null); + } + + public HBaseCommonTestingUtil(Configuration conf) { + this.conf = (conf == null ? HBaseConfiguration.create() : conf); + } + + /** + * Returns this classes's instance of {@link Configuration}. + * + * @return Instance of Configuration. + */ + public Configuration getConfiguration() { + return this.conf; + } + + /** + * System property key to get base test directory value + */ + public static final String BASE_TEST_DIRECTORY_KEY = + "test.build.data.basedirectory"; + + /** + * Default base directory for test output. + */ + public static final String DEFAULT_BASE_TEST_DIRECTORY = "target/test-data"; + + /** + * Directory where we put the data for this instance of HBaseTestingUtility + */ + private File dataTestDir = null; + + /** + * Returns Where to write test data on local filesystem, specific to the test. Useful for tests + * that do not use a cluster. Creates it if it does not exist already. + */ + public Path getDataTestDir() { + if (this.dataTestDir == null) { + setupDataTestDir(); + } + return new Path(this.dataTestDir.getAbsolutePath()); + } + + /** + * Returns the path to a subdirectory or file named {code subdirName} under + * {@link #getDataTestDir()}. Does *NOT* create the directory or file if it does not exist. + * @param name the name of a subdirectory or file in the test data directory + */ + public Path getDataTestDir(final String name) { + return new Path(getDataTestDir(), name); + } + + /** + * Sets up a directory for a test to use. + * + * @return New directory path, if created. + */ + protected Path setupDataTestDir() { + if (this.dataTestDir != null) { + LOG.warn("Data test dir already setup in " + + dataTestDir.getAbsolutePath()); + return null; + } + Path testPath = getRandomDir(); + this.dataTestDir = new File(testPath.toString()).getAbsoluteFile(); + // Set this property so if mapreduce jobs run, they will use this as their home dir. + System.setProperty("test.build.dir", this.dataTestDir.toString()); + + if (deleteOnExit()) { + this.dataTestDir.deleteOnExit(); + } + + createSubDir("hbase.local.dir", testPath, "hbase-local-dir"); + + return testPath; + } + + /** + * Returns A dir with a random (uuid) name under the test dir + * @see #getBaseTestDir() + */ + public Path getRandomDir() { + return new Path(getBaseTestDir(), getRandomUUID().toString()); + } + + public static UUID getRandomUUID() { + return new UUID(ThreadLocalRandom.current().nextLong(), + ThreadLocalRandom.current().nextLong()); + } + + protected void createSubDir(String propertyName, Path parent, String subDirName) { + Path newPath = new Path(parent, subDirName); + File newDir = new File(newPath.toString()).getAbsoluteFile(); + + if (deleteOnExit()) { + newDir.deleteOnExit(); + } + + conf.set(propertyName, newDir.getAbsolutePath()); + } + + /** + * Returns true if we should delete testing dirs on exit. + */ + boolean deleteOnExit() { + String v = System.getProperty("hbase.testing.preserve.testdir"); + // Let default be true, to delete on exit. + return v == null ? true : !Boolean.parseBoolean(v); + } + + /** + * Returns true if we removed the test dirs + */ + public boolean cleanupTestDir() { + if (deleteDir(this.dataTestDir)) { + this.dataTestDir = null; + return true; + } + return false; + } + + /** + * Returns true if we removed the test dir + * @param subdir Test subdir name. + */ + public boolean cleanupTestDir(final String subdir) { + if (this.dataTestDir == null) { + return false; + } + return deleteDir(new File(this.dataTestDir, subdir)); + } + + /** + * Returns Where to write test data on local filesystem; usually + * {@link #DEFAULT_BASE_TEST_DIRECTORY} Should not be used by the unit tests, hence its's private. + * Unit test will use a subdirectory of this directory. + * @see #setupDataTestDir() + */ + private Path getBaseTestDir() { + String PathName = System.getProperty( + BASE_TEST_DIRECTORY_KEY, DEFAULT_BASE_TEST_DIRECTORY); + + return new Path(PathName); + } + + /** + * Returns true if we deleted it. + * @param dir Directory to delete + */ + boolean deleteDir(final File dir) { + if (dir == null || !dir.exists()) { + return true; + } + int ntries = 0; + do { + ntries += 1; + try { + if (deleteOnExit()) { + FileUtils.deleteDirectory(dir); + } + + return true; + } catch (IOException ex) { + LOG.warn("Failed to delete " + dir.getAbsolutePath()); + } catch (IllegalArgumentException ex) { + LOG.warn("Failed to delete " + dir.getAbsolutePath(), ex); + } + } while (ntries < 30); + + return false; + } + + /** + * Wrapper method for {@link Waiter#waitFor(Configuration, long, Predicate)}. + */ + public long waitFor(long timeout, Predicate predicate) + throws E { + return Waiter.waitFor(this.conf, timeout, predicate); + } + + /** + * Wrapper method for {@link Waiter#waitFor(Configuration, long, long, Predicate)}. + */ + public long waitFor(long timeout, long interval, Predicate predicate) + throws E { + return Waiter.waitFor(this.conf, timeout, interval, predicate); + } + + /** + * Wrapper method for {@link Waiter#waitFor(Configuration, long, long, boolean, Predicate)}. + */ + public long waitFor(long timeout, long interval, + boolean failIfTimeout, Predicate predicate) throws E { + return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate); + } + + // Support for Random Port Generation. + static Random random = new Random(); + + private static final PortAllocator portAllocator = new PortAllocator(random); + + public static int randomFreePort() { + return portAllocator.randomFreePort(); + } + + static class PortAllocator { + private static final int MIN_RANDOM_PORT = 0xc000; + private static final int MAX_RANDOM_PORT = 0xfffe; + + /** A set of ports that have been claimed using {@link #randomFreePort()}. */ + private final Set takenRandomPorts = new HashSet<>(); + + private final Random random; + private final AvailablePortChecker portChecker; + + public PortAllocator(Random random) { + this.random = random; + this.portChecker = new AvailablePortChecker() { + @Override + public boolean available(int port) { + try { + ServerSocket sock = new ServerSocket(port); + sock.close(); + return true; + } catch (IOException ex) { + return false; + } + } + }; + } + + public PortAllocator(Random random, AvailablePortChecker portChecker) { + this.random = random; + this.portChecker = portChecker; + } + + /** + * Returns a random free port and marks that port as taken. Not thread-safe. Expected to be + * called from single-threaded test setup code/ + */ + public int randomFreePort() { + int port = 0; + do { + port = randomPort(); + if (takenRandomPorts.contains(port)) { + port = 0; + continue; + } + takenRandomPorts.add(port); + + if (!portChecker.available(port)) { + port = 0; + } + } while (port == 0); + return port; + } + + /** + * Returns a random port. These ports cannot be registered with IANA and are + * intended for dynamic allocation (see http://bit.ly/dynports). + */ + private int randomPort() { + return MIN_RANDOM_PORT + + random.nextInt(MAX_RANDOM_PORT - MIN_RANDOM_PORT); + } + + interface AvailablePortChecker { + boolean available(int port); + } + } +} diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java index cf97e313cf0..111056a4fa3 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java @@ -60,7 +60,7 @@ public class TestClassFinder { private static final Logger LOG = LoggerFactory.getLogger(TestClassFinder.class); @Rule public TestName name = new TestName(); - private static final HBaseCommonTestingUtility testUtil = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil testUtil = new HBaseCommonTestingUtil(); private static final String BASEPKG = "tfcpkg"; private static final String PREFIX = "Prefix"; diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java index 3f0f3462e02..006aa4fa3ca 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java @@ -48,7 +48,7 @@ public class TestHBaseConfiguration { private static final Logger LOG = LoggerFactory.getLogger(TestHBaseConfiguration.class); - private static HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); @AfterClass public static void tearDown() throws IOException { diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/TestKeyStoreKeyProvider.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/TestKeyStoreKeyProvider.java index 0b22caaec51..9eaecefc74c 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/TestKeyStoreKeyProvider.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/TestKeyStoreKeyProvider.java @@ -29,7 +29,7 @@ import java.security.MessageDigest; import java.util.Properties; import javax.crypto.spec.SecretKeySpec; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; @@ -48,7 +48,7 @@ public class TestKeyStoreKeyProvider { HBaseClassTestRule.forClass(TestKeyStoreKeyProvider.class); private static final Logger LOG = LoggerFactory.getLogger(TestKeyStoreKeyProvider.class); - static final HBaseCommonTestingUtility TEST_UTIL = new HBaseCommonTestingUtility(); + static final HBaseCommonTestingUtil TEST_UTIL = new HBaseCommonTestingUtil(); static final String ALIAS = "test"; static final String PASSWORD = "password"; diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestByteBufferUtils.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestByteBufferUtils.java index 778828bcff5..4777ee61b5e 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestByteBufferUtils.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestByteBufferUtils.java @@ -44,7 +44,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; @@ -76,7 +76,7 @@ public class TestByteBufferUtils { @Parameterized.Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } private static void setUnsafe(String fieldName, boolean value) throws Exception { diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCommonFSUtils.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCommonFSUtils.java index 7d433c02bca..d3c1d25844b 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCommonFSUtils.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCommonFSUtils.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -46,12 +46,12 @@ public class TestCommonFSUtils { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCommonFSUtils.class); - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private Configuration conf; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); conf = htu.getConfiguration(); } diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java index cf90ff38a80..a3b3be1ef51 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java @@ -29,7 +29,7 @@ import java.io.FileOutputStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.io.IOUtils; @@ -46,7 +46,7 @@ public class TestCoprocessorClassLoader { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCoprocessorClassLoader.class); - private static final HBaseCommonTestingUtility TEST_UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil TEST_UTIL = new HBaseCommonTestingUtil(); private static final Configuration conf = TEST_UTIL.getConfiguration(); static { TEST_UTIL.getDataTestDir(); // prepare data test dir and hbase local dir diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestDynamicClassLoader.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestDynamicClassLoader.java index b85921588f9..2eeb4faf0b8 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestDynamicClassLoader.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestDynamicClassLoader.java @@ -23,7 +23,7 @@ import static org.junit.Assert.fail; import java.io.File; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Before; @@ -45,7 +45,7 @@ public class TestDynamicClassLoader { private static final Logger LOG = LoggerFactory.getLogger(TestDynamicClassLoader.class); - private static final HBaseCommonTestingUtility TEST_UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil TEST_UTIL = new HBaseCommonTestingUtil(); private Configuration conf; static { diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestSimpleKdcServerUtil.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestSimpleKdcServerUtil.java index 1ebe82f5722..2178459b5b2 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestSimpleKdcServerUtil.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestSimpleKdcServerUtil.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.util; import java.io.File; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.kerby.kerberos.kerb.KrbException; @@ -34,7 +34,7 @@ public class TestSimpleKdcServerUtil { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSimpleKdcServerUtil.class); - private static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); /** * Test we are able to ride over clashing port... BindException.. when starting up a @@ -46,7 +46,7 @@ public class TestSimpleKdcServerUtil { try { File dir = new File(UTIL.getDataTestDir().toString()); kdc = SimpleKdcServerUtil. - getRunningSimpleKdcServer(dir, HBaseCommonTestingUtility::randomFreePort, true); + getRunningSimpleKdcServer(dir, HBaseCommonTestingUtil::randomFreePort, true); kdc.createPrincipal("wah"); } finally { kdc.stop(); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAggregationClient.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAggregationClient.java index d50ceb9c1c3..e2f03604340 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAggregationClient.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAggregationClient.java @@ -24,7 +24,7 @@ import java.util.stream.Collectors; import java.util.stream.LongStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.coprocessor.AsyncAggregationClient; import org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter; @@ -46,7 +46,7 @@ public class TestAsyncAggregationClient { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncAggregationClient.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("TestAsyncAggregationClient"); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java index 80a3766f094..587fd70753f 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/client/TestRpcControllerFactory.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.client; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellScannable; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Scan.ReadType; @@ -99,7 +99,7 @@ public class TestRpcControllerFactory { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java index caf4e340fc8..67e4ff1bb29 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.TreeMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -80,7 +80,7 @@ public class TestBatchCoprocessorEndpoint { private static final int rowSeperator2 = 12; private static byte[][] ROWS = makeN(ROW, ROWSIZE); - private static HBaseTestingUtility util = new HBaseTestingUtility(); + private static HBaseTestingUtil util = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java index 0fa3b746482..705bf626f5e 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java @@ -37,11 +37,11 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.RegionMetrics; import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -76,7 +76,7 @@ public class TestClassLoading { HBaseClassTestRule.forClass(TestClassLoading.class); private static final Logger LOG = LoggerFactory.getLogger(TestClassLoading.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); public static class TestMasterCoprocessor implements MasterCoprocessor, MasterObserver { @Override @@ -199,7 +199,7 @@ public class TestClassLoading { boolean foundTableRegion=false; boolean found1 = true, found2 = true, found2_k1 = true, found2_k2 = true, found2_k3 = true; Map> regionsActiveClassLoaders = new HashMap<>(); - MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); for (HRegion region: hbase.getRegionServer(0).getOnlineRegionsLocalContext()) { if (region.getRegionInfo().getRegionNameAsString().startsWith(tableName.getNameAsString())) { @@ -272,7 +272,7 @@ public class TestClassLoading { // verify that the coprocessor was loaded boolean found = false; - MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); for (HRegion region: hbase.getRegionServer(0).getOnlineRegionsLocalContext()) { if (region.getRegionInfo().getRegionNameAsString().startsWith(cpName3)) { found = (region.getCoprocessorHost().findCoprocessor(cpName3) != null); @@ -299,7 +299,7 @@ public class TestClassLoading { // verify that the coprocessor was loaded correctly boolean found = false; - MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); for (HRegion region: hbase.getRegionServer(0).getOnlineRegionsLocalContext()) { if (region.getRegionInfo().getRegionNameAsString().startsWith(cpName4)) { Coprocessor cp = region.getCoprocessorHost().findCoprocessor(cpName4); @@ -384,7 +384,7 @@ public class TestClassLoading { boolean found6_k1 = false, found6_k2 = false, found6_k3 = false, found6_k4 = false; - MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); for (HRegion region: hbase.getRegionServer(0).getOnlineRegionsLocalContext()) { if (region.getRegionInfo().getRegionNameAsString().startsWith(tableName.getNameAsString())) { found_1 = found_1 || @@ -475,7 +475,7 @@ public class TestClassLoading { // verify that the coprocessors were loaded boolean found1 = false, found2 = false, found2_k1 = false, found2_k2 = false, found2_k3 = false; - MiniHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbase = TEST_UTIL.getHBaseCluster(); for (HRegion region: hbase.getRegionServer(0).getOnlineRegionsLocalContext()) { if (region.getRegionInfo().getRegionNameAsString().startsWith(tableName.getNameAsString())) { CoprocessorEnvironment env; diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java index a0b100ffaca..d6d0d4ce43d 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.TreeMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; @@ -87,7 +87,7 @@ public class TestCoprocessorEndpoint { private static final int rowSeperator2 = 12; private static byte[][] ROWS = makeN(ROW, ROWSIZE); - private static HBaseTestingUtility util = new HBaseTestingUtility(); + private static HBaseTestingUtil util = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java index 9704404e283..5a0827c2d75 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorTableEndpoint.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Map; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -62,7 +62,7 @@ public class TestCoprocessorTableEndpoint { private static final int rowSeperator2 = 12; private static final byte[][] ROWS = makeN(ROW, ROWSIZE); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java index 14e663a4a98..81b14b949be 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorEndpoint.java @@ -24,7 +24,7 @@ import java.io.FileNotFoundException; import java.util.Collections; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils; import org.apache.hadoop.hbase.ipc.ServerRpcController; @@ -54,13 +54,13 @@ public class TestRegionServerCoprocessorEndpoint { HBaseClassTestRule.forClass(TestRegionServerCoprocessorEndpoint.class); public static final FileNotFoundException WHAT_TO_THROW = new FileNotFoundException("/file.txt"); - private static HBaseTestingUtility TEST_UTIL = null; + private static HBaseTestingUtil TEST_UTIL = null; private static Configuration CONF = null; private static final String DUMMY_VALUE = "val"; @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); CONF = TEST_UTIL.getConfiguration(); CONF.setStrings(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, DummyRegionServerEndpoint.class.getName()); diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestSecureExport.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestSecureExport.java index ee52433f0e8..a13cb5b5bf2 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestSecureExport.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestSecureExport.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsAction; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Connection; @@ -91,7 +91,7 @@ public class TestSecureExport { HBaseClassTestRule.forClass(TestSecureExport.class); private static final Logger LOG = LoggerFactory.getLogger(TestSecureExport.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static MiniKdc KDC; private static final File KEYTAB_FILE = new File(UTIL.getDataTestDir("keytab").toUri().getPath()); private static String USERNAME; diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java index 22d3f13ecdd..fca20757093 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java @@ -26,7 +26,7 @@ import java.util.Collections; import java.util.Map; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; @@ -150,7 +150,7 @@ public class TestServerCustomProtocol { private static final byte[] ROW_AB = Bytes.toBytes("abb"); private static final byte[] ROW_BC = Bytes.toBytes("bcc"); - private static HBaseTestingUtility util = new HBaseTestingUtility(); + private static HBaseTestingUtil util = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestAsyncClientExample.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestAsyncClientExample.java index bee18ddd7e7..02564496f00 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestAsyncClientExample.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestAsyncClientExample.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client.example; import static org.junit.Assert.assertEquals; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -39,7 +39,7 @@ public class TestAsyncClientExample { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncClientExample.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestHttpProxyExample.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestHttpProxyExample.java index 531f818853a..d7925ef82cb 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestHttpProxyExample.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/client/example/TestHttpProxyExample.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -49,7 +49,7 @@ public class TestHttpProxyExample { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHttpProxyExample.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRefreshHFilesBase.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRefreshHFilesBase.java index e8cab7780a1..f56d514cdd3 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRefreshHFilesBase.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestRefreshHFilesBase.java @@ -20,9 +20,9 @@ package org.apache.hadoop.hbase.coprocessor.example; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; public class TestRefreshHFilesBase { protected static final Logger LOG = LoggerFactory.getLogger(TestRefreshHFilesBase.class); - protected static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + protected static final HBaseTestingUtil HTU = new HBaseTestingUtil(); protected static final int NUM_RS = 2; protected static final TableName TABLE_NAME = TableName.valueOf("testRefreshRegionHFilesEP"); protected static final byte[] FAMILY = Bytes.toBytes("family"); @@ -47,7 +47,7 @@ public class TestRefreshHFilesBase { protected static final String HFILE_NAME = "123abcdef"; protected static Configuration CONF = HTU.getConfiguration(); - protected static MiniHBaseCluster cluster; + protected static SingleProcessHBaseCluster cluster; protected static Table table; public static void setUp(String regionImpl) { diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestScanModifyingObserver.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestScanModifyingObserver.java index 76d9cb9da61..8938724b1ce 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestScanModifyingObserver.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestScanModifyingObserver.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -52,7 +52,7 @@ public class TestScanModifyingObserver { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScanModifyingObserver.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME = TableName.valueOf("TestScanModifications"); private static final byte[] FAMILY = Bytes.toBytes("f"); private static final ColumnFamilyDescriptor CFD = ColumnFamilyDescriptorBuilder diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestValueReplacingCompaction.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestValueReplacingCompaction.java index 6974c2051ae..872b476372e 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestValueReplacingCompaction.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestValueReplacingCompaction.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -52,7 +52,7 @@ public class TestValueReplacingCompaction { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestValueReplacingCompaction.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME = TableName.valueOf("TestValueReplacement"); private static final byte[] FAMILY = Bytes.toBytes("f"); private static final byte[] QUALIFIER = Bytes.toBytes("q"); diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestZooKeeperScanPolicyObserver.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestZooKeeperScanPolicyObserver.java index 5705c99f415..238eb0ad0e9 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestZooKeeperScanPolicyObserver.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestZooKeeperScanPolicyObserver.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertFalse; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Get; @@ -50,7 +50,7 @@ public class TestZooKeeperScanPolicyObserver { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestZooKeeperScanPolicyObserver.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("TestCP"); diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserverTestBase.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserverTestBase.java index f9a5b5b5453..3966adc0c14 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserverTestBase.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/WriteHeavyIncrementObserverTestBase.java @@ -22,8 +22,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import java.io.UncheckedIOException; import java.util.stream.IntStream; - -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; @@ -37,7 +36,7 @@ import org.junit.BeforeClass; public class WriteHeavyIncrementObserverTestBase { - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static TableName NAME = TableName.valueOf("TestCP"); diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMapReduceExamples.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMapReduceExamples.java index 43dba2c0928..616cb2fbf2b 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMapReduceExamples.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMapReduceExamples.java @@ -30,7 +30,7 @@ import java.io.PrintStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; @@ -58,7 +58,7 @@ public class TestMapReduceExamples { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMapReduceExamples.class); - private static HBaseTestingUtility util = new HBaseTestingUtility(); + private static HBaseTestingUtil util = new HBaseTestingUtil(); /** * Test SampleUploader from examples diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/security/provider/example/TestShadeSaslAuthenticationProvider.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/security/provider/example/TestShadeSaslAuthenticationProvider.java index 05a80712637..34cdf6545dd 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/security/provider/example/TestShadeSaslAuthenticationProvider.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/security/provider/example/TestShadeSaslAuthenticationProvider.java @@ -42,7 +42,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.TableName; @@ -96,7 +96,7 @@ public class TestShadeSaslAuthenticationProvider { private static final char[] USER1_PASSWORD = "foobarbaz".toCharArray(); - static LocalHBaseCluster createCluster(HBaseTestingUtility util, File keytabFile, + static LocalHBaseCluster createCluster(HBaseTestingUtil util, File keytabFile, MiniKdc kdc, Map userDatabase) throws Exception { String servicePrincipal = "hbase/localhost"; String spnegoPrincipal = "HTTP/localhost"; @@ -140,7 +140,7 @@ public class TestShadeSaslAuthenticationProvider { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration CONF = UTIL.getConfiguration(); private static LocalHBaseCluster CLUSTER; private static File KEYTAB_FILE; diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestProxyUserSpnegoHttpServer.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestProxyUserSpnegoHttpServer.java index ed98a2f5a7f..e4ecaedaa3e 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestProxyUserSpnegoHttpServer.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestProxyUserSpnegoHttpServer.java @@ -29,7 +29,7 @@ import javax.security.auth.kerberos.KerberosTicket; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.http.TestHttpServer.EchoServlet; import org.apache.hadoop.hbase.http.resource.JerseyResource; import org.apache.hadoop.hbase.testclassification.MiscTests; @@ -98,12 +98,12 @@ public class TestProxyUserSpnegoHttpServer extends HttpServerFunctionalTest { @BeforeClass public static void setupServer() throws Exception { Configuration conf = new Configuration(); - HBaseCommonTestingUtility htu = new HBaseCommonTestingUtility(conf); + HBaseCommonTestingUtil htu = new HBaseCommonTestingUtil(conf); final String serverPrincipal = "HTTP/" + KDC_SERVER_HOST; kdc = SimpleKdcServerUtil.getRunningSimpleKdcServer(new File(htu.getDataTestDir().toString()), - HBaseCommonTestingUtility::randomFreePort); + HBaseCommonTestingUtil::randomFreePort); File keytabDir = new File(htu.getDataTestDir("keytabs").toString()); if (keytabDir.exists()) { deleteRecursively(keytabDir); diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java index 91540c5f6c8..7a314ac35e3 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java @@ -26,7 +26,7 @@ import javax.net.ssl.HttpsURLConnection; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.http.ssl.KeyStoreTestUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -64,12 +64,12 @@ public class TestSSLHttpServer extends HttpServerFunctionalTest { private static File keystoresDir; private static String sslConfDir; private static SSLFactory clientSslFactory; - private static HBaseCommonTestingUtility HTU; + private static HBaseCommonTestingUtil HTU; @BeforeClass public static void setup() throws Exception { - HTU = new HBaseCommonTestingUtility(); + HTU = new HBaseCommonTestingUtil(); serverConf = HTU.getConfiguration(); serverConf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS); diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java index 28e4fcf093b..eb339430001 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java @@ -28,7 +28,7 @@ import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.http.TestHttpServer.EchoServlet; import org.apache.hadoop.hbase.http.resource.JerseyResource; import org.apache.hadoop.hbase.testclassification.MiscTests; @@ -88,12 +88,12 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest { @BeforeClass public static void setupServer() throws Exception { Configuration conf = new Configuration(); - HBaseCommonTestingUtility htu = new HBaseCommonTestingUtility(conf); + HBaseCommonTestingUtil htu = new HBaseCommonTestingUtil(conf); final String serverPrincipal = "HTTP/" + KDC_SERVER_HOST; kdc = SimpleKdcServerUtil.getRunningSimpleKdcServer(new File(htu.getDataTestDir().toString()), - HBaseCommonTestingUtility::randomFreePort); + HBaseCommonTestingUtil::randomFreePort); File keytabDir = new File(htu.getDataTestDir("keytabs").toString()); if (keytabDir.exists()) { deleteRecursively(keytabDir); diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java index 4b8bb6b11b5..421cbbde693 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java @@ -37,7 +37,7 @@ import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.CommonConfigurationKeysPublic; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.http.HttpConfig; import org.apache.hadoop.hbase.http.HttpServer; import org.apache.hadoop.hbase.http.log.LogLevel.CLI; @@ -83,13 +83,13 @@ public class TestLogLevel { private static final String LOCALHOST = "localhost"; private static final String clientPrincipal = "client/" + LOCALHOST; private static String HTTP_PRINCIPAL = "HTTP/" + LOCALHOST; - private static HBaseCommonTestingUtility HTU; + private static HBaseCommonTestingUtil HTU; private static File keyTabFile; @BeforeClass public static void setUp() throws Exception { serverConf = new Configuration(); - HTU = new HBaseCommonTestingUtility(serverConf); + HTU = new HBaseCommonTestingUtil(serverConf); File keystoreDir = new File(HTU.getDataTestDir("keystore").toString()); keystoreDir.mkdirs(); diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/ssl/KeyStoreTestUtil.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/ssl/KeyStoreTestUtil.java index c201c7a5232..e09f64204a6 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/ssl/KeyStoreTestUtil.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/ssl/KeyStoreTestUtil.java @@ -43,7 +43,7 @@ import java.util.HashMap; import java.util.Map; import javax.security.auth.x500.X500Principal; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory; import org.apache.hadoop.security.ssl.SSLFactory; import org.bouncycastle.x509.X509V1CertificateGenerator; @@ -281,10 +281,10 @@ public final class KeyStoreTestUtil { String trustPassword = "trustP"; File sslClientConfFile = new File( - sslConfDir + "/ssl-client-" + System.nanoTime() + "-" + HBaseCommonTestingUtility + sslConfDir + "/ssl-client-" + System.nanoTime() + "-" + HBaseCommonTestingUtil .getRandomUUID() + ".xml"); File sslServerConfFile = new File( - sslConfDir + "/ssl-server-" + System.nanoTime() + "-" + HBaseCommonTestingUtility + sslConfDir + "/ssl-server-" + System.nanoTime() + "-" + HBaseCommonTestingUtil .getRandomUUID() + ".xml"); Map certs = new HashMap<>(); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java index d4fa6ed19a1..9fb7db9666c 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java @@ -37,13 +37,18 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.Threads; import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** - * Manages the interactions with an already deployed distributed cluster (as opposed to - * a pseudo-distributed, or mini/local cluster). This is used by integration and system tests. + * Manages the interactions with an already deployed distributed cluster (as opposed to a + * pseudo-distributed, or mini/local cluster). This is used by integration and system tests. */ @InterfaceAudience.Private -public class DistributedHBaseCluster extends HBaseCluster { +public class DistributedHBaseCluster extends HBaseClusterInterface { + + private static final Logger LOG = LoggerFactory.getLogger(DistributedHBaseCluster.class); + private Admin admin; private final Connection connection; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java index e399d815717..f57b9b6ab58 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java @@ -217,7 +217,7 @@ public class IntegrationTestBackupRestore extends IntegrationTestBase { LOG.info("Creating table {} with {} splits.", tableName, regionsCountPerServer * regionServerCount); startTime = EnvironmentEdgeManager.currentTime(); - HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), desc, columns, + HBaseTestingUtil.createPreSplitLoadTestTable(util.getConfiguration(), desc, columns, regionsCountPerServer); util.waitTableAvailable(tableName); endTime = EnvironmentEdgeManager.currentTime(); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java index 61d0e7e4f22..b2d90f11bd5 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java @@ -114,7 +114,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { protected static final int DEFAULT_NUM_REGIONS = 50; // number of regions in pre-split tables private boolean keepObjectsAtTheEnd = false; - protected HBaseCluster cluster; + protected HBaseClusterInterface cluster; protected Connection connection; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java index c5bdc51de2e..6f440f5691e 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngest.java @@ -64,7 +64,7 @@ public class IntegrationTestIngest extends IntegrationTestBase { // Log is being used in IntegrationTestIngestWithEncryption, hence it is protected protected static final Logger LOG = LoggerFactory.getLogger(IntegrationTestIngest.class); protected IntegrationTestingUtility util; - protected HBaseCluster cluster; + protected HBaseClusterInterface cluster; protected LoadTestTool loadTool; protected String[] LOAD_TEST_TOOL_INIT_ARGS = { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestStripeCompactions.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestStripeCompactions.java index 0d511c9e895..461067880e6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestStripeCompactions.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestStripeCompactions.java @@ -46,7 +46,7 @@ public class IntegrationTestIngestStripeCompactions extends IntegrationTestInges .setValue(HStore.BLOCKING_STOREFILES_KEY, "100").build(); ColumnFamilyDescriptor familyDescriptor = ColumnFamilyDescriptorBuilder.of(HFileTestUtil.DEFAULT_COLUMN_FAMILY); - HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), + HBaseTestingUtil.createPreSplitLoadTestTable(util.getConfiguration(), tableDescriptor, familyDescriptor); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMetaReplicas.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMetaReplicas.java index 05e203607f5..b76145a355d 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMetaReplicas.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMetaReplicas.java @@ -57,7 +57,7 @@ public class IntegrationTestMetaReplicas { StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, 1000); // Make sure there are three servers. util.initializeCluster(3); - HBaseTestingUtility.setReplicas(util.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(util.getAdmin(), TableName.META_TABLE_NAME, 3); ZKWatcher zkw = util.getZooKeeperWatcher(); Configuration conf = util.getConfiguration(); String baseZNode = conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT, diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java index 43749d11b3f..8c431768bdb 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java @@ -23,7 +23,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.ReflectionUtils; /** - * Facility for integration/system tests. This extends {@link HBaseTestingUtility} + * Facility for integration/system tests. This extends {@link HBaseTestingUtil} * and adds-in the functionality needed by integration and system tests. This class understands * distributed and pseudo-distributed/local cluster deployments, and abstracts those from the tests * in this module. @@ -39,7 +39,7 @@ import org.apache.hadoop.util.ReflectionUtils; * via {@link #initializeCluster(int)}. Individual tests should not directly call * {@link #setUseDistributedCluster(Configuration)}. */ -public class IntegrationTestingUtility extends HBaseTestingUtility { +public class IntegrationTestingUtility extends HBaseTestingUtil { public IntegrationTestingUtility() { this(HBaseConfiguration.create()); @@ -84,7 +84,7 @@ public class IntegrationTestingUtility extends HBaseTestingUtility { * exception otherwise. */ public void checkNodeCount(int numSlaves) throws Exception { - HBaseCluster cluster = getHBaseClusterInterface(); + HBaseClusterInterface cluster = getHBaseClusterInterface(); if (cluster.getClusterMetrics().getLiveServerMetrics().size() < numSlaves) { throw new Exception("Cluster does not have enough nodes:" + numSlaves); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java index 5eaa096f6cb..22c71c5143a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java @@ -296,7 +296,7 @@ public class StripeCompactionsPerformanceEvaluation extends AbstractHBaseTool { private void createTable(TableDescriptorBuilder builder) throws Exception { deleteTable(); - if (util.getHBaseClusterInterface() instanceof MiniHBaseCluster) { + if (util.getHBaseClusterInterface() instanceof SingleProcessHBaseCluster) { LOG.warn("Test does not make a lot of sense for minicluster. Will set flush size low."); builder.setValue(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, "1048576"); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/TestRESTApiClusterManager.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/TestRESTApiClusterManager.java index 4081e47122f..d7c18f1e747 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/TestRESTApiClusterManager.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/TestRESTApiClusterManager.java @@ -46,12 +46,12 @@ public class TestRESTApiClusterManager { @Rule public final TestName testName = new TestName(); - private static HBaseCommonTestingUtility testingUtility; + private static HBaseCommonTestingUtil testingUtility; private ClusterManager clusterManager; @BeforeClass public static void beforeClass() { - testingUtility = new HBaseCommonTestingUtility(); + testingUtility = new HBaseCommonTestingUtil(); configureClusterManager(testingUtility.getConfiguration()); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/TestShellExecEndpointCoprocessor.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/TestShellExecEndpointCoprocessor.java index 81519bc449f..4d9cd7eb406 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/TestShellExecEndpointCoprocessor.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/TestShellExecEndpointCoprocessor.java @@ -116,10 +116,10 @@ public class TestShellExecEndpointCoprocessor { } private static File ensureTestDataDirExists( - final HBaseTestingUtility testingUtility + final HBaseTestingUtil testingUtility ) throws IOException { final Path testDataDir = Optional.of(testingUtility) - .map(HBaseTestingUtility::getDataTestDir) + .map(HBaseTestingUtil::getDataTestDir) .map(Object::toString) .map(val -> Paths.get(val)) .orElseThrow(() -> new RuntimeException("Unable to locate temp directory path.")); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java index 9a2b048515c..a4209a94e06 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java @@ -32,13 +32,13 @@ import java.util.function.Consumer; import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; -import org.apache.hadoop.hbase.HBaseCluster; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseClusterInterface; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.IntegrationTestBase; import org.apache.hadoop.hbase.IntegrationTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.factories.MonkeyConstants; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; @@ -87,7 +87,7 @@ public abstract class Action { protected static final long START_NAMENODE_TIMEOUT_DEFAULT = PolicyBasedChaosMonkey.TIMEOUT; protected ActionContext context; - protected HBaseCluster cluster; + protected HBaseClusterInterface cluster; protected ClusterMetrics initialStatus; protected ServerName[] initialServers; protected Properties monkeyProps; @@ -197,7 +197,7 @@ public abstract class Action { protected void suspendRs(ServerName server) throws IOException { getLogger().info("Suspending regionserver {}", server); cluster.suspendRegionServer(server); - if(!(cluster instanceof MiniHBaseCluster)){ + if(!(cluster instanceof SingleProcessHBaseCluster)){ cluster.waitForRegionServerToStop(server, killRsTimeout); } getLogger().info("Suspending regionserver {}. Reported num of rs:{}", server, @@ -207,7 +207,7 @@ public abstract class Action { protected void resumeRs(ServerName server) throws IOException { getLogger().info("Resuming regionserver {}", server); cluster.resumeRegionServer(server); - if(!(cluster instanceof MiniHBaseCluster)){ + if(!(cluster instanceof SingleProcessHBaseCluster)){ cluster.waitForRegionServerToStart(server.getHostname(), server.getPort(), startRsTimeout); } getLogger().info("Resuming regionserver {}. Reported num of rs:{}", server, @@ -342,7 +342,7 @@ public abstract class Action { */ protected void modifyAllTableColumns(TableName tableName, BiConsumer transform) throws IOException { - HBaseTestingUtility util = this.context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = this.context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); TableDescriptor tableDescriptor = admin.getDescriptor(tableName); @@ -401,7 +401,7 @@ public abstract class Action { return util; } - public HBaseCluster getHBaseCluster() { + public HBaseClusterInterface getHBaseCluster() { return util.getHBaseClusterInterface(); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java index 14a11eedb2f..63553a757d6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.Random; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -51,7 +51,7 @@ public class ChangeSplitPolicyAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); getLogger().info("Performing action: Change split policy of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java index 889b3fbba3d..fe5f5e92344 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.commons.lang3.RandomUtils; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.CompactType; @@ -52,7 +52,7 @@ public class CompactMobAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(0, 100) < majorRatio; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java index ffc05b837f2..9ed876dbaeb 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; import org.apache.commons.lang3.RandomUtils; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; @@ -56,7 +56,7 @@ public class CompactRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(0, 100) < majorRatio; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java index 7278d2b67b6..7d57b3b6b30 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.commons.lang3.RandomUtils; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.slf4j.Logger; @@ -52,7 +52,7 @@ public class CompactTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); boolean major = RandomUtils.nextInt(0, 100) < majorRatio; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java index ff23c3422f7..dab0475b1e4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; @@ -51,7 +51,7 @@ public class FlushRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); getLogger().info("Performing action: Flush random region of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java index d73b85a9eef..695174800f6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.actions; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.slf4j.Logger; @@ -47,7 +47,7 @@ public class FlushTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); // Don't try the flush if we're stopping diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java index a7e0723cd4f..2e359ed1161 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; import org.apache.commons.lang3.RandomUtils; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.RegionInfo; @@ -51,7 +51,7 @@ public class MergeRandomAdjacentRegionsOfTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); getLogger().info("Performing action: Merge random adjacent regions of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java index 2e9b3b9218d..d2d51ed92da 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; @@ -54,7 +54,7 @@ public class MoveRandomRegionOfTableAction extends Action { Thread.sleep(sleepTime); } - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); getLogger().info("Performing action: Move random region of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java index 2f39233dcba..b2297f78eaa 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.actions; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -48,7 +48,7 @@ public class SnapshotTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); String snapshotName = tableName + "-it-" + EnvironmentEdgeManager.currentTime(); Admin admin = util.getAdmin(); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java index ffd841b5bdc..dd4e9931f95 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.io.IOException; import java.util.concurrent.ThreadLocalRandom; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.slf4j.Logger; @@ -51,7 +51,7 @@ public class SplitAllRegionOfTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); // Don't try the split if we're stopping if (context.isStopping()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java index 3a683397131..1a60ffc041a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; @@ -51,7 +51,7 @@ public class SplitRandomRegionOfTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); getLogger().info("Performing action: Split random region of table " + tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SudoCommandAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SudoCommandAction.java index f1712c89fea..8766f4d4e67 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SudoCommandAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SudoCommandAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.io.IOException; import org.apache.hadoop.hbase.DistributedHBaseCluster; -import org.apache.hadoop.hbase.HBaseCluster; +import org.apache.hadoop.hbase.HBaseClusterInterface; import org.apache.hadoop.hbase.HBaseClusterManager; /** @@ -38,7 +38,7 @@ abstract public class SudoCommandAction extends Action { @Override public void init(ActionContext context) throws IOException { super.init(context); - HBaseCluster cluster = context.getHBaseCluster(); + HBaseClusterInterface cluster = context.getHBaseCluster(); if (cluster instanceof DistributedHBaseCluster){ Object manager = ((DistributedHBaseCluster)cluster).getClusterManager(); if (manager instanceof HBaseClusterManager){ diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java index 5da10c7b481..381de95dffa 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.Random; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.slf4j.Logger; @@ -44,7 +44,7 @@ public class TruncateTableAction extends Action { @Override public void perform() throws Exception { - HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); + HBaseTestingUtil util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); // Don't try the truncate if we're stopping diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index 578df72bef0..547753ca498 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java @@ -36,7 +36,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.IntegrationTestBase; import org.apache.hadoop.hbase.IntegrationTestingUtility; import org.apache.hadoop.hbase.KeyValue; @@ -211,7 +211,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { TableDescriptor desc = admin.getDescriptor(t); TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(desc); builder.setCoprocessor(SlowMeCoproScanOperations.class.getName()); - HBaseTestingUtility.modifyTableSync(admin, builder.build()); + HBaseTestingUtil.modifyTableSync(admin, builder.build()); } @Test @@ -252,7 +252,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { if (replicaCount == NUM_REPLICA_COUNT_DEFAULT) return; TableName t = getTablename(); - HBaseTestingUtility.setReplicas(util.getAdmin(), t, replicaCount); + HBaseTestingUtil.setReplicas(util.getAdmin(), t, replicaCount); } private void runLinkedListMRJob(int iteration) throws Exception { 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 15240623d9d..cd0cf205827 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 @@ -42,7 +42,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.IntegrationTestBase; @@ -776,14 +776,14 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { .build(); // If we want to pre-split compute how many splits. - if (conf.getBoolean(HBaseTestingUtility.PRESPLIT_TEST_TABLE_KEY, - HBaseTestingUtility.PRESPLIT_TEST_TABLE)) { + if (conf.getBoolean(HBaseTestingUtil.PRESPLIT_TEST_TABLE_KEY, + HBaseTestingUtil.PRESPLIT_TEST_TABLE)) { int numberOfServers = admin.getRegionServers().size(); if (numberOfServers == 0) { throw new IllegalStateException("No live regionservers"); } - int regionsPerServer = conf.getInt(HBaseTestingUtility.REGIONS_PER_SERVER_KEY, - HBaseTestingUtility.DEFAULT_REGIONS_PER_SERVER); + int regionsPerServer = conf.getInt(HBaseTestingUtil.REGIONS_PER_SERVER_KEY, + HBaseTestingUtil.DEFAULT_REGIONS_PER_SERVER); int totalNumberOfRegions = numberOfServers * regionsPerServer; LOG.info("Number of live regionservers: " + numberOfServers + ", " + "pre-splitting table into " + totalNumberOfRegions + " regions " + @@ -1932,9 +1932,9 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { System.err.println(" -D"+ TABLE_NAME_KEY+ "="); System.err.println(" Run using the as the tablename. Defaults to " + DEFAULT_TABLE_NAME); - System.err.println(" -D"+ HBaseTestingUtility.REGIONS_PER_SERVER_KEY+ "=<# regions>"); + System.err.println(" -D"+ HBaseTestingUtil.REGIONS_PER_SERVER_KEY+ "=<# regions>"); System.err.println(" Create table with presplit regions per server. Defaults to " - + HBaseTestingUtility.DEFAULT_REGIONS_PER_SERVER); + + HBaseTestingUtil.DEFAULT_REGIONS_PER_SERVER); System.err.println(" -DuseMob="); System.err.println(" Create table so that the mob read/write path is forced. " + diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadCommonCrawl.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadCommonCrawl.java index 9c917960c13..5dcd84e2462 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadCommonCrawl.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadCommonCrawl.java @@ -39,7 +39,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.IntegrationTestBase; import org.apache.hadoop.hbase.IntegrationTestingUtility; @@ -448,14 +448,14 @@ public class IntegrationTestLoadCommonCrawl extends IntegrationTestBase { .setColumnFamilies(families) .build(); - if (getConf().getBoolean(HBaseTestingUtility.PRESPLIT_TEST_TABLE_KEY, - HBaseTestingUtility.PRESPLIT_TEST_TABLE)) { + if (getConf().getBoolean(HBaseTestingUtil.PRESPLIT_TEST_TABLE_KEY, + HBaseTestingUtil.PRESPLIT_TEST_TABLE)) { int numberOfServers = admin.getRegionServers().size(); if (numberOfServers == 0) { throw new IllegalStateException("No live regionservers"); } - int regionsPerServer = getConf().getInt(HBaseTestingUtility.REGIONS_PER_SERVER_KEY, - HBaseTestingUtility.DEFAULT_REGIONS_PER_SERVER); + int regionsPerServer = getConf().getInt(HBaseTestingUtil.REGIONS_PER_SERVER_KEY, + HBaseTestingUtil.DEFAULT_REGIONS_PER_SERVER); int totalNumberOfRegions = numberOfServers * regionsPerServer; LOG.info("Creating test table: " + tableDescriptor); LOG.info("Number of live regionservers: " + numberOfServers + ", " + diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java index 79fefbf4daa..21e5b0a03c6 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java @@ -60,7 +60,7 @@ public class TestPerformanceEvaluation { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestPerformanceEvaluation.class); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @Test public void testDefaultInMemoryCompaction() { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java index 94fe1e69275..2c5abec8dde 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -84,7 +84,7 @@ public class TestTableInputFormat { private static final Logger LOG = LoggerFactory.getLogger(TestTableInputFormat.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); static final byte[] FAMILY = Bytes.toBytes("family"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java index fe160062669..e28cbb63d10 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableMapReduceUtil.java @@ -29,7 +29,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; @@ -88,7 +88,7 @@ public class TestTableMapReduceUtil { private static ImmutableMap> relation = ImmutableMap .of(PRESIDENT_PATTERN, presidentsRowKeys, ACTOR_PATTERN, actorsRowKeys); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableOutputFormatConnectionExhaust.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableOutputFormatConnectionExhaust.java index 746ac532ac9..b14bc9aac24 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableOutputFormatConnectionExhaust.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableOutputFormatConnectionExhaust.java @@ -21,7 +21,7 @@ import static org.junit.Assert.fail; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -52,7 +52,7 @@ public class TestTableOutputFormatConnectionExhaust { private static final Logger LOG = LoggerFactory.getLogger(TestTableOutputFormatConnectionExhaust.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); static final String TABLE = "TestTableOutputFormatConnectionExhaust"; static final String FAMILY = "family"; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java index 9e05a85c480..f0556ca8ee7 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableSnapshotInputFormat.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Iterator; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Result; @@ -91,8 +91,8 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa public static class TestTableSnapshotReducer extends MapReduceBase implements Reducer { - HBaseTestingUtility.SeenRowTracker rowTracker = - new HBaseTestingUtility.SeenRowTracker(aaa, after_zzz); + HBaseTestingUtil.SeenRowTracker rowTracker = + new HBaseTestingUtil.SeenRowTracker(aaa, after_zzz); @Override public void reduce(ImmutableBytesWritable key, Iterator values, @@ -171,7 +171,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } @Override - protected void testWithMockedMapReduce(HBaseTestingUtility util, String snapshotName, + protected void testWithMockedMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean setLocalityEnabledTo) throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); @@ -212,8 +212,8 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa Assert.assertEquals(expectedNumSplits, splits.length); - HBaseTestingUtility.SeenRowTracker rowTracker = - new HBaseTestingUtility.SeenRowTracker(startRow, stopRow); + HBaseTestingUtil.SeenRowTracker rowTracker = + new HBaseTestingUtil.SeenRowTracker(startRow, stopRow); // SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_KEY is not explicitly specified, // so the default value is taken. @@ -256,7 +256,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } @Override - protected void testWithMapReduceImpl(HBaseTestingUtility util, TableName tableName, + protected void testWithMapReduceImpl(HBaseTestingUtil util, TableName tableName, String snapshotName, Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception { doTestWithMapReduce(util, tableName, snapshotName, getStartRow(), getEndRow(), tableDir, @@ -264,7 +264,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } // this is also called by the IntegrationTestTableSnapshotInputFormat - public static void doTestWithMapReduce(HBaseTestingUtility util, TableName tableName, + public static void doTestWithMapReduce(HBaseTestingUtil util, TableName tableName, String snapshotName, byte[] startRow, byte[] endRow, Path tableDir, int numRegions, int numSplitsPerRegion,int expectedNumSplits, boolean shutdownCluster) throws Exception { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java index e9a385cd1cd..45eb55fa4c2 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/MultiTableInputFormatTestBase.java @@ -31,7 +31,7 @@ import java.util.NavigableMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; @@ -56,7 +56,7 @@ import org.apache.hbase.thirdparty.com.google.common.collect.Lists; */ public abstract class MultiTableInputFormatTestBase { static final Logger LOG = LoggerFactory.getLogger(TestMultiTableInputFormat.class); - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static final String TABLE_NAME = "scantest"; static final byte[] INPUT_FAMILY = Bytes.toBytes("contents"); static final String KEY_STARTROW = "startRow"; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java index 83f8e0c120f..63e9cdb4868 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatTestBase.java @@ -27,8 +27,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Result; @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; public abstract class TableSnapshotInputFormatTestBase { private static final Logger LOG = LoggerFactory.getLogger(TableSnapshotInputFormatTestBase.class); - protected final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final int NUM_REGION_SERVERS = 2; protected static final byte[][] FAMILIES = {Bytes.toBytes("f1"), Bytes.toBytes("f2")}; @@ -61,7 +61,7 @@ public abstract class TableSnapshotInputFormatTestBase { @Before public void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(NUM_REGION_SERVERS).numDataNodes(NUM_REGION_SERVERS) .createRootDir(true).build(); UTIL.startMiniCluster(option); @@ -79,11 +79,11 @@ public abstract class TableSnapshotInputFormatTestBase { conf.setBoolean(SnapshotManager.HBASE_SNAPSHOT_ENABLED, true); } - protected abstract void testWithMockedMapReduce(HBaseTestingUtility util, String snapshotName, + protected abstract void testWithMockedMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean setLocalityEnabledTo) throws Exception; - protected abstract void testWithMapReduceImpl(HBaseTestingUtility util, TableName tableName, + protected abstract void testWithMapReduceImpl(HBaseTestingUtil util, TableName tableName, String snapshotName, Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception; @@ -160,7 +160,7 @@ public abstract class TableSnapshotInputFormatTestBase { public abstract void testRestoreSnapshotDoesNotCreateBackRefLinksInit(TableName tableName, String snapshotName, Path tmpTableDir) throws Exception; - protected void testWithMapReduce(HBaseTestingUtility util, String snapshotName, int numRegions, + protected void testWithMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception { Path tableDir = util.getDataTestDirOnTestFS(snapshotName); TableName tableName = TableName.valueOf("testWithMapReduce"); @@ -188,7 +188,7 @@ public abstract class TableSnapshotInputFormatTestBase { } } - protected static void createTableAndSnapshot(HBaseTestingUtility util, TableName tableName, + protected static void createTableAndSnapshot(HBaseTestingUtil util, TableName tableName, String snapshotName, byte[] startRow, byte[] endRow, int numRegions) throws Exception { try { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java index 6908678729c..5bc548b1e87 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellCounter.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -56,7 +56,7 @@ public class TestCellCounter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCellCounter.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] ROW1 = Bytes.toBytesBinary("\\x01row1"); private static final byte[] ROW2 = Bytes.toBytesBinary("\\x01row2"); private static final String FAMILY_A_STRING = "a"; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java index 7f983d3d958..f25a9862d63 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCopyTable.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -67,7 +67,7 @@ public class TestCopyTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCopyTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW1 = Bytes.toBytes("row1"); private static final byte[] ROW2 = Bytes.toBytes("row2"); private static final String FAMILY_A_STRING = "a"; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java index 2467dcace23..09b9b5eea64 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.mapreduce; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.MapReduceTests; import org.junit.ClassRule; @@ -48,7 +48,7 @@ public class TestHBaseMRTestingUtility { dummyProps.put("mapreduce.jobhistory.webapp.address", "dummyhost:11238"); dummyProps.put("yarn.resourcemanager.webapp.address", "dummyhost:11239"); - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); // populate the mr props to the Configuration instance for (Map.Entry entry : dummyProps.entrySet()) { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java index 04b53e01ea2..12f1a624c5c 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java @@ -58,7 +58,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.HadoopShims; @@ -66,7 +66,7 @@ import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PerformanceEvaluation; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Tag; import org.apache.hadoop.hbase.TagType; @@ -153,7 +153,7 @@ public class TestHFileOutputFormat2 { private static final TableName[] TABLE_NAMES = Stream.of("TestTable", "TestTable2", "TestTable3").map(TableName::valueOf).toArray(TableName[]::new); - private HBaseTestingUtility util = new HBaseTestingUtility(); + private HBaseTestingUtil util = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestHFileOutputFormat2.class); @@ -635,7 +635,7 @@ public class TestHFileOutputFormat2 { private void doIncrementalLoadTest(boolean shouldChangeRegions, boolean shouldKeepLocality, boolean putSortReducer, List tableStr) throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); Configuration conf = util.getConfiguration(); conf.setBoolean(MultiTableHFileOutputFormat.LOCALITY_SENSITIVE_CONF_KEY, shouldKeepLocality); int hostCount = 1; @@ -651,7 +651,7 @@ public class TestHFileOutputFormat2 { for (int i = 0; i < hostCount; ++i) { hostnames[i] = "datanode_" + i; } - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(hostCount).dataNodeHosts(hostnames).build(); util.startMiniCluster(option); @@ -1177,7 +1177,7 @@ public class TestHFileOutputFormat2 { TableDescriptorBuilder.newBuilder(TABLE_NAMES[0]); Mockito.doReturn(tableDescriptorBuilder.build()).when(table).getDescriptor(); - for (ColumnFamilyDescriptor hcd : HBaseTestingUtility.generateColumnDescriptors()) { + for (ColumnFamilyDescriptor hcd : HBaseTestingUtil.generateColumnDescriptors()) { tableDescriptorBuilder.setColumnFamily(hcd); } @@ -1454,7 +1454,7 @@ public class TestHFileOutputFormat2 { public void manualTest(String args[]) throws Exception { Configuration conf = HBaseConfiguration.create(); - util = new HBaseTestingUtility(conf); + util = new HBaseTestingUtil(conf); if ("newtable".equals(args[0])) { TableName tname = TableName.valueOf(args[1]); byte[][] splitKeys = generateRandomSplitKeys(4); @@ -1476,7 +1476,7 @@ public class TestHFileOutputFormat2 { @Test public void testBlockStoragePolicy() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); Configuration conf = util.getConfiguration(); conf.set(HFileOutputFormat2.STORAGE_POLICY_PROPERTY, "ALL_SSD"); @@ -1652,7 +1652,7 @@ public class TestHFileOutputFormat2 { @Test public void testMRIncrementalLoadWithLocalityMultiCluster() throws Exception { // Start cluster A - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); Configuration confA = util.getConfiguration(); int hostCount = 3; int regionNum = 20; @@ -1660,12 +1660,12 @@ public class TestHFileOutputFormat2 { for (int i = 0; i < hostCount; ++i) { hostnames[i] = "datanode_" + i; } - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(hostCount).dataNodeHosts(hostnames).build(); util.startMiniCluster(option); // Start cluster B - HBaseTestingUtility utilB = new HBaseTestingUtility(); + HBaseTestingUtil utilB = new HBaseTestingUtil(); Configuration confB = utilB.getConfiguration(); utilB.startMiniCluster(option); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java index 77245f3c360..a2c4fbaf87e 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHRegionPartitioner.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.testclassification.MapReduceTests; @@ -42,7 +42,7 @@ public class TestHRegionPartitioner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHRegionPartitioner.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java index ffcc900acc7..ff1ac7461fa 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHashTable.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -58,7 +58,7 @@ public class TestHashTable { private static final Logger LOG = LoggerFactory.getLogger(TestHashTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index fe350128435..8a21c56e445 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -45,7 +45,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -118,7 +118,7 @@ public class TestImportExport { HBaseClassTestRule.forClass(TestImportExport.class); private static final Logger LOG = LoggerFactory.getLogger(TestImportExport.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] ROW1 = Bytes.toBytesBinary("\\x32row1"); private static final byte[] ROW2 = Bytes.toBytesBinary("\\x32row2"); private static final byte[] ROW3 = Bytes.toBytesBinary("\\x32row3"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java index 83a457ff071..3e17bd96367 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithOperationAttributes.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -75,7 +75,7 @@ public class TestImportTSVWithOperationAttributes implements Configurable { private static final Logger LOG = LoggerFactory.getLogger(TestImportTSVWithOperationAttributes.class); protected static final String NAME = TestImportTsv.class.getSimpleName(); - protected static HBaseTestingUtility util = new HBaseTestingUtility(); + protected static HBaseTestingUtil util = new HBaseTestingUtil(); /** * Delete the tmp directory after running doMROnTableTest. Boolean. Default is @@ -163,7 +163,7 @@ public class TestImportTSVWithOperationAttributes implements Configurable { * @param dataAvailable * @return The Tool instance used to run the test. */ - private Tool doMROnTableTest(HBaseTestingUtility util, String family, String data, String[] args, + private Tool doMROnTableTest(HBaseTestingUtil util, String family, String data, String[] args, int valueMultiplier, boolean dataAvailable) throws Exception { String table = args[args.length - 1]; Configuration conf = new Configuration(util.getConfiguration()); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java index b8b6bb81155..f981ffc222a 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithTTLs.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -64,7 +64,7 @@ public class TestImportTSVWithTTLs implements Configurable { protected static final Logger LOG = LoggerFactory.getLogger(TestImportTSVWithTTLs.class); protected static final String NAME = TestImportTsv.class.getSimpleName(); - protected static HBaseTestingUtility util = new HBaseTestingUtility(); + protected static HBaseTestingUtil util = new HBaseTestingUtil(); /** * Delete the tmp directory after running doMROnTableTest. Boolean. Default is @@ -124,7 +124,7 @@ public class TestImportTSVWithTTLs implements Configurable { util.deleteTable(tableName); } - protected static Tool doMROnTableTest(HBaseTestingUtility util, String family, String data, + protected static Tool doMROnTableTest(HBaseTestingUtil util, String family, String data, String[] args, int valueMultiplier) throws Exception { TableName table = TableName.valueOf(args[args.length - 1]); Configuration conf = new Configuration(util.getConfiguration()); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java index a78ba8196ca..049ec0ad4f1 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java @@ -36,7 +36,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -86,7 +86,7 @@ public class TestImportTSVWithVisibilityLabels implements Configurable { private static final Logger LOG = LoggerFactory.getLogger(TestImportTSVWithVisibilityLabels.class); protected static final String NAME = TestImportTsv.class.getSimpleName(); - protected static HBaseTestingUtility util = new HBaseTestingUtility(); + protected static HBaseTestingUtil util = new HBaseTestingUtil(); /** * Delete the tmp directory after running doMROnTableTest. Boolean. Default is @@ -320,7 +320,7 @@ public class TestImportTSVWithVisibilityLabels implements Configurable { util.deleteTable(tableName); } - protected static Tool doMROnTableTest(HBaseTestingUtility util, String family, String data, + protected static Tool doMROnTableTest(HBaseTestingUtil util, String family, String data, String[] args, int valueMultiplier) throws Exception { return doMROnTableTest(util, family, data, args, valueMultiplier, -1); } @@ -338,7 +338,7 @@ public class TestImportTSVWithVisibilityLabels implements Configurable { * * @return The Tool instance used to run the test. */ - protected static Tool doMROnTableTest(HBaseTestingUtility util, String family, String data, + protected static Tool doMROnTableTest(HBaseTestingUtil util, String family, String data, String[] args, int valueMultiplier,int expectedKVCount) throws Exception { TableName table = TableName.valueOf(args[args.length - 1]); Configuration conf = new Configuration(util.getConfiguration()); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java index fb213a3f624..bf4c868475c 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsv.java @@ -38,7 +38,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -80,7 +80,7 @@ public class TestImportTsv implements Configurable { private static final Logger LOG = LoggerFactory.getLogger(TestImportTsv.class); protected static final String NAME = TestImportTsv.class.getSimpleName(); - protected static HBaseTestingUtility util = new HBaseTestingUtility(); + protected static HBaseTestingUtil util = new HBaseTestingUtil(); // Delete the tmp directory after running doMROnTableTest. Boolean. Default is true. protected static final String DELETE_AFTER_LOAD_CONF = NAME + ".deleteAfterLoad"; @@ -385,7 +385,7 @@ public class TestImportTsv implements Configurable { return doMROnTableTest(util, tn, FAMILY, data, args, valueMultiplier,-1); } - protected static Tool doMROnTableTest(HBaseTestingUtility util, TableName table, + protected static Tool doMROnTableTest(HBaseTestingUtil util, TableName table, String family, String data, Map args) throws Exception { return doMROnTableTest(util, table, family, data, args, 1,-1); } @@ -398,7 +398,7 @@ public class TestImportTsv implements Configurable { * @param args Any arguments to pass BEFORE inputFile path is appended. * @return The Tool instance used to run the test. */ - protected static Tool doMROnTableTest(HBaseTestingUtility util, TableName table, + protected static Tool doMROnTableTest(HBaseTestingUtil util, TableName table, String family, String data, Map args, int valueMultiplier,int expectedKVCount) throws Exception { Configuration conf = new Configuration(util.getConfiguration()); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java index dacc15c74b2..d55fc829bfe 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestMultithreadedTableMapper.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; @@ -65,8 +65,8 @@ public class TestMultithreadedTableMapper { HBaseClassTestRule.forClass(TestMultithreadedTableMapper.class); private static final Logger LOG = LoggerFactory.getLogger(TestMultithreadedTableMapper.class); - private static final HBaseTestingUtility UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = + new HBaseTestingUtil(); static final TableName MULTI_REGION_TABLE_NAME = TableName.valueOf("mrtest"); static final byte[] INPUT_FAMILY = Bytes.toBytes("contents"); static final byte[] OUTPUT_FAMILY = Bytes.toBytes("text"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java index 5793dfad588..d33f30a7075 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRowCounter.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.Arrays; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -58,7 +58,7 @@ public class TestRowCounter { HBaseClassTestRule.forClass(TestRowCounter.class); private static final Logger LOG = LoggerFactory.getLogger(TestRowCounter.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static String TABLE_NAME = "testRowCounter"; private final static String TABLE_NAME_TS_RANGE = "testRowCounter_ts_range"; private final static String COL_FAM = "col_fam"; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSimpleTotalOrderPartitioner.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSimpleTotalOrderPartitioner.java index b28d8d9e89b..f93e76ae803 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSimpleTotalOrderPartitioner.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSimpleTotalOrderPartitioner.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.testclassification.MapReduceTests; @@ -41,7 +41,7 @@ public class TestSimpleTotalOrderPartitioner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSimpleTotalOrderPartitioner.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); Configuration conf = TEST_UTIL.getConfiguration(); @Test diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java index ef0e0d9118d..da0d7b121d7 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestSyncTable.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; @@ -63,7 +63,7 @@ public class TestSyncTable { private static final Logger LOG = LoggerFactory.getLogger(TestSyncTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java index 8cf90015651..197060d1b20 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -82,7 +82,7 @@ public class TestTableInputFormat { private static final Logger LOG = LoggerFactory.getLogger(TestTableInputFormat.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static MiniMRCluster mrCluster; static final byte[] FAMILY = Bytes.toBytes("family"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java index 7855747b166..eab1d871a60 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScanBase.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.NavigableMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; @@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory; public abstract class TestTableInputFormatScanBase { private static final Logger LOG = LoggerFactory.getLogger(TestTableInputFormatScanBase.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static final TableName TABLE_NAME = TableName.valueOf("scantest"); static final byte[][] INPUT_FAMILYS = {Bytes.toBytes("content1"), Bytes.toBytes("content2")}; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java index f86f20d6412..bca27ec28f6 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduceBase.java @@ -28,7 +28,7 @@ import java.util.NavigableMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; @@ -50,7 +50,7 @@ import org.slf4j.Logger; * implementations. */ public abstract class TestTableMapReduceBase { - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final TableName MULTI_REGION_TABLE_NAME = TableName.valueOf("mrtest"); protected static final TableName TABLE_FOR_NEGATIVE_TESTS = TableName.valueOf("testfailuretable"); protected static final byte[] INPUT_FAMILY = Bytes.toBytes("contents"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableRecordReader.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableRecordReader.java index 88e40a75c53..1905beba3b1 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableRecordReader.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableRecordReader.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; @@ -46,7 +46,7 @@ import org.junit.experimental.categories.Category; @Category(MediumTests.class) public class TestTableRecordReader { - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java index b6e92f99f03..15a61e0e5c8 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSnapshotInputFormat.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.TableName; @@ -154,8 +154,8 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa public static class TestTableSnapshotReducer extends Reducer { - HBaseTestingUtility.SeenRowTracker rowTracker = - new HBaseTestingUtility.SeenRowTracker(bbb, yyy); + HBaseTestingUtil.SeenRowTracker rowTracker = + new HBaseTestingUtil.SeenRowTracker(bbb, yyy); @Override protected void reduce(ImmutableBytesWritable key, Iterable values, Context context) throws IOException, InterruptedException { @@ -208,7 +208,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } @Override - public void testWithMockedMapReduce(HBaseTestingUtility util, String snapshotName, + public void testWithMockedMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean setLocalityEnabledTo) throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); @@ -399,7 +399,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa Assert.assertEquals(expectedNumSplits, splits.size()); - HBaseTestingUtility.SeenRowTracker rowTracker = new HBaseTestingUtility.SeenRowTracker(startRow, + HBaseTestingUtil.SeenRowTracker rowTracker = new HBaseTestingUtil.SeenRowTracker(startRow, stopRow.length > 0 ? stopRow : Bytes.toBytes("\uffff")); boolean localityEnabled = @@ -454,7 +454,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } @Override - protected void testWithMapReduceImpl(HBaseTestingUtility util, TableName tableName, + protected void testWithMapReduceImpl(HBaseTestingUtil util, TableName tableName, String snapshotName, Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception { doTestWithMapReduce(util, tableName, snapshotName, getStartRow(), getEndRow(), tableDir, @@ -462,7 +462,7 @@ public class TestTableSnapshotInputFormat extends TableSnapshotInputFormatTestBa } // this is also called by the IntegrationTestTableSnapshotInputFormat - public static void doTestWithMapReduce(HBaseTestingUtility util, TableName tableName, + public static void doTestWithMapReduce(HBaseTestingUtil util, TableName tableName, String snapshotName, byte[] startRow, byte[] endRow, Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception { diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java index b7c2f211d16..bf25c1caac3 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -69,8 +69,8 @@ public class TestTimeRangeMapRed { HBaseClassTestRule.forClass(TestTimeRangeMapRed.class); private final static Logger log = LoggerFactory.getLogger(TestTimeRangeMapRed.class); - private static final HBaseTestingUtility UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = + new HBaseTestingUtil(); private Admin admin; private static final byte [] KEY = Bytes.toBytes("row1"); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java index d60a3d9b712..aac4ae5271b 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java @@ -34,10 +34,10 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; @@ -78,8 +78,8 @@ public class TestWALPlayer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWALPlayer.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); - private static MiniHBaseCluster cluster; + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); + private static SingleProcessHBaseCluster cluster; private static Path rootDir; private static Path walRootDir; private static FileSystem fs; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALRecordReader.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALRecordReader.java index c30235aa83a..5e1c097b164 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALRecordReader.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALRecordReader.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -71,7 +71,7 @@ public class TestWALRecordReader { HBaseClassTestRule.forClass(TestWALRecordReader.class); private static final Logger LOG = LoggerFactory.getLogger(TestWALRecordReader.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; private static FileSystem fs; private static Path hbaseDir; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java index 26cee49e89e..f286c63fb54 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -46,7 +46,7 @@ public class TestCompactionTool { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompactionTool.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private HRegion region; private final static byte[] qualifier = Bytes.toBytes("qf"); @@ -56,7 +56,7 @@ public class TestCompactionTool { @Before public void setUp() throws Exception { this.testUtil.startMiniCluster(); - testUtil.createTable(tableName, HBaseTestingUtility.fam1); + testUtil.createTable(tableName, HBaseTestingUtil.fam1); rootDir = testUtil.getDefaultRootDirPath(); this.region = testUtil.getMiniHBaseCluster().getRegions(tableName).get(0); } @@ -72,12 +72,12 @@ public class TestCompactionTool { for (int i = 0; i < 10; i++) { this.putAndFlush(i); } - HStore store = region.getStore(HBaseTestingUtility.fam1); + HStore store = region.getStore(HBaseTestingUtil.fam1); assertEquals(10, store.getStorefilesCount()); Path tableDir = CommonFSUtils.getTableDir(rootDir, region.getRegionInfo().getTable()); FileSystem fs = store.getFileSystem(); String storePath = tableDir + "/" + region.getRegionInfo().getEncodedName() + "/" - + Bytes.toString(HBaseTestingUtility.fam1); + + Bytes.toString(HBaseTestingUtil.fam1); FileStatus[] regionDirFiles = fs.listStatus(new Path(storePath)); assertEquals(10, regionDirFiles.length); String defaultFS = testUtil.getMiniHBaseCluster().getConfiguration().get("fs.defaultFS"); @@ -92,7 +92,7 @@ public class TestCompactionTool { private void putAndFlush(int key) throws Exception{ Put put = new Put(Bytes.toBytes(key)); - put.addColumn(HBaseTestingUtility.fam1, qualifier, Bytes.toBytes("val" + key)); + put.addColumn(HBaseTestingUtil.fam1, qualifier, Bytes.toBytes("val" + key)); region.put(put); region.flush(true); } diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplication.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplication.java index 04b766df435..c614b440005 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplication.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplication.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -101,7 +101,7 @@ public class TestVerifyReplication extends TestReplicationBase { Connection connection2 = ConnectionFactory.createConnection(CONF2); try (Admin admin2 = connection2.getAdmin()) { - admin2.createTable(peerTable, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin2.createTable(peerTable, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } htable3 = connection2.getTable(peerTableName); } @@ -174,10 +174,10 @@ public class TestVerifyReplication extends TestReplicationBase { Connection connection1 = ConnectionFactory.createConnection(CONF1); Connection connection2 = ConnectionFactory.createConnection(CONF2); try (Admin admin1 = connection1.getAdmin()) { - admin1.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin1.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } try (Admin admin2 = connection2.getAdmin()) { - admin2.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin2.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } UTIL1.waitUntilAllRegionsAssigned(tableName); UTIL2.waitUntilAllRegionsAssigned(tableName); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationAdjunct.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationAdjunct.java index 51a0748b0d6..fdbf7ac0db0 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationAdjunct.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationAdjunct.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -95,7 +95,7 @@ public class TestVerifyReplicationAdjunct extends TestReplicationBase { .build()).build(); Connection connection2 = ConnectionFactory.createConnection(CONF2); try (Admin admin2 = connection2.getAdmin()) { - admin2.createTable(peerTable, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin2.createTable(peerTable, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } htable3 = connection2.getTable(peerTableName); } diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationCrossDiffHdfs.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationCrossDiffHdfs.java index 1ab1f1a9784..2fe843ba62d 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationCrossDiffHdfs.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyReplicationCrossDiffHdfs.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -69,9 +69,9 @@ public class TestVerifyReplicationCrossDiffHdfs { private static final Logger LOG = LoggerFactory.getLogger(TestVerifyReplicationCrossDiffHdfs.class); - private static HBaseTestingUtility util1; - private static HBaseTestingUtility util2; - private static HBaseTestingUtility mapReduceUtil = new HBaseTestingUtility(); + private static HBaseTestingUtil util1; + private static HBaseTestingUtil util2; + private static HBaseTestingUtil mapReduceUtil = new HBaseTestingUtil(); private static Configuration conf1 = HBaseConfiguration.create(); private static Configuration conf2; @@ -84,14 +84,14 @@ public class TestVerifyReplicationCrossDiffHdfs { @BeforeClass public static void setUpBeforeClass() throws Exception { conf1.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1"); - util1 = new HBaseTestingUtility(conf1); + util1 = new HBaseTestingUtil(conf1); util1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = util1.getZkCluster(); conf1 = util1.getConfiguration(); conf2 = HBaseConfiguration.create(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - util2 = new HBaseTestingUtility(conf2); + util2 = new HBaseTestingUtil(conf2); util2.setZkCluster(miniZK); util1.startMiniCluster(); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java index d7da7149c26..d488b070af2 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -73,7 +73,7 @@ public class TestExportSnapshot { private static final Logger LOG = LoggerFactory.getLogger(TestExportSnapshot.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final static byte[] FAMILY = Bytes.toBytes("cf"); @@ -334,7 +334,7 @@ public class TestExportSnapshot { return path; } - static Path getLocalDestinationDir(HBaseTestingUtility htu) { + static Path getLocalDestinationDir(HBaseTestingUtil htu) { Path path = htu.getDataTestDir("local-export-" + EnvironmentEdgeManager.currentTime()); try { FileSystem fs = FileSystem.getLocal(htu.getConfiguration()); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java index 37933e6c067..6569767ea3f 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotAdjunct.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -59,7 +59,7 @@ public class TestExportSnapshotAdjunct { @Rule public final TestName testName = new TestName(); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected TableName tableName; private String emptySnapshotName; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV1NoCluster.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV1NoCluster.java index 8b5687b5f8c..94b737c77f7 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV1NoCluster.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV1NoCluster.java @@ -24,7 +24,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -52,7 +52,7 @@ public class TestExportSnapshotV1NoCluster { HBaseClassTestRule.forClass(TestExportSnapshotV1NoCluster.class); private static final Logger LOG = LoggerFactory.getLogger(TestExportSnapshotV1NoCluster.class); - private HBaseCommonTestingUtility testUtil = new HBaseCommonTestingUtility(); + private HBaseCommonTestingUtil testUtil = new HBaseCommonTestingUtil(); private Path testDir; private FileSystem fs; @@ -70,7 +70,7 @@ public class TestExportSnapshotV1NoCluster { * Setup for test. Returns path to test data dir. Sets configuration into the passed * hctu.getConfiguration. */ - static Path setup(FileSystem fs, HBaseCommonTestingUtility hctu) throws IOException { + static Path setup(FileSystem fs, HBaseCommonTestingUtil hctu) throws IOException { Path testDir = hctu.getDataTestDir().makeQualified(fs.getUri(), fs.getWorkingDirectory()); hctu.getConfiguration().setBoolean(SnapshotManager.HBASE_SNAPSHOT_ENABLED, true); hctu.getConfiguration().setInt("hbase.regionserver.msginterval", 100); @@ -99,7 +99,7 @@ public class TestExportSnapshotV1NoCluster { * and then it will run the export and verification. */ static void testSnapshotWithRefsExportFileSystemState(FileSystem fs, - SnapshotMock.SnapshotBuilder builder, HBaseCommonTestingUtility testUtil, Path testDir) + SnapshotMock.SnapshotBuilder builder, HBaseCommonTestingUtil testUtil, Path testDir) throws Exception { Path[] r1Files = builder.addRegion(); Path[] r2Files = builder.addRegion(); @@ -112,7 +112,7 @@ public class TestExportSnapshotV1NoCluster { testDir, getDestinationDir(fs, testUtil, testDir), false, null, true); } - static Path getDestinationDir(FileSystem fs, HBaseCommonTestingUtility hctu, Path testDir) + static Path getDestinationDir(FileSystem fs, HBaseCommonTestingUtil hctu, Path testDir) throws IOException { Path path = new Path(new Path(testDir, "export-test"), "export-" + EnvironmentEdgeManager.currentTime()).makeQualified(fs.getUri(), diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV2NoCluster.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV2NoCluster.java index 4cd1dfdfb71..f2d3f627bae 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV2NoCluster.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshotV2NoCluster.java @@ -21,7 +21,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils.SnapshotMock; import org.apache.hadoop.hbase.testclassification.MapReduceTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -44,7 +44,7 @@ public class TestExportSnapshotV2NoCluster { private static final Logger LOG = LoggerFactory.getLogger(TestExportSnapshotV2NoCluster.class); - private HBaseCommonTestingUtility testUtil = new HBaseCommonTestingUtility(); + private HBaseCommonTestingUtil testUtil = new HBaseCommonTestingUtil(); private Path testDir; private FileSystem fs; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java index 7614b8376d0..c2f22f63a25 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java @@ -29,7 +29,7 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseInterfaceAudience; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -571,7 +571,7 @@ public class LoadTestTool extends AbstractHBaseTool { durability = Durability.ASYNC_WAL; } - HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableName, + HBaseTestingUtil.createPreSplitLoadTestTable(conf, tableName, getColumnFamilies(), compressAlgo, dataBlockEncodingAlgo, numRegionsPerServer, regionReplication, durability); applyColumnFamilyOptions(tableName, getColumnFamilies()); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestChildProcedures.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestChildProcedures.java index 4f3c443faa9..6c69853b511 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestChildProcedures.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestChildProcedures.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -51,14 +51,14 @@ public class TestChildProcedures { private static ProcedureExecutor procExecutor; private static ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestForceUpdateProcedure.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestForceUpdateProcedure.java index 178b0cbc98a..d0d6864ab6c 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestForceUpdateProcedure.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestForceUpdateProcedure.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.concurrent.Exchanger; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure; import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -50,7 +50,7 @@ public class TestForceUpdateProcedure { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestForceUpdateProcedure.class); - private static HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); private static WALProcedureStore STORE; diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureBypass.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureBypass.java index 976b718d79b..fa8db418aec 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureBypass.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureBypass.java @@ -26,7 +26,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -56,7 +56,7 @@ public class TestProcedureBypass { private static ProcedureExecutor procExecutor; - private static HBaseCommonTestingUtility htu; + private static HBaseCommonTestingUtil htu; private static FileSystem fs; private static Path testDir; @@ -67,7 +67,7 @@ public class TestProcedureBypass { @BeforeClass public static void setUp() throws Exception { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); // NOTE: The executor will be created by each test procEnv = new TestProcEnv(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureCleanup.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureCleanup.java index 82917ea5315..07dd8d8ae90 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureCleanup.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureCleanup.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -60,7 +60,7 @@ public class TestProcedureCleanup { private static ProcedureExecutor procExecutor; - private static HBaseCommonTestingUtility htu; + private static HBaseCommonTestingUtil htu; private static FileSystem fs; private static Path testDir; @@ -79,7 +79,7 @@ public class TestProcedureCleanup { @BeforeClass public static void setUp() throws Exception { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); htu.getConfiguration().setBoolean(WALProcedureStore.EXEC_WAL_CLEANUP_ON_LOAD_CONF_KEY, true); // NOTE: The executor will be created by each test testDir = htu.getDataTestDir(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java index f13a46c2f7c..f8cd787e98f 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -54,13 +54,13 @@ public class TestProcedureEvents { private ProcedureStore procStore; private ProcedureExecutor procExecutor; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); Path testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); logDir = new Path(testDir, "proc-logs"); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java index bbe37780d2c..ba52975cd6f 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecution.java @@ -27,7 +27,7 @@ import java.util.Objects; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -56,14 +56,14 @@ public class TestProcedureExecution { private ProcedureExecutor procExecutor; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecutor.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecutor.java index 7f130caf4a7..01d25acc179 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecutor.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureExecutor.java @@ -23,7 +23,7 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure; import org.apache.hadoop.hbase.procedure2.store.NoopProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -50,11 +50,11 @@ public class TestProcedureExecutor { private NoopProcedureStore procStore; private ProcedureExecutor procExecutor; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; @Before public void setUp() throws Exception { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); // NOTE: The executor will be created by each test procEnv = new TestProcEnv(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureInMemoryChore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureInMemoryChore.java index 75c8d16485b..454b188280d 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureInMemoryChore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureInMemoryChore.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.NoopProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -51,11 +51,11 @@ public class TestProcedureInMemoryChore { private NoopProcedureStore procStore; private ProcedureExecutor procExecutor; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); procEnv = new TestProcEnv(); procStore = new NoopProcedureStore(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureMetrics.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureMetrics.java index 4d9df1a5389..a2f833d62d9 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureMetrics.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureMetrics.java @@ -25,7 +25,7 @@ import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -51,7 +51,7 @@ public class TestProcedureMetrics { private static ProcedureExecutor procExecutor; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @@ -62,7 +62,7 @@ public class TestProcedureMetrics { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureNonce.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureNonce.java index e4d039085da..2a5c5ade1e8 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureNonce.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureNonce.java @@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -57,13 +57,13 @@ public class TestProcedureNonce { private static ProcedureExecutor procExecutor; private static ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); Path testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java index acfd4f4a696..686b10dbf42 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRecovery.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -60,14 +60,14 @@ public class TestProcedureRecovery { private static ProcedureStore procStore; private static int procSleepInterval; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java index db54f22f535..4d7d45de3ac 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureReplayOrder.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -61,14 +61,14 @@ public class TestProcedureReplayOrder { private TestProcedureEnv procEnv; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); htu.getConfiguration().setInt(WALProcedureStore.SYNC_WAIT_MSEC_CONF_KEY, 25); testDir = htu.getDataTestDir(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRollbackAIOOB.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRollbackAIOOB.java index fc12924244e..098c53fff28 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRollbackAIOOB.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureRollbackAIOOB.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.procedure2; import java.io.IOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure; import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -43,7 +43,7 @@ public class TestProcedureRollbackAIOOB { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestProcedureRollbackAIOOB.class); - private static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); public static final class ParentProcedure extends NoopProcedure { diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSkipPersistence.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSkipPersistence.java index 4b887928514..266082e0448 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSkipPersistence.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSkipPersistence.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -45,7 +45,7 @@ public class TestProcedureSkipPersistence { private ProcedureExecutor procExecutor; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @@ -125,7 +125,7 @@ public class TestProcedureSkipPersistence { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSuspended.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSuspended.java index d17c00c620f..38aef16cffe 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSuspended.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureSuspended.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.NoopProcedureStore; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -52,11 +52,11 @@ public class TestProcedureSuspended { private ProcedureExecutor procExecutor; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); procStore = new NoopProcedureStore(); procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), new TestProcEnv(), procStore); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestRemoteProcedureDispatcherUncaughtExceptionHandler.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestRemoteProcedureDispatcherUncaughtExceptionHandler.java index 7f44fc31322..ec001d1e337 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestRemoteProcedureDispatcherUncaughtExceptionHandler.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestRemoteProcedureDispatcherUncaughtExceptionHandler.java @@ -21,7 +21,7 @@ import java.lang.Thread.UncaughtExceptionHandler; import java.util.Set; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.After; @@ -41,7 +41,7 @@ import org.junit.rules.ExpectedException; @Category({ MasterTests.class, SmallTests.class }) public class TestRemoteProcedureDispatcherUncaughtExceptionHandler { - private static HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestStateMachineProcedure.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestStateMachineProcedure.java index fd708984635..cc3c765885d 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestStateMachineProcedure.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestStateMachineProcedure.java @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.NoopProcedure; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -76,14 +76,14 @@ public class TestStateMachineProcedure { private ProcedureExecutor procExecutor; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestYieldProcedures.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestYieldProcedures.java index e359e5cedfe..890bbd1871c 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestYieldProcedures.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestYieldProcedures.java @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -55,14 +55,14 @@ public class TestYieldProcedures { private TestScheduler procRunnables; private ProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); fs = testDir.getFileSystem(htu.getConfiguration()); assertTrue(testDir.depth() > 1); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALLoaderPerformanceEvaluation.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALLoaderPerformanceEvaluation.java index 90d1b0a5fe8..6b8b46e1044 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALLoaderPerformanceEvaluation.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALLoaderPerformanceEvaluation.java @@ -27,7 +27,7 @@ import java.util.Set; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.TestProcedure; import org.apache.hadoop.hbase.procedure2.store.ProcedureStore; @@ -39,7 +39,7 @@ import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine; import org.apache.hbase.thirdparty.org.apache.commons.cli.Option; public class ProcedureWALLoaderPerformanceEvaluation extends AbstractHBaseTool { - protected static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + protected static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); // Command line options and defaults. public static int DEFAULT_NUM_PROCS = 1000000; // 1M diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java index 73d30208984..2d7d671f33b 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestStressWALProcedureStore.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.LoadCounter; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.TestProcedure; @@ -55,7 +55,7 @@ public class TestStressWALProcedureStore { private WALProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @@ -68,7 +68,7 @@ public class TestStressWALProcedureStore { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); setupConfiguration(htu.getConfiguration()); testDir = htu.getDataTestDir(); diff --git a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java index c8335eeb7d0..915d6190b81 100644 --- a/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java +++ b/hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/TestWALProcedureStore.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.procedure2.Procedure; import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer; @@ -73,7 +73,7 @@ public class TestWALProcedureStore { private WALProcedureStore procStore; - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private FileSystem fs; private Path testDir; private Path logDir; @@ -84,7 +84,7 @@ public class TestWALProcedureStore { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); testDir = htu.getDataTestDir(); htu.getConfiguration().set(HConstants.HBASE_DIR, testDir.toString()); fs = testDir.getFileSystem(htu.getConfiguration()); diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java index 9eb67f9037d..3d67bd37a6a 100644 --- a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java @@ -21,7 +21,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterId; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.ReplicationTests; @@ -46,13 +46,13 @@ public class TestReplicationStateZKImpl extends TestReplicationStateBasic { HBaseClassTestRule.forClass(TestReplicationStateZKImpl.class); private static Configuration conf; - private static HBaseZKTestingUtility utility; + private static HBaseZKTestingUtil utility; private static ZKWatcher zkw; private static String replicationZNode; @BeforeClass public static void setUpBeforeClass() throws Exception { - utility = new HBaseZKTestingUtility(); + utility = new HBaseZKTestingUtil(); utility.startMiniZKCluster(); conf = utility.getConfiguration(); conf.setBoolean(HConstants.REPLICATION_BULKLOAD_ENABLE_KEY, true); diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationPeerStorage.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationPeerStorage.java index 45539c48c14..2c20430ab90 100644 --- a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationPeerStorage.java +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationPeerStorage.java @@ -39,7 +39,7 @@ import java.util.Set; import java.util.stream.Stream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.replication.ReplicationPeerConfigUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -60,7 +60,7 @@ public class TestZKReplicationPeerStorage { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestZKReplicationPeerStorage.class); - private static final HBaseZKTestingUtility UTIL = new HBaseZKTestingUtility(); + private static final HBaseZKTestingUtil UTIL = new HBaseZKTestingUtil(); private static ZKReplicationPeerStorage STORAGE; diff --git a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationQueueStorage.java b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationQueueStorage.java index 4f1fd390868..5080f6cb609 100644 --- a/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationQueueStorage.java +++ b/hbase-replication/src/test/java/org/apache/hadoop/hbase/replication/TestZKReplicationQueueStorage.java @@ -30,7 +30,7 @@ import java.util.Set; import java.util.SortedSet; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -56,7 +56,7 @@ public class TestZKReplicationQueueStorage { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestZKReplicationQueueStorage.class); - private static final HBaseZKTestingUtility UTIL = new HBaseZKTestingUtility(); + private static final HBaseZKTestingUtil UTIL = new HBaseZKTestingUtil(); private static ZKReplicationQueueStorage STORAGE; diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml index 1ef44130ca1..b8c6c3483ff 100644 --- a/hbase-rest/pom.xml +++ b/hbase-rest/pom.xml @@ -202,6 +202,10 @@ hbase-testing-util test + + com.sun.jersey + jersey-server + @@ -432,24 +436,13 @@ com.sun.jersey - jersey-core + jersey-server - - org.apache.hadoop - hadoop-mapreduce-client-core - test - - - com.google.guava - guava - - - org.apache.hadoop hadoop-annotations diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java index 86289ec5add..dd309d7bc95 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/RowResourceBase.java @@ -35,7 +35,7 @@ import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -74,7 +74,7 @@ public class RowResourceBase { protected static final String VALUE_5 = "5"; protected static final String VALUE_6 = "6"; - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); protected static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java index e6c9c00e48d..11f14f1b5ff 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java @@ -26,7 +26,7 @@ import java.io.ByteArrayOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -63,7 +63,7 @@ public class TestGzipFilter { private static final String ROW_1 = "testrow1"; private static final byte[] VALUE_1 = Bytes.toBytes("testvalue1"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java index 0c5fcc41a22..cf1ef2ea17b 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestMultiRowResource.java @@ -31,8 +31,8 @@ import javax.xml.bind.Unmarshaller; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -76,7 +76,7 @@ public class TestMultiRowResource { private static final String ROW_2 = "testrow6"; private static final String VALUE_2 = "testvalue6"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; @@ -90,7 +90,7 @@ public class TestMultiRowResource { @Parameterized.Parameters public static Collection data() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } public TestMultiRowResource(Boolean csrf) { diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java index 414168e2a3e..233ba33599c 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesInstanceResource.java @@ -37,7 +37,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -77,7 +77,7 @@ public class TestNamespacesInstanceResource { private static String NAMESPACE4 = "TestNamespacesInstanceResource4"; private static Map NAMESPACE4_PROPS = new HashMap<>(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java index 3d0bfc32a9f..d8729f6656b 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestNamespacesResource.java @@ -26,7 +26,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.rest.client.Client; @@ -52,7 +52,7 @@ public class TestNamespacesResource { private static String NAMESPACE1 = "TestNamespacesInstanceResource1"; private static String NAMESPACE2 = "TestNamespacesInstanceResource2"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestRESTServerSSL.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestRESTServerSSL.java index ea13360dae1..49fdd2f5edf 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestRESTServerSSL.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestRESTServerSSL.java @@ -26,7 +26,7 @@ import java.security.cert.X509Certificate; import java.util.Optional; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.http.ssl.KeyStoreTestUtil; import org.apache.hadoop.hbase.rest.client.Client; import org.apache.hadoop.hbase.rest.client.Cluster; @@ -52,7 +52,7 @@ public class TestRESTServerSSL { private static final String KEY_STORE_PASSWORD = "myKSPassword"; private static final String TRUST_STORE_PASSWORD = "myTSPassword"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client sslClient; private static File keyDir; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestResourceFilter.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestResourceFilter.java index ba0390d465d..7c0294372f0 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestResourceFilter.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestResourceFilter.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.rest; import static org.junit.Assert.assertEquals; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.rest.client.Client; import org.apache.hadoop.hbase.rest.client.Cluster; import org.apache.hadoop.hbase.rest.client.Response; @@ -39,7 +39,7 @@ public class TestResourceFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestResourceFilter.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java index bad39f49bf7..95d5550d226 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java @@ -36,7 +36,7 @@ import javax.xml.bind.Unmarshaller; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -82,7 +82,7 @@ public class TestScannerResource { private static final String COLUMN_1 = CFA + ":1"; private static final String COLUMN_2 = CFB + ":2"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java index e1fcaf82d3c..9f86b5815d4 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java @@ -33,7 +33,7 @@ import javax.xml.bind.Unmarshaller; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -116,7 +116,7 @@ public class TestScannersWithFilters { Bytes.toBytes("testValueOne"), Bytes.toBytes("testValueTwo") }; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java index bc74b275cee..f7f9def4477 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithLabels.java @@ -34,7 +34,7 @@ import javax.xml.bind.Unmarshaller; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -88,7 +88,7 @@ public class TestScannersWithLabels { private final static String SECRET = "secret"; private static User SUPERUSER; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; private static JAXBContext context; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java index 609ee011e76..14768f9da50 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java @@ -29,8 +29,8 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.rest.client.Client; @@ -63,7 +63,7 @@ public class TestSchemaResource { private static String TABLE1 = "TestSchemaResource1"; private static String TABLE2 = "TestSchemaResource2"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; @@ -76,7 +76,7 @@ public class TestSchemaResource { @Parameterized.Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } public TestSchemaResource(Boolean csrf) { diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java index 47ef0539271..01bd12573b3 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecureRESTServer.java @@ -36,9 +36,9 @@ import javax.ws.rs.core.MediaType; import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Connection; @@ -111,9 +111,9 @@ public class TestSecureRESTServer { HBaseClassTestRule.forClass(TestSecureRESTServer.class); private static final Logger LOG = LoggerFactory.getLogger(TestSecureRESTServer.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST = new HBaseRESTTestingUtility(); - private static MiniHBaseCluster CLUSTER; + private static SingleProcessHBaseCluster CLUSTER; private static final String HOSTNAME = "localhost"; private static final String CLIENT_PRINCIPAL = "client"; @@ -199,7 +199,7 @@ public class TestSecureRESTServer { restServerKeytab); // Start HDFS - TEST_UTIL.startMiniCluster(StartMiniClusterOption.builder() + TEST_UTIL.startMiniCluster(StartTestingClusterOption.builder() .numMasters(1) .numRegionServers(1) .numZkServers(1) diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecurityHeadersFilter.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecurityHeadersFilter.java index 02611dfaf90..a741801df07 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecurityHeadersFilter.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestSecurityHeadersFilter.java @@ -23,7 +23,7 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsEqual.equalTo; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.rest.client.Client; import org.apache.hadoop.hbase.rest.client.Cluster; import org.apache.hadoop.hbase.rest.client.Response; @@ -41,7 +41,7 @@ public class TestSecurityHeadersFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSecurityHeadersFilter.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java index 92091208d1e..b30a276cd45 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java @@ -28,7 +28,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.rest.client.Client; @@ -57,7 +57,7 @@ public class TestStatusResource { private static final byte[] META_REGION_NAME = Bytes.toBytes(TableName.META_TABLE_NAME + ",,1"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java index 0c83a7fdeab..36b2d3db631 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java @@ -30,7 +30,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -73,7 +73,7 @@ public class TestTableResource { private static final int NUM_REGIONS = 4; private static List regionMap; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java index 1d4ed42eed8..80ac72408c8 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java @@ -49,7 +49,7 @@ import javax.xml.parsers.SAXParserFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -93,7 +93,7 @@ public class TestTableScan { private static int expectedRows3; private static Configuration conf; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java index bbd5e082f4c..0efe07fa04a 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java @@ -29,7 +29,7 @@ import javax.ws.rs.core.MediaType; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.rest.client.Client; import org.apache.hadoop.hbase.rest.client.Cluster; import org.apache.hadoop.hbase.rest.client.Response; @@ -55,7 +55,7 @@ public class TestVersionResource { private static final Logger LOG = LoggerFactory.getLogger(TestVersionResource.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private static Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdminRetries.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdminRetries.java index 8bad94d1038..8e8ba36c834 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdminRetries.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdminRetries.java @@ -30,7 +30,7 @@ import java.io.IOException; import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import org.apache.hadoop.hbase.testclassification.RestTests; @@ -56,7 +56,7 @@ public class TestRemoteAdminRetries { private static final int RETRIES = 3; private static final long MAX_TIME = SLEEP_TIME * (RETRIES - 1); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private RemoteAdmin remoteAdmin; private Client client; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteHTableRetries.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteHTableRetries.java index 6338df83f3f..55d6d904eed 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteHTableRetries.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteHTableRetries.java @@ -31,7 +31,7 @@ import java.util.Arrays; import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -59,7 +59,7 @@ public class TestRemoteHTableRetries { private static final int RETRIES = 3; private static final long MAX_TIME = SLEEP_TIME * (RETRIES - 1); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW_1 = Bytes.toBytes("testrow1"); private static final byte[] COLUMN_1 = Bytes.toBytes("a"); diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 99104b99793..d37c8113fbf 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -31,7 +31,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -101,7 +101,7 @@ public class TestRemoteTable { private static final long TS_2 = EnvironmentEdgeManager.currentTime(); private static final long TS_1 = TS_2 - ONE_HOUR; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility(); private RemoteHTable remoteTable; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java index d0a735a9017..512916f483e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java @@ -455,7 +455,7 @@ public final class MetaTableAccessor { * @param maxRows maximum rows to return * @param visitor Visitor invoked against each row. */ - static void scanMeta(Connection connection, @Nullable final byte[] startRow, + public static void scanMeta(Connection connection, @Nullable final byte[] startRow, @Nullable final byte[] stopRow, QueryType type, int maxRows, final ClientMetaTableAccessor.Visitor visitor) throws IOException { scanMeta(connection, startRow, stopRow, type, null, maxRows, visitor); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/AcidGuaranteesTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/AcidGuaranteesTestBase.java index d84dd59a757..0f68e11f0f8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/AcidGuaranteesTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/AcidGuaranteesTestBase.java @@ -43,7 +43,7 @@ import org.apache.hbase.thirdparty.com.google.common.collect.Lists; */ public abstract class AcidGuaranteesTestBase { - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private AcidGuaranteesTestTool tool = new AcidGuaranteesTestTool(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseClusterInterface.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseClusterInterface.java new file mode 100644 index 00000000000..d43e62b5823 --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseClusterInterface.java @@ -0,0 +1,396 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import java.io.Closeable; +import java.io.IOException; +import org.apache.hadoop.conf.Configurable; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.client.RegionInfoBuilder; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.hbase.util.Threads; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; + +/** + * This class defines methods that can help with managing HBase clusters + * from unit tests and system tests. There are 3 types of cluster deployments: + *
    + *
  • SingleProcessHBaseCluster: each server is run in the same JVM in separate threads, + * used by unit tests
  • + *
  • DistributedHBaseCluster: the cluster is pre-deployed, system and integration tests can + * interact with the cluster.
  • + *
  • ProcessBasedLocalHBaseCluster: each server is deployed locally but in separate + * JVMs.
  • + *
+ *

+ * HBaseCluster unifies the way tests interact with the cluster, so that the same test can + * be run against a mini-cluster during unit test execution, or a distributed cluster having + * tens/hundreds of nodes during execution of integration tests. + * + *

+ * HBaseCluster exposes client-side public interfaces to tests, so that tests does not assume + * running in a particular mode. Not all the tests are suitable to be run on an actual cluster, + * and some tests will still need to mock stuff and introspect internal state. For those use + * cases from unit tests, or if more control is needed, you can use the subclasses directly. + * In that sense, this class does not abstract away every interface that + * SingleProcessHBaseCluster or DistributedHBaseCluster provide. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public abstract class HBaseClusterInterface implements Closeable, Configurable { + + protected Configuration conf; + + /** the status of the cluster before we begin */ + protected ClusterMetrics initialClusterStatus; + + /** + * Construct an HBaseCluster + * @param conf Configuration to be used for cluster + */ + public HBaseClusterInterface(Configuration conf) { + setConf(conf); + } + + @Override + public void setConf(Configuration conf) { + this.conf = conf; + } + + @Override + public Configuration getConf() { + return conf; + } + + /** + * Returns a ClusterMetrics for this HBase cluster. + * @see #getInitialClusterMetrics() + */ + public abstract ClusterMetrics getClusterMetrics() throws IOException; + + /** + * Returns a ClusterStatus for this HBase cluster as observed at the + * starting of the HBaseCluster + */ + public ClusterMetrics getInitialClusterMetrics() throws IOException { + return initialClusterStatus; + } + + /** + * Starts a new region server on the given hostname or if this is a mini/local cluster, + * starts a region server locally. + * @param hostname the hostname to start the regionserver on + * @throws IOException if something goes wrong + */ + public abstract void startRegionServer(String hostname, int port) throws IOException; + + /** + * Kills the region server process if this is a distributed cluster, otherwise + * this causes the region server to exit doing basic clean up only. + * @throws IOException if something goes wrong + */ + public abstract void killRegionServer(ServerName serverName) throws IOException; + + /** + * Keeping track of killed servers and being able to check if a particular server was killed makes + * it possible to do fault tolerance testing for dead servers in a deterministic way. A concrete + * example of such case is - killing servers and waiting for all regions of a particular table + * to be assigned. We can check for server column in META table and that its value is not one + * of the killed servers. + */ + public abstract boolean isKilledRS(ServerName serverName); + + /** + * Stops the given region server, by attempting a gradual stop. + * @throws IOException if something goes wrong + */ + public abstract void stopRegionServer(ServerName serverName) throws IOException; + + /** + * Wait for the specified region server to join the cluster + * @throws IOException if something goes wrong or timeout occurs + */ + public void waitForRegionServerToStart(String hostname, int port, long timeout) + throws IOException { + long start = EnvironmentEdgeManager.currentTime(); + while ((EnvironmentEdgeManager.currentTime() - start) < timeout) { + for (ServerName server : getClusterMetrics().getLiveServerMetrics().keySet()) { + if (server.getHostname().equals(hostname) && server.getPort() == port) { + return; + } + } + Threads.sleep(100); + } + throw new IOException("did timeout " + timeout + "ms waiting for region server to start: " + + hostname); + } + + /** + * Wait for the specified region server to stop the thread / process. + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForRegionServerToStop(ServerName serverName, long timeout) + throws IOException; + + /** + * Suspend the region server + * @param serverName the hostname to suspend the regionserver on + * @throws IOException if something goes wrong + */ + public abstract void suspendRegionServer(ServerName serverName) throws IOException; + + /** + * Resume the region server + * @param serverName the hostname to resume the regionserver on + * @throws IOException if something goes wrong + */ + public abstract void resumeRegionServer(ServerName serverName) throws IOException; + + /** + * Starts a new zookeeper node on the given hostname or if this is a mini/local cluster, + * silently logs warning message. + * @param hostname the hostname to start the regionserver on + * @throws IOException if something goes wrong + */ + public abstract void startZkNode(String hostname, int port) throws IOException; + + /** + * Kills the zookeeper node process if this is a distributed cluster, otherwise, + * this causes master to exit doing basic clean up only. + * @throws IOException if something goes wrong + */ + public abstract void killZkNode(ServerName serverName) throws IOException; + + /** + * Stops the region zookeeper if this is a distributed cluster, otherwise + * silently logs warning message. + * @throws IOException if something goes wrong + */ + public abstract void stopZkNode(ServerName serverName) throws IOException; + + /** + * Wait for the specified zookeeper node to join the cluster + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForZkNodeToStart(ServerName serverName, long timeout) + throws IOException; + + /** + * Wait for the specified zookeeper node to stop the thread / process. + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForZkNodeToStop(ServerName serverName, long timeout) + throws IOException; + + /** + * Starts a new datanode on the given hostname or if this is a mini/local cluster, + * silently logs warning message. + * @throws IOException if something goes wrong + */ + public abstract void startDataNode(ServerName serverName) throws IOException; + + /** + * Kills the datanode process if this is a distributed cluster, otherwise, + * this causes master to exit doing basic clean up only. + * @throws IOException if something goes wrong + */ + public abstract void killDataNode(ServerName serverName) throws IOException; + + /** + * Stops the datanode if this is a distributed cluster, otherwise + * silently logs warning message. + * @throws IOException if something goes wrong + */ + public abstract void stopDataNode(ServerName serverName) throws IOException; + + /** + * Wait for the specified datanode to join the cluster + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForDataNodeToStart(ServerName serverName, long timeout) + throws IOException; + + /** + * Wait for the specified datanode to stop the thread / process. + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForDataNodeToStop(ServerName serverName, long timeout) + throws IOException; + + /** + * Starts a new namenode on the given hostname or if this is a mini/local cluster, silently logs + * warning message. + * @throws IOException if something goes wrong + */ + public abstract void startNameNode(ServerName serverName) throws IOException; + + /** + * Kills the namenode process if this is a distributed cluster, otherwise, this causes master to + * exit doing basic clean up only. + * @throws IOException if something goes wrong + */ + public abstract void killNameNode(ServerName serverName) throws IOException; + + /** + * Stops the namenode if this is a distributed cluster, otherwise silently logs warning message. + * @throws IOException if something goes wrong + */ + public abstract void stopNameNode(ServerName serverName) throws IOException; + + /** + * Wait for the specified namenode to join the cluster + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForNameNodeToStart(ServerName serverName, long timeout) + throws IOException; + + /** + * Wait for the specified namenode to stop + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForNameNodeToStop(ServerName serverName, long timeout) + throws IOException; + + /** + * Starts a new master on the given hostname or if this is a mini/local cluster, + * starts a master locally. + * @param hostname the hostname to start the master on + * @throws IOException if something goes wrong + */ + public abstract void startMaster(String hostname, int port) throws IOException; + + /** + * Kills the master process if this is a distributed cluster, otherwise, + * this causes master to exit doing basic clean up only. + * @throws IOException if something goes wrong + */ + public abstract void killMaster(ServerName serverName) throws IOException; + + /** + * Stops the given master, by attempting a gradual stop. + * @throws IOException if something goes wrong + */ + public abstract void stopMaster(ServerName serverName) throws IOException; + + /** + * Wait for the specified master to stop the thread / process. + * @throws IOException if something goes wrong or timeout occurs + */ + public abstract void waitForMasterToStop(ServerName serverName, long timeout) + throws IOException; + + /** + * Blocks until there is an active master and that master has completed + * initialization. + * + * @return true if an active master becomes available. false if there are no + * masters left. + * @throws IOException if something goes wrong or timeout occurs + */ + public boolean waitForActiveAndReadyMaster() + throws IOException { + return waitForActiveAndReadyMaster(Long.MAX_VALUE); + } + + /** + * Blocks until there is an active master and that master has completed + * initialization. + * @param timeout the timeout limit in ms + * @return true if an active master becomes available. false if there are no + * masters left. + */ + public abstract boolean waitForActiveAndReadyMaster(long timeout) + throws IOException; + + /** + * Wait for HBase Cluster to shut down. + */ + public abstract void waitUntilShutDown() throws IOException; + + /** + * Shut down the HBase cluster + */ + public abstract void shutdown() throws IOException; + + /** + * Restores the cluster to it's initial state if this is a real cluster, + * otherwise does nothing. + * This is a best effort restore. If the servers are not reachable, or insufficient + * permissions, etc. restoration might be partial. + * @return whether restoration is complete + */ + public boolean restoreInitialStatus() throws IOException { + return restoreClusterMetrics(getInitialClusterMetrics()); + } + + /** + * Restores the cluster to given state if this is a real cluster, + * otherwise does nothing. + * This is a best effort restore. If the servers are not reachable, or insufficient + * permissions, etc. restoration might be partial. + * @return whether restoration is complete + */ + public boolean restoreClusterMetrics(ClusterMetrics desiredStatus) throws IOException { + return true; + } + + /** + * Get the ServerName of region server serving the first hbase:meta region + */ + public ServerName getServerHoldingMeta() throws IOException { + return getServerHoldingRegion(TableName.META_TABLE_NAME, + RegionInfoBuilder.FIRST_META_REGIONINFO.getRegionName()); + } + + /** + * Get the ServerName of region server serving the specified region + * @param regionName Name of the region in bytes + * @param tn Table name that has the region. + * @return ServerName that hosts the region or null + */ + public abstract ServerName getServerHoldingRegion(final TableName tn, byte[] regionName) + throws IOException; + + /** + * @return whether we are interacting with a distributed cluster as opposed to an + * in-process mini/local cluster. + */ + public boolean isDistributedCluster() { + return false; + } + + /** + * Closes all the resources held open for this cluster. Note that this call does not shutdown + * the cluster. + * @see #shutdown() + */ + @Override + public abstract void close() throws IOException; + + /** + * Wait for the namenode. + * + * @throws InterruptedException + */ + public void waitForNamenodeAvailable() throws InterruptedException { + } + + public void waitForDatanodesRegistered(int nbDN) throws Exception { + } +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java new file mode 100644 index 00000000000..1979732861d --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java @@ -0,0 +1,4348 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import edu.umd.cs.findbugs.annotations.Nullable; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.net.BindException; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.UnknownHostException; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NavigableSet; +import java.util.Properties; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BooleanSupplier; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; +import org.apache.hadoop.hbase.Waiter.Predicate; +import org.apache.hadoop.hbase.client.Admin; +import org.apache.hadoop.hbase.client.AsyncClusterConnection; +import org.apache.hadoop.hbase.client.BufferedMutator; +import org.apache.hadoop.hbase.client.ClusterConnectionFactory; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; +import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; +import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.client.ConnectionFactory; +import org.apache.hadoop.hbase.client.Consistency; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Hbck; +import org.apache.hadoop.hbase.client.MasterRegistry; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.RegionInfo; +import org.apache.hadoop.hbase.client.RegionInfoBuilder; +import org.apache.hadoop.hbase.client.RegionLocator; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.Scan.ReadType; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.client.TableDescriptor; +import org.apache.hadoop.hbase.client.TableDescriptorBuilder; +import org.apache.hadoop.hbase.client.TableState; +import org.apache.hadoop.hbase.fs.HFileSystem; +import org.apache.hadoop.hbase.io.compress.Compression; +import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; +import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; +import org.apache.hadoop.hbase.io.hfile.BlockCache; +import org.apache.hadoop.hbase.io.hfile.ChecksumUtil; +import org.apache.hadoop.hbase.io.hfile.HFile; +import org.apache.hadoop.hbase.ipc.RpcServerInterface; +import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; +import org.apache.hadoop.hbase.logging.Log4jUtils; +import org.apache.hadoop.hbase.mapreduce.MapreduceTestingShim; +import org.apache.hadoop.hbase.master.HMaster; +import org.apache.hadoop.hbase.master.RegionState; +import org.apache.hadoop.hbase.master.ServerManager; +import org.apache.hadoop.hbase.master.assignment.AssignmentManager; +import org.apache.hadoop.hbase.master.assignment.AssignmentTestingUtil; +import org.apache.hadoop.hbase.master.assignment.RegionStateStore; +import org.apache.hadoop.hbase.master.assignment.RegionStates; +import org.apache.hadoop.hbase.mob.MobFileCache; +import org.apache.hadoop.hbase.regionserver.BloomType; +import org.apache.hadoop.hbase.regionserver.ChunkCreator; +import org.apache.hadoop.hbase.regionserver.HRegion; +import org.apache.hadoop.hbase.regionserver.HRegionServer; +import org.apache.hadoop.hbase.regionserver.HStore; +import org.apache.hadoop.hbase.regionserver.InternalScanner; +import org.apache.hadoop.hbase.regionserver.MemStoreLAB; +import org.apache.hadoop.hbase.regionserver.Region; +import org.apache.hadoop.hbase.regionserver.RegionScanner; +import org.apache.hadoop.hbase.regionserver.RegionServerServices; +import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException; +import org.apache.hadoop.hbase.security.HBaseKerberosUtils; +import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hbase.security.visibility.VisibilityLabelsCache; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.CommonFSUtils; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.hbase.util.FSUtils; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; +import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.hadoop.hbase.util.ReflectionUtils; +import org.apache.hadoop.hbase.util.RegionSplitter; +import org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm; +import org.apache.hadoop.hbase.util.RetryCounter; +import org.apache.hadoop.hbase.util.Threads; +import org.apache.hadoop.hbase.wal.WAL; +import org.apache.hadoop.hbase.wal.WALFactory; +import org.apache.hadoop.hbase.zookeeper.EmptyWatcher; +import org.apache.hadoop.hbase.zookeeper.ZKConfig; +import org.apache.hadoop.hbase.zookeeper.ZKWatcher; +import org.apache.hadoop.hdfs.DFSClient; +import org.apache.hadoop.hdfs.DistributedFileSystem; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream; +import org.apache.hadoop.mapred.JobConf; +import org.apache.hadoop.mapred.MiniMRCluster; +import org.apache.hadoop.mapred.TaskLog; +import org.apache.hadoop.minikdc.MiniKdc; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; +import org.apache.zookeeper.WatchedEvent; +import org.apache.zookeeper.ZooKeeper; +import org.apache.zookeeper.ZooKeeper.States; + +import org.apache.hbase.thirdparty.com.google.common.io.Closeables; + +import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; + +/** + * Facility for testing HBase. Replacement for + * old HBaseTestCase and HBaseClusterTestCase functionality. + * Create an instance and keep it around testing HBase. This class is + * meant to be your one-stop shop for anything you might need testing. Manages + * one cluster at a time only. Managed cluster can be an in-process + * {@link SingleProcessHBaseCluster}, or a deployed cluster of type {@code DistributedHBaseCluster}. + * Not all methods work with the real cluster. + * Depends on log4j being on classpath and + * hbase-site.xml for logging and test-run configuration. It does not set + * logging levels. + * In the configuration properties, default values for master-info-port and + * region-server-port are overridden such that a random port will be assigned (thus + * avoiding port contention if another local HBase instance is already running). + *

To preserve test data directories, pass the system property "hbase.testing.preserve.testdir" + * setting it to true. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public class HBaseTestingUtil extends HBaseZKTestingUtil { + + /** + * System property key to get test directory value. Name is as it is because mini dfs has + * hard-codings to put test data here. It should NOT be used directly in HBase, as it's a property + * used in mini dfs. + * @deprecated since 2.0.0 and will be removed in 3.0.0. Can be used only with mini dfs. + * @see HBASE-19410 + */ + @Deprecated + private static final String TEST_DIRECTORY_KEY = "test.build.data"; + + public static final String REGIONS_PER_SERVER_KEY = "hbase.test.regions-per-server"; + /** + * The default number of regions per regionserver when creating a pre-split + * table. + */ + public static final int DEFAULT_REGIONS_PER_SERVER = 3; + + + public static final String PRESPLIT_TEST_TABLE_KEY = "hbase.test.pre-split-table"; + public static final boolean PRESPLIT_TEST_TABLE = true; + + private MiniDFSCluster dfsCluster = null; + + private volatile HBaseClusterInterface hbaseCluster = null; + private MiniMRCluster mrCluster = null; + + /** If there is a mini cluster running for this testing utility instance. */ + private volatile boolean miniClusterRunning; + + private String hadoopLogDir; + + /** Directory on test filesystem where we put the data for this instance of + * HBaseTestingUtility*/ + private Path dataTestDirOnTestFS = null; + + private final AtomicReference asyncConnection = new AtomicReference<>(); + + /** Filesystem URI used for map-reduce mini-cluster setup */ + private static String FS_URI; + + /** This is for unit tests parameterized with a single boolean. */ + public static final List MEMSTORETS_TAGS_PARAMETRIZED = memStoreTSAndTagsCombination(); + + /** + * Checks to see if a specific port is available. + * + * @param port the port number to check for availability + * @return true if the port is available, or false if not + */ + public static boolean available(int port) { + ServerSocket ss = null; + DatagramSocket ds = null; + try { + ss = new ServerSocket(port); + ss.setReuseAddress(true); + ds = new DatagramSocket(port); + ds.setReuseAddress(true); + return true; + } catch (IOException e) { + // Do nothing + } finally { + if (ds != null) { + ds.close(); + } + + if (ss != null) { + try { + ss.close(); + } catch (IOException e) { + /* should not be thrown */ + } + } + } + + return false; + } + + /** + * Create all combinations of Bloom filters and compression algorithms for + * testing. + */ + private static List bloomAndCompressionCombinations() { + List configurations = new ArrayList<>(); + for (Compression.Algorithm comprAlgo : + HBaseCommonTestingUtil.COMPRESSION_ALGORITHMS) { + for (BloomType bloomType : BloomType.values()) { + configurations.add(new Object[] { comprAlgo, bloomType }); + } + } + return Collections.unmodifiableList(configurations); + } + + /** + * Create combination of memstoreTS and tags + */ + private static List memStoreTSAndTagsCombination() { + List configurations = new ArrayList<>(); + configurations.add(new Object[] { false, false }); + configurations.add(new Object[] { false, true }); + configurations.add(new Object[] { true, false }); + configurations.add(new Object[] { true, true }); + return Collections.unmodifiableList(configurations); + } + + public static List memStoreTSTagsAndOffheapCombination() { + List configurations = new ArrayList<>(); + configurations.add(new Object[] { false, false, true }); + configurations.add(new Object[] { false, false, false }); + configurations.add(new Object[] { false, true, true }); + configurations.add(new Object[] { false, true, false }); + configurations.add(new Object[] { true, false, true }); + configurations.add(new Object[] { true, false, false }); + configurations.add(new Object[] { true, true, true }); + configurations.add(new Object[] { true, true, false }); + return Collections.unmodifiableList(configurations); + } + + public static final Collection BLOOM_AND_COMPRESSION_COMBINATIONS = + bloomAndCompressionCombinations(); + + + /** + *

Create an HBaseTestingUtility using a default configuration. + * + *

Initially, all tmp files are written to a local test data directory. + * Once {@link #startMiniDFSCluster} is called, either directly or via + * {@link #startMiniCluster()}, tmp data will be written to the DFS directory instead. + */ + public HBaseTestingUtil() { + this(HBaseConfiguration.create()); + } + + /** + *

Create an HBaseTestingUtility using a given configuration. + * + *

Initially, all tmp files are written to a local test data directory. + * Once {@link #startMiniDFSCluster} is called, either directly or via + * {@link #startMiniCluster()}, tmp data will be written to the DFS directory instead. + * + * @param conf The configuration to use for further operations + */ + public HBaseTestingUtil(@Nullable Configuration conf) { + super(conf); + + // a hbase checksum verification failure will cause unit tests to fail + ChecksumUtil.generateExceptionForChecksumFailureForTest(true); + + // Save this for when setting default file:// breaks things + if (this.conf.get("fs.defaultFS") != null) { + this.conf.set("original.defaultFS", this.conf.get("fs.defaultFS")); + } + if (this.conf.get(HConstants.HBASE_DIR) != null) { + this.conf.set("original.hbase.dir", this.conf.get(HConstants.HBASE_DIR)); + } + // Every cluster is a local cluster until we start DFS + // Note that conf could be null, but this.conf will not be + String dataTestDir = getDataTestDir().toString(); + this.conf.set("fs.defaultFS","file:///"); + this.conf.set(HConstants.HBASE_DIR, "file://" + dataTestDir); + LOG.debug("Setting {} to {}", HConstants.HBASE_DIR, dataTestDir); + this.conf.setBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE,false); + // If the value for random ports isn't set set it to true, thus making + // tests opt-out for random port assignment + this.conf.setBoolean(LocalHBaseCluster.ASSIGN_RANDOM_PORTS, + this.conf.getBoolean(LocalHBaseCluster.ASSIGN_RANDOM_PORTS, true)); + } + + /** + * Close both the region {@code r} and it's underlying WAL. For use in tests. + */ + public static void closeRegionAndWAL(final Region r) throws IOException { + closeRegionAndWAL((HRegion)r); + } + + /** + * Close both the HRegion {@code r} and it's underlying WAL. For use in tests. + */ + public static void closeRegionAndWAL(final HRegion r) throws IOException { + if (r == null) return; + r.close(); + if (r.getWAL() == null) return; + r.getWAL().close(); + } + + /** + * Returns this classes's instance of {@link Configuration}. Be careful how + * you use the returned Configuration since {@link Connection} instances + * can be shared. The Map of Connections is keyed by the Configuration. If + * say, a Connection was being used against a cluster that had been shutdown, + * see {@link #shutdownMiniCluster()}, then the Connection will no longer + * be wholesome. Rather than use the return direct, its usually best to + * make a copy and use that. Do + * Configuration c = new Configuration(INSTANCE.getConfiguration()); + * @return Instance of Configuration. + */ + @Override + public Configuration getConfiguration() { + return super.getConfiguration(); + } + + public void setHBaseCluster(HBaseClusterInterface hbaseCluster) { + this.hbaseCluster = hbaseCluster; + } + + /** + * Home our data in a dir under {@link #DEFAULT_BASE_TEST_DIRECTORY}. + * Give it a random name so can have many concurrent tests running if + * we need to. It needs to amend the {@link #TEST_DIRECTORY_KEY} + * System property, as it's what minidfscluster bases + * it data dir on. Moding a System property is not the way to do concurrent + * instances -- another instance could grab the temporary + * value unintentionally -- but not anything can do about it at moment; + * single instance only is how the minidfscluster works. + * + * We also create the underlying directory names for + * hadoop.log.dir, mapreduce.cluster.local.dir and hadoop.tmp.dir, and set the values + * in the conf, and as a system property for hadoop.tmp.dir (We do not create them!). + * + * @return The calculated data test build directory, if newly-created. + */ + @Override + protected Path setupDataTestDir() { + Path testPath = super.setupDataTestDir(); + if (null == testPath) { + return null; + } + + createSubDirAndSystemProperty( + "hadoop.log.dir", + testPath, "hadoop-log-dir"); + + // This is defaulted in core-default.xml to /tmp/hadoop-${user.name}, but + // we want our own value to ensure uniqueness on the same machine + createSubDirAndSystemProperty( + "hadoop.tmp.dir", + testPath, "hadoop-tmp-dir"); + + // Read and modified in org.apache.hadoop.mapred.MiniMRCluster + createSubDir( + "mapreduce.cluster.local.dir", + testPath, "mapred-local-dir"); + return testPath; + } + + private void createSubDirAndSystemProperty( + String propertyName, Path parent, String subDirName){ + + String sysValue = System.getProperty(propertyName); + + if (sysValue != null) { + // There is already a value set. So we do nothing but hope + // that there will be no conflicts + LOG.info("System.getProperty(\""+propertyName+"\") already set to: "+ + sysValue + " so I do NOT create it in " + parent); + String confValue = conf.get(propertyName); + if (confValue != null && !confValue.endsWith(sysValue)){ + LOG.warn( + propertyName + " property value differs in configuration and system: "+ + "Configuration="+confValue+" while System="+sysValue+ + " Erasing configuration value by system value." + ); + } + conf.set(propertyName, sysValue); + } else { + // Ok, it's not set, so we create it as a subdirectory + createSubDir(propertyName, parent, subDirName); + System.setProperty(propertyName, conf.get(propertyName)); + } + } + + /** + * @return Where to write test data on the test filesystem; Returns working directory + * for the test filesystem by default + * @see #setupDataTestDirOnTestFS() + * @see #getTestFileSystem() + */ + private Path getBaseTestDirOnTestFS() throws IOException { + FileSystem fs = getTestFileSystem(); + return new Path(fs.getWorkingDirectory(), "test-data"); + } + + /** + * Returns a Path in the test filesystem, obtained from {@link #getTestFileSystem()} + * to write temporary test data. Call this method after setting up the mini dfs cluster + * if the test relies on it. + * @return a unique path in the test filesystem + */ + public Path getDataTestDirOnTestFS() throws IOException { + if (dataTestDirOnTestFS == null) { + setupDataTestDirOnTestFS(); + } + + return dataTestDirOnTestFS; + } + + /** + * Returns a Path in the test filesystem, obtained from {@link #getTestFileSystem()} + * to write temporary test data. Call this method after setting up the mini dfs cluster + * if the test relies on it. + * @return a unique path in the test filesystem + * @param subdirName name of the subdir to create under the base test dir + */ + public Path getDataTestDirOnTestFS(final String subdirName) throws IOException { + return new Path(getDataTestDirOnTestFS(), subdirName); + } + + /** + * Sets up a path in test filesystem to be used by tests. + * Creates a new directory if not already setup. + */ + private void setupDataTestDirOnTestFS() throws IOException { + if (dataTestDirOnTestFS != null) { + LOG.warn("Data test on test fs dir already setup in " + + dataTestDirOnTestFS.toString()); + return; + } + dataTestDirOnTestFS = getNewDataTestDirOnTestFS(); + } + + /** + * Sets up a new path in test filesystem to be used by tests. + */ + private Path getNewDataTestDirOnTestFS() throws IOException { + //The file system can be either local, mini dfs, or if the configuration + //is supplied externally, it can be an external cluster FS. If it is a local + //file system, the tests should use getBaseTestDir, otherwise, we can use + //the working directory, and create a unique sub dir there + FileSystem fs = getTestFileSystem(); + Path newDataTestDir; + String randomStr = getRandomUUID().toString(); + if (fs.getUri().getScheme().equals(FileSystem.getLocal(conf).getUri().getScheme())) { + newDataTestDir = new Path(getDataTestDir(), randomStr); + File dataTestDir = new File(newDataTestDir.toString()); + if (deleteOnExit()) dataTestDir.deleteOnExit(); + } else { + Path base = getBaseTestDirOnTestFS(); + newDataTestDir = new Path(base, randomStr); + if (deleteOnExit()) fs.deleteOnExit(newDataTestDir); + } + return newDataTestDir; + } + + /** + * Cleans the test data directory on the test filesystem. + * @return True if we removed the test dirs + * @throws IOException + */ + public boolean cleanupDataTestDirOnTestFS() throws IOException { + boolean ret = getTestFileSystem().delete(dataTestDirOnTestFS, true); + if (ret) + dataTestDirOnTestFS = null; + return ret; + } + + /** + * Cleans a subdirectory under the test data directory on the test filesystem. + * @return True if we removed child + * @throws IOException + */ + public boolean cleanupDataTestDirOnTestFS(String subdirName) throws IOException { + Path cpath = getDataTestDirOnTestFS(subdirName); + return getTestFileSystem().delete(cpath, true); + } + + /** + * Start a minidfscluster. + * @param servers How many DNs to start. + * @throws Exception + * @see #shutdownMiniDFSCluster() + * @return The mini dfs cluster created. + */ + public MiniDFSCluster startMiniDFSCluster(int servers) throws Exception { + return startMiniDFSCluster(servers, null); + } + + /** + * Start a minidfscluster. + * This is useful if you want to run datanode on distinct hosts for things + * like HDFS block location verification. + * If you start MiniDFSCluster without host names, all instances of the + * datanodes will have the same host name. + * @param hosts hostnames DNs to run on. + * @throws Exception + * @see #shutdownMiniDFSCluster() + * @return The mini dfs cluster created. + */ + public MiniDFSCluster startMiniDFSCluster(final String hosts[]) + throws Exception { + if ( hosts != null && hosts.length != 0) { + return startMiniDFSCluster(hosts.length, hosts); + } else { + return startMiniDFSCluster(1, null); + } + } + + /** + * Start a minidfscluster. + * Can only create one. + * @param servers How many DNs to start. + * @param hosts hostnames DNs to run on. + * @throws Exception + * @see #shutdownMiniDFSCluster() + * @return The mini dfs cluster created. + */ + public MiniDFSCluster startMiniDFSCluster(int servers, final String hosts[]) + throws Exception { + return startMiniDFSCluster(servers, null, hosts); + } + + private void setFs() throws IOException { + if(this.dfsCluster == null){ + LOG.info("Skipping setting fs because dfsCluster is null"); + return; + } + FileSystem fs = this.dfsCluster.getFileSystem(); + CommonFSUtils.setFsDefault(this.conf, new Path(fs.getUri())); + + // re-enable this check with dfs + conf.unset(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE); + } + + public MiniDFSCluster startMiniDFSCluster(int servers, final String racks[], String hosts[]) + throws Exception { + createDirsAndSetProperties(); + EditLogFileOutputStream.setShouldSkipFsyncForTesting(true); + + // Error level to skip some warnings specific to the minicluster. See HBASE-4709 + Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); + Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), + "ERROR"); + + this.dfsCluster = new MiniDFSCluster(0, this.conf, servers, true, true, + true, null, racks, hosts, null); + + // Set this just-started cluster as our filesystem. + setFs(); + + // Wait for the cluster to be totally up + this.dfsCluster.waitClusterUp(); + + //reset the test directory for test file system + dataTestDirOnTestFS = null; + String dataTestDir = getDataTestDir().toString(); + conf.set(HConstants.HBASE_DIR, dataTestDir); + LOG.debug("Setting {} to {}", HConstants.HBASE_DIR, dataTestDir); + + return this.dfsCluster; + } + + public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException { + createDirsAndSetProperties(); + // Error level to skip some warnings specific to the minicluster. See HBASE-4709 + Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); + Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), + "ERROR"); + dfsCluster = new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, + null, null, null); + return dfsCluster; + } + + /** + * This is used before starting HDFS and map-reduce mini-clusters Run something like the below to + * check for the likes of '/tmp' references -- i.e. references outside of the test data dir -- in + * the conf. + *

+   * Configuration conf = TEST_UTIL.getConfiguration();
+   * for (Iterator<Map.Entry<String, String>> i = conf.iterator(); i.hasNext();) {
+   *   Map.Entry<String, String> e = i.next();
+   *   assertFalse(e.getKey() + " " + e.getValue(), e.getValue().contains("/tmp"));
+   * }
+   * 
+ */ + private void createDirsAndSetProperties() throws IOException { + setupClusterTestDir(); + conf.set(TEST_DIRECTORY_KEY, clusterTestDir.getPath()); + System.setProperty(TEST_DIRECTORY_KEY, clusterTestDir.getPath()); + createDirAndSetProperty("test.cache.data"); + createDirAndSetProperty("hadoop.tmp.dir"); + hadoopLogDir = createDirAndSetProperty("hadoop.log.dir"); + createDirAndSetProperty("mapreduce.cluster.local.dir"); + createDirAndSetProperty("mapreduce.cluster.temp.dir"); + enableShortCircuit(); + + Path root = getDataTestDirOnTestFS("hadoop"); + conf.set(MapreduceTestingShim.getMROutputDirProp(), + new Path(root, "mapred-output-dir").toString()); + conf.set("mapreduce.jobtracker.system.dir", new Path(root, "mapred-system-dir").toString()); + conf.set("mapreduce.jobtracker.staging.root.dir", + new Path(root, "mapreduce-jobtracker-staging-root-dir").toString()); + conf.set("mapreduce.job.working.dir", new Path(root, "mapred-working-dir").toString()); + conf.set("yarn.app.mapreduce.am.staging-dir", + new Path(root, "mapreduce-am-staging-root-dir").toString()); + + // Frustrate yarn's and hdfs's attempts at writing /tmp. + // Below is fragile. Make it so we just interpolate any 'tmp' reference. + createDirAndSetProperty("yarn.node-labels.fs-store.root-dir"); + createDirAndSetProperty("yarn.node-attribute.fs-store.root-dir"); + createDirAndSetProperty("yarn.nodemanager.log-dirs"); + createDirAndSetProperty("yarn.nodemanager.remote-app-log-dir"); + createDirAndSetProperty("yarn.timeline-service.entity-group-fs-store.active-dir"); + createDirAndSetProperty("yarn.timeline-service.entity-group-fs-store.done-dir"); + createDirAndSetProperty("yarn.nodemanager.remote-app-log-dir"); + createDirAndSetProperty("dfs.journalnode.edits.dir"); + createDirAndSetProperty("dfs.datanode.shared.file.descriptor.paths"); + createDirAndSetProperty("nfs.dump.dir"); + createDirAndSetProperty("java.io.tmpdir"); + createDirAndSetProperty("dfs.journalnode.edits.dir"); + createDirAndSetProperty("dfs.provided.aliasmap.inmemory.leveldb.dir"); + createDirAndSetProperty("fs.s3a.committer.staging.tmp.path"); + } + + /** + * Check whether the tests should assume NEW_VERSION_BEHAVIOR when creating + * new column families. Default to false. + */ + public boolean isNewVersionBehaviorEnabled(){ + final String propName = "hbase.tests.new.version.behavior"; + String v = System.getProperty(propName); + if (v != null){ + return Boolean.parseBoolean(v); + } + return false; + } + + /** + * Get the HBase setting for dfs.client.read.shortcircuit from the conf or a system property. + * This allows to specify this parameter on the command line. + * If not set, default is true. + */ + public boolean isReadShortCircuitOn(){ + final String propName = "hbase.tests.use.shortcircuit.reads"; + String readOnProp = System.getProperty(propName); + if (readOnProp != null){ + return Boolean.parseBoolean(readOnProp); + } else { + return conf.getBoolean(propName, false); + } + } + + /** Enable the short circuit read, unless configured differently. + * Set both HBase and HDFS settings, including skipping the hdfs checksum checks. + */ + private void enableShortCircuit() { + if (isReadShortCircuitOn()) { + String curUser = System.getProperty("user.name"); + LOG.info("read short circuit is ON for user " + curUser); + // read short circuit, for hdfs + conf.set("dfs.block.local-path-access.user", curUser); + // read short circuit, for hbase + conf.setBoolean("dfs.client.read.shortcircuit", true); + // Skip checking checksum, for the hdfs client and the datanode + conf.setBoolean("dfs.client.read.shortcircuit.skip.checksum", true); + } else { + LOG.info("read short circuit is OFF"); + } + } + + private String createDirAndSetProperty(final String property) { + return createDirAndSetProperty(property, property); + } + + private String createDirAndSetProperty(final String relPath, String property) { + String path = getDataTestDir(relPath).toString(); + System.setProperty(property, path); + conf.set(property, path); + new File(path).mkdirs(); + LOG.info("Setting " + property + " to " + path + " in system properties and HBase conf"); + return path; + } + + /** + * Shuts down instance created by call to {@link #startMiniDFSCluster(int)} + * or does nothing. + * @throws IOException + */ + public void shutdownMiniDFSCluster() throws IOException { + if (this.dfsCluster != null) { + // The below throws an exception per dn, AsynchronousCloseException. + this.dfsCluster.shutdown(); + dfsCluster = null; + dataTestDirOnTestFS = null; + CommonFSUtils.setFsDefault(this.conf, new Path("file:///")); + } + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper where WAL's walDir is created separately. + * All other options will use default values, defined in + * {@link StartTestingClusterOption.Builder}. + * @param createWALDir Whether to create a new WAL directory. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(boolean createWALDir) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .createWALDir(createWALDir).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param createRootDir Whether to create a new root or data directory path. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numSlaves, boolean createRootDir) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numRegionServers(numSlaves).numDataNodes(numSlaves).createRootDir(createRootDir).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param createRootDir Whether to create a new root or data directory path. + * @param createWALDir Whether to create a new WAL directory. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numSlaves, boolean createRootDir, + boolean createWALDir) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numRegionServers(numSlaves).numDataNodes(numSlaves).createRootDir(createRootDir) + .createWALDir(createWALDir).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param createRootDir Whether to create a new root or data directory path. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numSlaves, boolean createRootDir) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numSlaves).createRootDir(createRootDir) + .numDataNodes(numSlaves).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numSlaves) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numSlaves).numDataNodes(numSlaves).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param dataNodeHosts The hostnames of DataNodes to run on. If not null, its size will overwrite + * HDFS data node number. + * @param createRootDir Whether to create a new root or data directory path. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, + boolean createRootDir) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numSlaves).createRootDir(createRootDir) + .numDataNodes(numSlaves).dataNodeHosts(dataNodeHosts).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param dataNodeHosts The hostnames of DataNodes to run on. If not null, its size will overwrite + * HDFS data node number. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numSlaves) + .numDataNodes(numSlaves).dataNodeHosts(dataNodeHosts).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @param numDataNodes Number of datanodes. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numRegionServers).numDataNodes(numDataNodes) + .build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numSlaves Slave node number, for both HBase region server and HDFS data node. + * @param dataNodeHosts The hostnames of DataNodes to run on. If not null, its size will overwrite + * HDFS data node number. + * @param masterClass The class to use as HMaster, or null for default. + * @param rsClass The class to use as HRegionServer, or null for default. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, + Class masterClass, + Class rsClass) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).masterClass(masterClass) + .numRegionServers(numSlaves).rsClass(rsClass) + .numDataNodes(numSlaves).dataNodeHosts(dataNodeHosts) + .build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @param numDataNodes Number of datanodes. + * @param dataNodeHosts The hostnames of DataNodes to run on. If not null, its size will overwrite + * HDFS data node number. + * @param masterClass The class to use as HMaster, or null for default. + * @param rsClass The class to use as HRegionServer, or null for default. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, + String[] dataNodeHosts, Class masterClass, + Class rsClass) + throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).masterClass(masterClass) + .numRegionServers(numRegionServers).rsClass(rsClass) + .numDataNodes(numDataNodes).dataNodeHosts(dataNodeHosts) + .build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, + * defined in {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @param numDataNodes Number of datanodes. + * @param dataNodeHosts The hostnames of DataNodes to run on. If not null, its size will overwrite + * HDFS data node number. + * @param masterClass The class to use as HMaster, or null for default. + * @param rsClass The class to use as HRegionServer, or null for default. + * @param createRootDir Whether to create a new root or data directory path. + * @param createWALDir Whether to create a new WAL directory. + * @return The mini HBase cluster created. + * @see #shutdownMiniCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniCluster(StartTestingClusterOption)} instead. + * @see #startMiniCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, + String[] dataNodeHosts, Class masterClass, + Class rsClass, boolean createRootDir, + boolean createWALDir) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).masterClass(masterClass) + .numRegionServers(numRegionServers).rsClass(rsClass) + .numDataNodes(numDataNodes).dataNodeHosts(dataNodeHosts) + .createRootDir(createRootDir).createWALDir(createWALDir) + .build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs and zookeeper clusters with given slave node number. All + * other options will use default values, defined in {@link StartTestingClusterOption.Builder}. + * @param numSlaves slave node number, for both HBase region server and HDFS data node. + * @see #startMiniCluster(StartTestingClusterOption option) + * @see #shutdownMiniDFSCluster() + */ + public SingleProcessHBaseCluster startMiniCluster(int numSlaves) throws Exception { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numRegionServers(numSlaves).numDataNodes(numSlaves).build(); + return startMiniCluster(option); + } + + /** + * Start up a minicluster of hbase, dfs and zookeeper all using default options. + * Option default value can be found in {@link StartTestingClusterOption.Builder}. + * @see #startMiniCluster(StartTestingClusterOption option) + * @see #shutdownMiniDFSCluster() + */ + public SingleProcessHBaseCluster startMiniCluster() throws Exception { + return startMiniCluster(StartTestingClusterOption.builder().build()); + } + + /** + * Start up a mini cluster of hbase, optionally dfs and zookeeper if needed. + * It modifies Configuration. It homes the cluster data directory under a random + * subdirectory in a directory under System property test.build.data, to be cleaned up on exit. + * @see #shutdownMiniDFSCluster() + */ + public SingleProcessHBaseCluster startMiniCluster(StartTestingClusterOption option) throws Exception { + LOG.info("Starting up minicluster with option: {}", option); + + // If we already put up a cluster, fail. + if (miniClusterRunning) { + throw new IllegalStateException("A mini-cluster is already running"); + } + miniClusterRunning = true; + + setupClusterTestDir(); + System.setProperty(TEST_DIRECTORY_KEY, this.clusterTestDir.getPath()); + + // Bring up mini dfs cluster. This spews a bunch of warnings about missing + // scheme. Complaints are 'Scheme is undefined for build/test/data/dfs/name1'. + if (dfsCluster == null) { + LOG.info("STARTING DFS"); + dfsCluster = startMiniDFSCluster(option.getNumDataNodes(), option.getDataNodeHosts()); + } else { + LOG.info("NOT STARTING DFS"); + } + + // Start up a zk cluster. + if (getZkCluster() == null) { + startMiniZKCluster(option.getNumZkServers()); + } + + // Start the MiniHBaseCluster + return startMiniHBaseCluster(option); + } + + /** + * Starts up mini hbase cluster. Usually you won't want this. You'll usually want + * {@link #startMiniCluster()}. This is useful when doing stepped startup of clusters. + * @return Reference to the hbase mini hbase cluster. + * @see #startMiniCluster(StartTestingClusterOption) + * @see #shutdownMiniHBaseCluster() + */ + public SingleProcessHBaseCluster startMiniHBaseCluster(StartTestingClusterOption option) + throws IOException, InterruptedException { + // Now do the mini hbase cluster. Set the hbase.rootdir in config. + createRootDir(option.isCreateRootDir()); + if (option.isCreateWALDir()) { + createWALRootDir(); + } + // Set the hbase.fs.tmp.dir config to make sure that we have some default value. This is + // for tests that do not read hbase-defaults.xml + setHBaseFsTmpDir(); + + // These settings will make the server waits until this exact number of + // regions servers are connected. + if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1) == -1) { + conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, option.getNumRegionServers()); + } + if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, -1) == -1) { + conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers()); + } + + // Avoid log flooded with chore execution time, see HBASE-24646 for more details. + Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO"); + + Configuration c = new Configuration(this.conf); + this.hbaseCluster = new SingleProcessHBaseCluster(c, option.getNumMasters(), + option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(), + option.getMasterClass(), option.getRsClass()); + // Populate the master address configuration from mini cluster configuration. + conf.set(HConstants.MASTER_ADDRS_KEY, MasterRegistry.getMasterAddr(c)); + // Don't leave here till we've done a successful scan of the hbase:meta + try (Table t = getConnection().getTable(TableName.META_TABLE_NAME); + ResultScanner s = t.getScanner(new Scan())) { + for (;;) { + if (s.next() == null) { + break; + } + } + } + + + getAdmin(); // create immediately the hbaseAdmin + LOG.info("Minicluster is up; activeMaster={}", getHBaseCluster().getMaster()); + + return (SingleProcessHBaseCluster) hbaseCluster; + } + + /** + * Starts up mini hbase cluster using default options. + * Default options can be found in {@link StartTestingClusterOption.Builder}. + * @see #startMiniHBaseCluster(StartTestingClusterOption) + * @see #shutdownMiniHBaseCluster() + */ + public SingleProcessHBaseCluster startMiniHBaseCluster() throws IOException, InterruptedException { + return startMiniHBaseCluster(StartTestingClusterOption.builder().build()); + } + + /** + * Starts up mini hbase cluster. Usually you won't want this. You'll usually want + * {@link #startMiniCluster()}. All other options will use default values, defined in + * {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @return The mini HBase cluster created. + * @see #shutdownMiniHBaseCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniHBaseCluster(StartTestingClusterOption)} instead. + * @see #startMiniHBaseCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers) + throws IOException, InterruptedException { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numRegionServers).build(); + return startMiniHBaseCluster(option); + } + + /** + * Starts up mini hbase cluster. Usually you won't want this. You'll usually want + * {@link #startMiniCluster()}. All other options will use default values, defined in + * {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @param rsPorts Ports that RegionServer should use. + * @return The mini HBase cluster created. + * @see #shutdownMiniHBaseCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniHBaseCluster(StartTestingClusterOption)} instead. + * @see #startMiniHBaseCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers, + List rsPorts) throws IOException, InterruptedException { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).numRegionServers(numRegionServers).rsPorts(rsPorts).build(); + return startMiniHBaseCluster(option); + } + + /** + * Starts up mini hbase cluster. Usually you won't want this. You'll usually want + * {@link #startMiniCluster()}. All other options will use default values, defined in + * {@link StartTestingClusterOption.Builder}. + * @param numMasters Master node number. + * @param numRegionServers Number of region servers. + * @param rsPorts Ports that RegionServer should use. + * @param masterClass The class to use as HMaster, or null for default. + * @param rsClass The class to use as HRegionServer, or null for default. + * @param createRootDir Whether to create a new root or data directory path. + * @param createWALDir Whether to create a new WAL directory. + * @return The mini HBase cluster created. + * @see #shutdownMiniHBaseCluster() + * @deprecated since 2.2.0 and will be removed in 4.0.0. Use + * {@link #startMiniHBaseCluster(StartTestingClusterOption)} instead. + * @see #startMiniHBaseCluster(StartTestingClusterOption) + * @see HBASE-21071 + */ + @Deprecated + public SingleProcessHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers, + List rsPorts, Class masterClass, + Class rsClass, + boolean createRootDir, boolean createWALDir) throws IOException, InterruptedException { + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numMasters(numMasters).masterClass(masterClass) + .numRegionServers(numRegionServers).rsClass(rsClass).rsPorts(rsPorts) + .createRootDir(createRootDir).createWALDir(createWALDir).build(); + return startMiniHBaseCluster(option); + } + + /** + * Starts the hbase cluster up again after shutting it down previously in a + * test. Use this if you want to keep dfs/zk up and just stop/start hbase. + * @param servers number of region servers + */ + public void restartHBaseCluster(int servers) throws IOException, InterruptedException { + this.restartHBaseCluster(servers, null); + } + + public void restartHBaseCluster(int servers, List ports) + throws IOException, InterruptedException { + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(servers).rsPorts(ports).build(); + restartHBaseCluster(option); + invalidateConnection(); + } + + public void restartHBaseCluster(StartTestingClusterOption option) + throws IOException, InterruptedException { + closeConnection(); + this.hbaseCluster = new SingleProcessHBaseCluster(this.conf, option.getNumMasters(), + option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(), + option.getMasterClass(), option.getRsClass()); + // Don't leave here till we've done a successful scan of the hbase:meta + Connection conn = ConnectionFactory.createConnection(this.conf); + Table t = conn.getTable(TableName.META_TABLE_NAME); + ResultScanner s = t.getScanner(new Scan()); + while (s.next() != null) { + // do nothing + } + LOG.info("HBase has been restarted"); + s.close(); + t.close(); + conn.close(); + } + + /** + * @return Current mini hbase cluster. Only has something in it after a call + * to {@link #startMiniCluster()}. + * @see #startMiniCluster() + */ + public SingleProcessHBaseCluster getMiniHBaseCluster() { + if (this.hbaseCluster == null || this.hbaseCluster instanceof SingleProcessHBaseCluster) { + return (SingleProcessHBaseCluster)this.hbaseCluster; + } + throw new RuntimeException(hbaseCluster + " not an instance of " + + SingleProcessHBaseCluster.class.getName()); + } + + /** + * Stops mini hbase, zk, and hdfs clusters. + * @see #startMiniCluster(int) + */ + public void shutdownMiniCluster() throws IOException { + LOG.info("Shutting down minicluster"); + shutdownMiniHBaseCluster(); + shutdownMiniDFSCluster(); + shutdownMiniZKCluster(); + + cleanupTestDir(); + miniClusterRunning = false; + LOG.info("Minicluster is down"); + } + + /** + * Shutdown HBase mini cluster.Does not shutdown zk or dfs if running. + * @throws java.io.IOException in case command is unsuccessful + */ + public void shutdownMiniHBaseCluster() throws IOException { + cleanup(); + if (this.hbaseCluster != null) { + this.hbaseCluster.shutdown(); + // Wait till hbase is down before going on to shutdown zk. + this.hbaseCluster.waitUntilShutDown(); + this.hbaseCluster = null; + } + if (zooKeeperWatcher != null) { + zooKeeperWatcher.close(); + zooKeeperWatcher = null; + } + } + + /** + * Abruptly Shutdown HBase mini cluster. Does not shutdown zk or dfs if running. + * @throws java.io.IOException throws in case command is unsuccessful + */ + public void killMiniHBaseCluster() throws IOException { + cleanup(); + if (this.hbaseCluster != null) { + getMiniHBaseCluster().killAll(); + this.hbaseCluster = null; + } + if (zooKeeperWatcher != null) { + zooKeeperWatcher.close(); + zooKeeperWatcher = null; + } + } + + // close hbase admin, close current connection and reset MIN MAX configs for RS. + private void cleanup() throws IOException { + closeConnection(); + // unset the configuration for MIN and MAX RS to start + conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1); + conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, -1); + } + + /** + * Returns the path to the default root dir the minicluster uses. If create + * is true, a new root directory path is fetched irrespective of whether it has been fetched + * before or not. If false, previous path is used. + * Note: this does not cause the root dir to be created. + * @return Fully qualified path for the default hbase root dir + * @throws IOException + */ + public Path getDefaultRootDirPath(boolean create) throws IOException { + if (!create) { + return getDataTestDirOnTestFS(); + } else { + return getNewDataTestDirOnTestFS(); + } + } + + /** + * Same as {{@link HBaseTestingUtil#getDefaultRootDirPath(boolean create)} + * except that create flag is false. + * Note: this does not cause the root dir to be created. + * @return Fully qualified path for the default hbase root dir + * @throws IOException + */ + public Path getDefaultRootDirPath() throws IOException { + return getDefaultRootDirPath(false); + } + + /** + * Creates an hbase rootdir in user home directory. Also creates hbase + * version file. Normally you won't make use of this method. Root hbasedir + * is created for you as part of mini cluster startup. You'd only use this + * method if you were doing manual operation. + * @param create This flag decides whether to get a new + * root or data directory path or not, if it has been fetched already. + * Note : Directory will be made irrespective of whether path has been fetched or not. + * If directory already exists, it will be overwritten + * @return Fully qualified path to hbase root dir + * @throws IOException + */ + public Path createRootDir(boolean create) throws IOException { + FileSystem fs = FileSystem.get(this.conf); + Path hbaseRootdir = getDefaultRootDirPath(create); + CommonFSUtils.setRootDir(this.conf, hbaseRootdir); + fs.mkdirs(hbaseRootdir); + FSUtils.setVersion(fs, hbaseRootdir); + return hbaseRootdir; + } + + /** + * Same as {@link HBaseTestingUtil#createRootDir(boolean create)} + * except that create flag is false. + * @return Fully qualified path to hbase root dir + * @throws IOException + */ + public Path createRootDir() throws IOException { + return createRootDir(false); + } + + /** + * Creates a hbase walDir in the user's home directory. + * Normally you won't make use of this method. Root hbaseWALDir + * is created for you as part of mini cluster startup. You'd only use this + * method if you were doing manual operation. + * + * @return Fully qualified path to hbase root dir + * @throws IOException + */ + public Path createWALRootDir() throws IOException { + FileSystem fs = FileSystem.get(this.conf); + Path walDir = getNewDataTestDirOnTestFS(); + CommonFSUtils.setWALRootDir(this.conf, walDir); + fs.mkdirs(walDir); + return walDir; + } + + private void setHBaseFsTmpDir() throws IOException { + String hbaseFsTmpDirInString = this.conf.get("hbase.fs.tmp.dir"); + if (hbaseFsTmpDirInString == null) { + this.conf.set("hbase.fs.tmp.dir", getDataTestDirOnTestFS("hbase-staging").toString()); + LOG.info("Setting hbase.fs.tmp.dir to " + this.conf.get("hbase.fs.tmp.dir")); + } else { + LOG.info("The hbase.fs.tmp.dir is set to " + hbaseFsTmpDirInString); + } + } + + /** + * Flushes all caches in the mini hbase cluster + * @throws IOException + */ + public void flush() throws IOException { + getMiniHBaseCluster().flushcache(); + } + + /** + * Flushes all caches in the mini hbase cluster + * @throws IOException + */ + public void flush(TableName tableName) throws IOException { + getMiniHBaseCluster().flushcache(tableName); + } + + /** + * Compact all regions in the mini hbase cluster + * @throws IOException + */ + public void compact(boolean major) throws IOException { + getMiniHBaseCluster().compact(major); + } + + /** + * Compact all of a table's reagion in the mini hbase cluster + * @throws IOException + */ + public void compact(TableName tableName, boolean major) throws IOException { + getMiniHBaseCluster().compact(tableName, major); + } + + /** + * Create a table. + * @param tableName + * @param family + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableName tableName, String family) + throws IOException{ + return createTable(tableName, new String[]{family}); + } + + /** + * Create a table. + * @param tableName + * @param families + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableName tableName, String[] families) + throws IOException { + List fams = new ArrayList<>(families.length); + for (String family : families) { + fams.add(Bytes.toBytes(family)); + } + return createTable(tableName, fams.toArray(new byte[0][])); + } + + /** + * Create a table. + * @param tableName + * @param family + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableName tableName, byte[] family) + throws IOException{ + return createTable(tableName, new byte[][]{family}); + } + + /** + * Create a table with multiple regions. + * @param tableName + * @param family + * @param numRegions + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createMultiRegionTable(TableName tableName, byte[] family, int numRegions) + throws IOException { + if (numRegions < 3) throw new IOException("Must create at least 3 regions"); + byte[] startKey = Bytes.toBytes("aaaaa"); + byte[] endKey = Bytes.toBytes("zzzzz"); + byte[][] splitKeys = Bytes.split(startKey, endKey, numRegions - 3); + + return createTable(tableName, new byte[][] { family }, splitKeys); + } + + /** + * Create a table. + * @param tableName + * @param families + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableName tableName, byte[][] families) + throws IOException { + return createTable(tableName, families, (byte[][]) null); + } + + /** + * Create a table with multiple regions. + * @param tableName + * @param families + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createMultiRegionTable(TableName tableName, byte[][] families) throws IOException { + return createTable(tableName, families, KEYS_FOR_HBA_CREATE_TABLE); + } + + /** + * Create a table with multiple regions. + * @param tableName + * @param replicaCount replica count. + * @param families + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createMultiRegionTable(TableName tableName, int replicaCount, byte[][] families) + throws IOException { + return createTable(tableName, families, KEYS_FOR_HBA_CREATE_TABLE, replicaCount); + } + + /** + * Create a table. + * @param tableName + * @param families + * @param splitKeys + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys) + throws IOException { + return createTable(tableName, families, splitKeys, 1, new Configuration(getConfiguration())); + } + + /** + * Create a table. + * @param tableName the table name + * @param families the families + * @param splitKeys the splitkeys + * @param replicaCount the region replica count + * @return A Table instance for the created table. + * @throws IOException throws IOException + */ + public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys, + int replicaCount) throws IOException { + return createTable(tableName, families, splitKeys, replicaCount, + new Configuration(getConfiguration())); + } + + public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[] startKey, + byte[] endKey, int numRegions) throws IOException { + TableDescriptor desc = createTableDescriptor(tableName, families, numVersions); + + getAdmin().createTable(desc, startKey, endKey, numRegions); + // HBaseAdmin only waits for regions to appear in hbase:meta we + // should wait until they are assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + /** + * Create a table. + * @param c Configuration to use + * @return A Table instance for the created table. + */ + public Table createTable(TableDescriptor htd, byte[][] families, Configuration c) + throws IOException { + return createTable(htd, families, null, c); + } + + /** + * Create a table. + * @param htd table descriptor + * @param families array of column families + * @param splitKeys array of split keys + * @param c Configuration to use + * @return A Table instance for the created table. + * @throws IOException if getAdmin or createTable fails + */ + public Table createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, + Configuration c) throws IOException { + // Disable blooms (they are on by default as of 0.95) but we disable them here because + // tests have hard coded counts of what to expect in block cache, etc., and blooms being + // on is interfering. + return createTable(htd, families, splitKeys, BloomType.NONE, HConstants.DEFAULT_BLOCKSIZE, c); + } + + /** + * Create a table. + * @param htd table descriptor + * @param families array of column families + * @param splitKeys array of split keys + * @param type Bloom type + * @param blockSize block size + * @param c Configuration to use + * @return A Table instance for the created table. + * @throws IOException if getAdmin or createTable fails + */ + + public Table createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, + BloomType type, int blockSize, Configuration c) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(htd); + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfdb = ColumnFamilyDescriptorBuilder.newBuilder(family) + .setBloomFilterType(type) + .setBlocksize(blockSize); + if (isNewVersionBehaviorEnabled()) { + cfdb.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfdb.build()); + } + TableDescriptor td = builder.build(); + if (splitKeys != null) { + getAdmin().createTable(td, splitKeys); + } else { + getAdmin().createTable(td); + } + // HBaseAdmin only waits for regions to appear in hbase:meta + // we should wait until they are assigned + waitUntilAllRegionsAssigned(td.getTableName()); + return getConnection().getTable(td.getTableName()); + } + + /** + * Create a table. + * @param htd table descriptor + * @param splitRows array of split keys + * @return A Table instance for the created table. + * @throws IOException + */ + public Table createTable(TableDescriptor htd, byte[][] splitRows) + throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(htd); + if (isNewVersionBehaviorEnabled()) { + for (ColumnFamilyDescriptor family : htd.getColumnFamilies()) { + builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(family) + .setNewVersionBehavior(true).build()); + } + } + if (splitRows != null) { + getAdmin().createTable(builder.build(), splitRows); + } else { + getAdmin().createTable(builder.build()); + } + // HBaseAdmin only waits for regions to appear in hbase:meta + // we should wait until they are assigned + waitUntilAllRegionsAssigned(htd.getTableName()); + return getConnection().getTable(htd.getTableName()); + } + + /** + * Create a table. + * @param tableName the table name + * @param families the families + * @param splitKeys the split keys + * @param replicaCount the replica count + * @param c Configuration to use + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys, + int replicaCount, final Configuration c) throws IOException { + TableDescriptor htd = + TableDescriptorBuilder.newBuilder(tableName).setRegionReplication(replicaCount).build(); + return createTable(htd, families, splitKeys, c); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[] family, int numVersions) throws IOException { + return createTable(tableName, new byte[][] { family }, numVersions); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[][] families, int numVersions) + throws IOException { + return createTable(tableName, families, numVersions, (byte[][]) null); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[][] families, int numVersions, + byte[][] splitKeys) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family) + .setMaxVersions(numVersions); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + if (splitKeys != null) { + getAdmin().createTable(builder.build(), splitKeys); + } else { + getAdmin().createTable(builder.build()); + } + // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are + // assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + /** + * Create a table with multiple regions. + * @return A Table instance for the created table. + */ + public Table createMultiRegionTable(TableName tableName, byte[][] families, int numVersions) + throws IOException { + return createTable(tableName, families, numVersions, KEYS_FOR_HBA_CREATE_TABLE); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[][] families, + int numVersions, int blockSize) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family) + .setMaxVersions(numVersions).setBlocksize(blockSize); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + getAdmin().createTable(builder.build()); + // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are + // assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + public Table createTable(TableName tableName, byte[][] families, + int numVersions, int blockSize, String cpName) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family) + .setMaxVersions(numVersions).setBlocksize(blockSize); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + if (cpName != null) { + builder.setCoprocessor(cpName); + } + getAdmin().createTable(builder.build()); + // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are + // assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[][] families, int[] numVersions) + throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + int i = 0; + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = + ColumnFamilyDescriptorBuilder.newBuilder(family).setMaxVersions(numVersions[i]); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + i++; + } + getAdmin().createTable(builder.build()); + // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are + // assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + /** + * Create a table. + * @return A Table instance for the created table. + */ + public Table createTable(TableName tableName, byte[] family, byte[][] splitRows) + throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + getAdmin().createTable(builder.build(), splitRows); + // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are + // assigned + waitUntilAllRegionsAssigned(tableName); + return getConnection().getTable(tableName); + } + + /** + * Create a table with multiple regions. + * @return A Table instance for the created table. + */ + public Table createMultiRegionTable(TableName tableName, byte[] family) throws IOException { + return createTable(tableName, family, KEYS_FOR_HBA_CREATE_TABLE); + } + + /** + * Modify a table, synchronous. + * @deprecated since 3.0.0 and will be removed in 4.0.0. Just use + * {@link Admin#modifyTable(TableDescriptor)} directly as it is synchronous now. + * @see Admin#modifyTable(TableDescriptor) + * @see HBASE-22002 + */ + @Deprecated + public static void modifyTableSync(Admin admin, TableDescriptor desc) + throws IOException, InterruptedException { + admin.modifyTable(desc); + } + + /** + * Set the number of Region replicas. + */ + public static void setReplicas(Admin admin, TableName table, int replicaCount) + throws IOException, InterruptedException { + TableDescriptor desc = TableDescriptorBuilder.newBuilder(admin.getDescriptor(table)) + .setRegionReplication(replicaCount).build(); + admin.modifyTable(desc); + } + + /** + * Drop an existing table + * @param tableName existing table + */ + public void deleteTable(TableName tableName) throws IOException { + try { + getAdmin().disableTable(tableName); + } catch (TableNotEnabledException e) { + LOG.debug("Table: " + tableName + " already disabled, so just deleting it."); + } + getAdmin().deleteTable(tableName); + } + + /** + * Drop an existing table + * @param tableName existing table + */ + public void deleteTableIfAny(TableName tableName) throws IOException { + try { + deleteTable(tableName); + } catch (TableNotFoundException e) { + // ignore + } + } + + // ========================================================================== + // Canned table and table descriptor creation + + public final static byte [] fam1 = Bytes.toBytes("colfamily11"); + public final static byte [] fam2 = Bytes.toBytes("colfamily21"); + public final static byte [] fam3 = Bytes.toBytes("colfamily31"); + public static final byte[][] COLUMNS = {fam1, fam2, fam3}; + private static final int MAXVERSIONS = 3; + + public static final char FIRST_CHAR = 'a'; + public static final char LAST_CHAR = 'z'; + public static final byte [] START_KEY_BYTES = {FIRST_CHAR, FIRST_CHAR, FIRST_CHAR}; + public static final String START_KEY = new String(START_KEY_BYTES, HConstants.UTF8_CHARSET); + + public TableDescriptorBuilder createModifyableTableDescriptor(final String name) { + return createModifyableTableDescriptor(TableName.valueOf(name), + ColumnFamilyDescriptorBuilder.DEFAULT_MIN_VERSIONS, MAXVERSIONS, HConstants.FOREVER, + ColumnFamilyDescriptorBuilder.DEFAULT_KEEP_DELETED); + } + + public TableDescriptor createTableDescriptor(final TableName name, final int minVersions, + final int versions, final int ttl, KeepDeletedCells keepDeleted) { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(name); + for (byte[] cfName : new byte[][] { fam1, fam2, fam3 }) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(cfName) + .setMinVersions(minVersions).setMaxVersions(versions).setKeepDeletedCells(keepDeleted) + .setBlockCacheEnabled(false).setTimeToLive(ttl); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + return builder.build(); + } + + public TableDescriptorBuilder createModifyableTableDescriptor(final TableName name, + final int minVersions, final int versions, final int ttl, KeepDeletedCells keepDeleted) { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(name); + for (byte[] cfName : new byte[][] { fam1, fam2, fam3 }) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(cfName) + .setMinVersions(minVersions).setMaxVersions(versions).setKeepDeletedCells(keepDeleted) + .setBlockCacheEnabled(false).setTimeToLive(ttl); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + return builder; + } + + /** + * Create a table of name name. + * @param name Name to give table. + * @return Column descriptor. + */ + public TableDescriptor createTableDescriptor(final TableName name) { + return createTableDescriptor(name, ColumnFamilyDescriptorBuilder.DEFAULT_MIN_VERSIONS, + MAXVERSIONS, HConstants.FOREVER, ColumnFamilyDescriptorBuilder.DEFAULT_KEEP_DELETED); + } + + public TableDescriptor createTableDescriptor(final TableName tableName, byte[] family) { + return createTableDescriptor(tableName, new byte[][] { family }, 1); + } + + public TableDescriptor createTableDescriptor(final TableName tableName, byte[][] families, + int maxVersions) { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = + ColumnFamilyDescriptorBuilder.newBuilder(family).setMaxVersions(maxVersions); + if (isNewVersionBehaviorEnabled()) { + cfBuilder.setNewVersionBehavior(true); + } + builder.setColumnFamily(cfBuilder.build()); + } + return builder.build(); + } + + /** + * Create an HRegion that writes to the local tmp dirs + * @param desc a table descriptor indicating which table the region belongs to + * @param startKey the start boundary of the region + * @param endKey the end boundary of the region + * @return a region that writes to local dir for testing + */ + public HRegion createLocalHRegion(TableDescriptor desc, byte[] startKey, byte[] endKey) + throws IOException { + RegionInfo hri = RegionInfoBuilder.newBuilder(desc.getTableName()).setStartKey(startKey) + .setEndKey(endKey).build(); + return createLocalHRegion(hri, desc); + } + + /** + * Create an HRegion that writes to the local tmp dirs. Creates the WAL for you. Be sure to call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when you're finished with it. + */ + public HRegion createLocalHRegion(RegionInfo info, TableDescriptor desc) throws IOException { + return createRegionAndWAL(info, getDataTestDir(), getConfiguration(), desc); + } + + /** + * Create an HRegion that writes to the local tmp dirs with specified wal + * @param info regioninfo + * @param conf configuration + * @param desc table descriptor + * @param wal wal for this region. + * @return created hregion + * @throws IOException + */ + public HRegion createLocalHRegion(RegionInfo info, Configuration conf, TableDescriptor desc, + WAL wal) throws IOException { + return HRegion.createHRegion(info, getDataTestDir(), conf, desc, wal); + } + + /** + * @param tableName + * @param startKey + * @param stopKey + * @param isReadOnly + * @param families + * @return A region on which you must call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. + * @throws IOException + */ + public HRegion createLocalHRegion(TableName tableName, byte[] startKey, byte[] stopKey, + Configuration conf, boolean isReadOnly, Durability durability, WAL wal, byte[]... families) + throws IOException { + return createLocalHRegionWithInMemoryFlags(tableName, startKey, stopKey, conf, isReadOnly, + durability, wal, null, families); + } + + public HRegion createLocalHRegionWithInMemoryFlags(TableName tableName, byte[] startKey, + byte[] stopKey, Configuration conf, boolean isReadOnly, Durability durability, WAL wal, + boolean[] compactedMemStore, byte[]... families) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + builder.setReadOnly(isReadOnly); + int i = 0; + for (byte[] family : families) { + ColumnFamilyDescriptorBuilder cfBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family); + if (compactedMemStore != null && i < compactedMemStore.length) { + cfBuilder.setInMemoryCompaction(MemoryCompactionPolicy.BASIC); + } else { + cfBuilder.setInMemoryCompaction(MemoryCompactionPolicy.NONE); + + } + i++; + // Set default to be three versions. + cfBuilder.setMaxVersions(Integer.MAX_VALUE); + builder.setColumnFamily(cfBuilder.build()); + } + builder.setDurability(durability); + RegionInfo info = + RegionInfoBuilder.newBuilder(tableName).setStartKey(startKey).setEndKey(stopKey).build(); + return createLocalHRegion(info, conf, builder.build(), wal); + } + + // + // ========================================================================== + + /** + * Provide an existing table name to truncate. + * Scans the table and issues a delete for each row read. + * @param tableName existing table + * @return HTable to that new table + * @throws IOException + */ + public Table deleteTableData(TableName tableName) throws IOException { + Table table = getConnection().getTable(tableName); + Scan scan = new Scan(); + ResultScanner resScan = table.getScanner(scan); + for(Result res : resScan) { + Delete del = new Delete(res.getRow()); + table.delete(del); + } + resScan = table.getScanner(scan); + resScan.close(); + return table; + } + + /** + * Truncate a table using the admin command. + * Effectively disables, deletes, and recreates the table. + * @param tableName table which must exist. + * @param preserveRegions keep the existing split points + * @return HTable for the new table + */ + public Table truncateTable(final TableName tableName, final boolean preserveRegions) throws + IOException { + Admin admin = getAdmin(); + if (!admin.isTableDisabled(tableName)) { + admin.disableTable(tableName); + } + admin.truncateTable(tableName, preserveRegions); + return getConnection().getTable(tableName); + } + + /** + * Truncate a table using the admin command. + * Effectively disables, deletes, and recreates the table. + * For previous behavior of issuing row deletes, see + * deleteTableData. + * Expressly does not preserve regions of existing table. + * @param tableName table which must exist. + * @return HTable for the new table + */ + public Table truncateTable(final TableName tableName) throws IOException { + return truncateTable(tableName, false); + } + + /** + * Load table with rows from 'aaa' to 'zzz'. + * @param t Table + * @param f Family + * @return Count of rows loaded. + * @throws IOException + */ + public int loadTable(final Table t, final byte[] f) throws IOException { + return loadTable(t, new byte[][] {f}); + } + + /** + * Load table with rows from 'aaa' to 'zzz'. + * @param t Table + * @param f Family + * @return Count of rows loaded. + * @throws IOException + */ + public int loadTable(final Table t, final byte[] f, boolean writeToWAL) throws IOException { + return loadTable(t, new byte[][] {f}, null, writeToWAL); + } + + /** + * Load table of multiple column families with rows from 'aaa' to 'zzz'. + * @param t Table + * @param f Array of Families to load + * @return Count of rows loaded. + * @throws IOException + */ + public int loadTable(final Table t, final byte[][] f) throws IOException { + return loadTable(t, f, null); + } + + /** + * Load table of multiple column families with rows from 'aaa' to 'zzz'. + * @param t Table + * @param f Array of Families to load + * @param value the values of the cells. If null is passed, the row key is used as value + * @return Count of rows loaded. + * @throws IOException + */ + public int loadTable(final Table t, final byte[][] f, byte[] value) throws IOException { + return loadTable(t, f, value, true); + } + + /** + * Load table of multiple column families with rows from 'aaa' to 'zzz'. + * @param t Table + * @param f Array of Families to load + * @param value the values of the cells. If null is passed, the row key is used as value + * @return Count of rows loaded. + * @throws IOException + */ + public int loadTable(final Table t, final byte[][] f, byte[] value, + boolean writeToWAL) throws IOException { + List puts = new ArrayList<>(); + for (byte[] row : HBaseTestingUtil.ROWS) { + Put put = new Put(row); + put.setDurability(writeToWAL ? Durability.USE_DEFAULT : Durability.SKIP_WAL); + for (int i = 0; i < f.length; i++) { + byte[] value1 = value != null ? value : row; + put.addColumn(f[i], f[i], value1); + } + puts.add(put); + } + t.put(puts); + return puts.size(); + } + + /** A tracker for tracking and validating table rows + * generated with {@link HBaseTestingUtil#loadTable(Table, byte[])} + */ + public static class SeenRowTracker { + int dim = 'z' - 'a' + 1; + int[][][] seenRows = new int[dim][dim][dim]; //count of how many times the row is seen + byte[] startRow; + byte[] stopRow; + + public SeenRowTracker(byte[] startRow, byte[] stopRow) { + this.startRow = startRow; + this.stopRow = stopRow; + } + + void reset() { + for (byte[] row : ROWS) { + seenRows[i(row[0])][i(row[1])][i(row[2])] = 0; + } + } + + int i(byte b) { + return b - 'a'; + } + + public void addRow(byte[] row) { + seenRows[i(row[0])][i(row[1])][i(row[2])]++; + } + + /** Validate that all the rows between startRow and stopRow are seen exactly once, and + * all other rows none + */ + public void validate() { + for (byte b1 = 'a'; b1 <= 'z'; b1++) { + for (byte b2 = 'a'; b2 <= 'z'; b2++) { + for (byte b3 = 'a'; b3 <= 'z'; b3++) { + int count = seenRows[i(b1)][i(b2)][i(b3)]; + int expectedCount = 0; + if (Bytes.compareTo(new byte[] {b1,b2,b3}, startRow) >= 0 + && Bytes.compareTo(new byte[] {b1,b2,b3}, stopRow) < 0) { + expectedCount = 1; + } + if (count != expectedCount) { + String row = new String(new byte[] {b1,b2,b3}, StandardCharsets.UTF_8); + throw new RuntimeException("Row:" + row + " has a seen count of " + count + " " + + "instead of " + expectedCount); + } + } + } + } + } + } + + public int loadRegion(final HRegion r, final byte[] f) throws IOException { + return loadRegion(r, f, false); + } + + public int loadRegion(final Region r, final byte[] f) throws IOException { + return loadRegion((HRegion)r, f); + } + + /** + * Load region with rows from 'aaa' to 'zzz'. + * @param r Region + * @param f Family + * @param flush flush the cache if true + * @return Count of rows loaded. + * @throws IOException + */ + public int loadRegion(final HRegion r, final byte[] f, final boolean flush) + throws IOException { + byte[] k = new byte[3]; + int rowCount = 0; + for (byte b1 = 'a'; b1 <= 'z'; b1++) { + for (byte b2 = 'a'; b2 <= 'z'; b2++) { + for (byte b3 = 'a'; b3 <= 'z'; b3++) { + k[0] = b1; + k[1] = b2; + k[2] = b3; + Put put = new Put(k); + put.setDurability(Durability.SKIP_WAL); + put.addColumn(f, null, k); + if (r.getWAL() == null) { + put.setDurability(Durability.SKIP_WAL); + } + int preRowCount = rowCount; + int pause = 10; + int maxPause = 1000; + while (rowCount == preRowCount) { + try { + r.put(put); + rowCount++; + } catch (RegionTooBusyException e) { + pause = (pause * 2 >= maxPause) ? maxPause : pause * 2; + Threads.sleep(pause); + } + } + } + } + if (flush) { + r.flush(true); + } + } + return rowCount; + } + + public void loadNumericRows(final Table t, final byte[] f, int startRow, int endRow) + throws IOException { + for (int i = startRow; i < endRow; i++) { + byte[] data = Bytes.toBytes(String.valueOf(i)); + Put put = new Put(data); + put.addColumn(f, null, data); + t.put(put); + } + } + + public void loadRandomRows(final Table t, final byte[] f, int rowSize, int totalRows) + throws IOException { + Random r = new Random(); + byte[] row = new byte[rowSize]; + for (int i = 0; i < totalRows; i++) { + r.nextBytes(row); + Put put = new Put(row); + put.addColumn(f, new byte[]{0}, new byte[]{0}); + t.put(put); + } + } + + public void verifyNumericRows(Table table, final byte[] f, int startRow, int endRow, + int replicaId) + throws IOException { + for (int i = startRow; i < endRow; i++) { + String failMsg = "Failed verification of row :" + i; + byte[] data = Bytes.toBytes(String.valueOf(i)); + Get get = new Get(data); + get.setReplicaId(replicaId); + get.setConsistency(Consistency.TIMELINE); + Result result = table.get(get); + assertTrue(failMsg, result.containsColumn(f, null)); + assertEquals(failMsg, 1, result.getColumnCells(f, null).size()); + Cell cell = result.getColumnLatestCell(f, null); + assertTrue(failMsg, + Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), + cell.getValueLength())); + } + } + + public void verifyNumericRows(Region region, final byte[] f, int startRow, int endRow) + throws IOException { + verifyNumericRows((HRegion)region, f, startRow, endRow); + } + + public void verifyNumericRows(HRegion region, final byte[] f, int startRow, int endRow) + throws IOException { + verifyNumericRows(region, f, startRow, endRow, true); + } + + public void verifyNumericRows(Region region, final byte[] f, int startRow, int endRow, + final boolean present) throws IOException { + verifyNumericRows((HRegion)region, f, startRow, endRow, present); + } + + public void verifyNumericRows(HRegion region, final byte[] f, int startRow, int endRow, + final boolean present) throws IOException { + for (int i = startRow; i < endRow; i++) { + String failMsg = "Failed verification of row :" + i; + byte[] data = Bytes.toBytes(String.valueOf(i)); + Result result = region.get(new Get(data)); + + boolean hasResult = result != null && !result.isEmpty(); + assertEquals(failMsg + result, present, hasResult); + if (!present) continue; + + assertTrue(failMsg, result.containsColumn(f, null)); + assertEquals(failMsg, 1, result.getColumnCells(f, null).size()); + Cell cell = result.getColumnLatestCell(f, null); + assertTrue(failMsg, + Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), + cell.getValueLength())); + } + } + + public void deleteNumericRows(final Table t, final byte[] f, int startRow, int endRow) + throws IOException { + for (int i = startRow; i < endRow; i++) { + byte[] data = Bytes.toBytes(String.valueOf(i)); + Delete delete = new Delete(data); + delete.addFamily(f); + t.delete(delete); + } + } + + /** + * Return the number of rows in the given table. + * @param table to count rows + * @return count of rows + */ + public static int countRows(final Table table) throws IOException { + return countRows(table, new Scan()); + } + + public static int countRows(final Table table, final Scan scan) throws IOException { + try (ResultScanner results = table.getScanner(scan)) { + int count = 0; + while (results.next() != null) { + count++; + } + return count; + } + } + + public int countRows(final Table table, final byte[]... families) throws IOException { + Scan scan = new Scan(); + for (byte[] family: families) { + scan.addFamily(family); + } + return countRows(table, scan); + } + + /** + * Return the number of rows in the given table. + */ + public int countRows(final TableName tableName) throws IOException { + Table table = getConnection().getTable(tableName); + try { + return countRows(table); + } finally { + table.close(); + } + } + + public int countRows(final Region region) throws IOException { + return countRows(region, new Scan()); + } + + public int countRows(final Region region, final Scan scan) throws IOException { + InternalScanner scanner = region.getScanner(scan); + try { + return countRows(scanner); + } finally { + scanner.close(); + } + } + + public int countRows(final InternalScanner scanner) throws IOException { + int scannedCount = 0; + List results = new ArrayList<>(); + boolean hasMore = true; + while (hasMore) { + hasMore = scanner.next(results); + scannedCount += results.size(); + results.clear(); + } + return scannedCount; + } + + /** + * Return an md5 digest of the entire contents of a table. + */ + public String checksumRows(final Table table) throws Exception { + + Scan scan = new Scan(); + ResultScanner results = table.getScanner(scan); + MessageDigest digest = MessageDigest.getInstance("MD5"); + for (Result res : results) { + digest.update(res.getRow()); + } + results.close(); + return digest.toString(); + } + + /** All the row values for the data loaded by {@link #loadTable(Table, byte[])} */ + public static final byte[][] ROWS = new byte[(int) Math.pow('z' - 'a' + 1, 3)][3]; // ~52KB + static { + int i = 0; + for (byte b1 = 'a'; b1 <= 'z'; b1++) { + for (byte b2 = 'a'; b2 <= 'z'; b2++) { + for (byte b3 = 'a'; b3 <= 'z'; b3++) { + ROWS[i][0] = b1; + ROWS[i][1] = b2; + ROWS[i][2] = b3; + i++; + } + } + } + } + + public static final byte[][] KEYS = { + HConstants.EMPTY_BYTE_ARRAY, Bytes.toBytes("bbb"), + Bytes.toBytes("ccc"), Bytes.toBytes("ddd"), Bytes.toBytes("eee"), + Bytes.toBytes("fff"), Bytes.toBytes("ggg"), Bytes.toBytes("hhh"), + Bytes.toBytes("iii"), Bytes.toBytes("jjj"), Bytes.toBytes("kkk"), + Bytes.toBytes("lll"), Bytes.toBytes("mmm"), Bytes.toBytes("nnn"), + Bytes.toBytes("ooo"), Bytes.toBytes("ppp"), Bytes.toBytes("qqq"), + Bytes.toBytes("rrr"), Bytes.toBytes("sss"), Bytes.toBytes("ttt"), + Bytes.toBytes("uuu"), Bytes.toBytes("vvv"), Bytes.toBytes("www"), + Bytes.toBytes("xxx"), Bytes.toBytes("yyy") + }; + + public static final byte[][] KEYS_FOR_HBA_CREATE_TABLE = { + Bytes.toBytes("bbb"), + Bytes.toBytes("ccc"), Bytes.toBytes("ddd"), Bytes.toBytes("eee"), + Bytes.toBytes("fff"), Bytes.toBytes("ggg"), Bytes.toBytes("hhh"), + Bytes.toBytes("iii"), Bytes.toBytes("jjj"), Bytes.toBytes("kkk"), + Bytes.toBytes("lll"), Bytes.toBytes("mmm"), Bytes.toBytes("nnn"), + Bytes.toBytes("ooo"), Bytes.toBytes("ppp"), Bytes.toBytes("qqq"), + Bytes.toBytes("rrr"), Bytes.toBytes("sss"), Bytes.toBytes("ttt"), + Bytes.toBytes("uuu"), Bytes.toBytes("vvv"), Bytes.toBytes("www"), + Bytes.toBytes("xxx"), Bytes.toBytes("yyy"), Bytes.toBytes("zzz") + }; + + /** + * Create rows in hbase:meta for regions of the specified table with the specified + * start keys. The first startKey should be a 0 length byte array if you + * want to form a proper range of regions. + * @param conf + * @param htd + * @param startKeys + * @return list of region info for regions added to meta + * @throws IOException + */ + public List createMultiRegionsInMeta(final Configuration conf, + final TableDescriptor htd, byte [][] startKeys) + throws IOException { + Table meta = getConnection().getTable(TableName.META_TABLE_NAME); + Arrays.sort(startKeys, Bytes.BYTES_COMPARATOR); + List newRegions = new ArrayList<>(startKeys.length); + MetaTableAccessor + .updateTableState(getConnection(), htd.getTableName(), TableState.State.ENABLED); + // add custom ones + for (int i = 0; i < startKeys.length; i++) { + int j = (i + 1) % startKeys.length; + RegionInfo hri = RegionInfoBuilder.newBuilder(htd.getTableName()) + .setStartKey(startKeys[i]) + .setEndKey(startKeys[j]) + .build(); + MetaTableAccessor.addRegionsToMeta(getConnection(), Collections.singletonList(hri), 1); + newRegions.add(hri); + } + + meta.close(); + return newRegions; + } + + /** + * Create an unmanaged WAL. Be sure to close it when you're through. + */ + public static WAL createWal(final Configuration conf, final Path rootDir, final RegionInfo hri) + throws IOException { + // The WAL subsystem will use the default rootDir rather than the passed in rootDir + // unless I pass along via the conf. + Configuration confForWAL = new Configuration(conf); + confForWAL.set(HConstants.HBASE_DIR, rootDir.toString()); + return new WALFactory(confForWAL, "hregion-" + RandomStringUtils.randomNumeric(8)).getWAL(hri); + } + + + /** + * Create a region with it's own WAL. Be sure to call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} to clean up all resources. + */ + public static HRegion createRegionAndWAL(final RegionInfo info, final Path rootDir, + final Configuration conf, final TableDescriptor htd) throws IOException { + return createRegionAndWAL(info, rootDir, conf, htd, true); + } + + /** + * Create a region with it's own WAL. Be sure to call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} to clean up all resources. + */ + public static HRegion createRegionAndWAL(final RegionInfo info, final Path rootDir, + final Configuration conf, final TableDescriptor htd, BlockCache blockCache) + throws IOException { + HRegion region = createRegionAndWAL(info, rootDir, conf, htd, false); + region.setBlockCache(blockCache); + region.initialize(); + return region; + } + /** + * Create a region with it's own WAL. Be sure to call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} to clean up all resources. + */ + public static HRegion createRegionAndWAL(final RegionInfo info, final Path rootDir, + final Configuration conf, final TableDescriptor htd, MobFileCache mobFileCache) + throws IOException { + HRegion region = createRegionAndWAL(info, rootDir, conf, htd, false); + region.setMobFileCache(mobFileCache); + region.initialize(); + return region; + } + + /** + * Create a region with it's own WAL. Be sure to call + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} to clean up all resources. + */ + public static HRegion createRegionAndWAL(final RegionInfo info, final Path rootDir, + final Configuration conf, final TableDescriptor htd, boolean initialize) + throws IOException { + ChunkCreator.initialize(MemStoreLAB.CHUNK_SIZE_DEFAULT, false, 0, 0, + 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT); + WAL wal = createWal(conf, rootDir, info); + return HRegion.createHRegion(info, rootDir, conf, htd, wal, initialize); + } + + /** + * Returns all rows from the hbase:meta table. + * + * @throws IOException When reading the rows fails. + */ + public List getMetaTableRows() throws IOException { + // TODO: Redo using MetaTableAccessor class + Table t = getConnection().getTable(TableName.META_TABLE_NAME); + List rows = new ArrayList<>(); + ResultScanner s = t.getScanner(new Scan()); + for (Result result : s) { + LOG.info("getMetaTableRows: row -> " + + Bytes.toStringBinary(result.getRow())); + rows.add(result.getRow()); + } + s.close(); + t.close(); + return rows; + } + + /** + * Returns all rows from the hbase:meta table for a given user table + * + * @throws IOException When reading the rows fails. + */ + public List getMetaTableRows(TableName tableName) throws IOException { + // TODO: Redo using MetaTableAccessor. + Table t = getConnection().getTable(TableName.META_TABLE_NAME); + List rows = new ArrayList<>(); + ResultScanner s = t.getScanner(new Scan()); + for (Result result : s) { + RegionInfo info = CatalogFamilyFormat.getRegionInfo(result); + if (info == null) { + LOG.error("No region info for row " + Bytes.toString(result.getRow())); + // TODO figure out what to do for this new hosed case. + continue; + } + + if (info.getTable().equals(tableName)) { + LOG.info("getMetaTableRows: row -> " + + Bytes.toStringBinary(result.getRow()) + info); + rows.add(result.getRow()); + } + } + s.close(); + t.close(); + return rows; + } + + /** + * Returns all regions of the specified table + * + * @param tableName the table name + * @return all regions of the specified table + * @throws IOException when getting the regions fails. + */ + private List getRegions(TableName tableName) throws IOException { + try (Admin admin = getConnection().getAdmin()) { + return admin.getRegions(tableName); + } + } + + /* + * Find any other region server which is different from the one identified by parameter + * @param rs + * @return another region server + */ + public HRegionServer getOtherRegionServer(HRegionServer rs) { + for (JVMClusterUtil.RegionServerThread rst : + getMiniHBaseCluster().getRegionServerThreads()) { + if (!(rst.getRegionServer() == rs)) { + return rst.getRegionServer(); + } + } + return null; + } + + /** + * Tool to get the reference to the region server object that holds the + * region of the specified user table. + * @param tableName user table to lookup in hbase:meta + * @return region server that holds it, null if the row doesn't exist + * @throws IOException + * @throws InterruptedException + */ + public HRegionServer getRSForFirstRegionInTable(TableName tableName) + throws IOException, InterruptedException { + List regions = getRegions(tableName); + if (regions == null || regions.isEmpty()) { + return null; + } + LOG.debug("Found " + regions.size() + " regions for table " + + tableName); + + byte[] firstRegionName = regions.stream() + .filter(r -> !r.isOffline()) + .map(RegionInfo::getRegionName) + .findFirst() + .orElseThrow(() -> new IOException("online regions not found in table " + tableName)); + + LOG.debug("firstRegionName=" + Bytes.toString(firstRegionName)); + long pause = getConfiguration().getLong(HConstants.HBASE_CLIENT_PAUSE, + HConstants.DEFAULT_HBASE_CLIENT_PAUSE); + int numRetries = getConfiguration().getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, + HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); + RetryCounter retrier = new RetryCounter(numRetries+1, (int)pause, TimeUnit.MICROSECONDS); + while(retrier.shouldRetry()) { + int index = getMiniHBaseCluster().getServerWith(firstRegionName); + if (index != -1) { + return getMiniHBaseCluster().getRegionServerThreads().get(index).getRegionServer(); + } + // Came back -1. Region may not be online yet. Sleep a while. + retrier.sleepUntilNextRetry(); + } + return null; + } + + /** + * Starts a MiniMRCluster with a default number of + * TaskTracker's. + * + * @throws IOException When starting the cluster fails. + */ + public MiniMRCluster startMiniMapReduceCluster() throws IOException { + // Set a very high max-disk-utilization percentage to avoid the NodeManagers from failing. + conf.setIfUnset( + "yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage", + "99.0"); + startMiniMapReduceCluster(2); + return mrCluster; + } + + /** + * Tasktracker has a bug where changing the hadoop.log.dir system property + * will not change its internal static LOG_DIR variable. + */ + private void forceChangeTaskLogDir() { + Field logDirField; + try { + logDirField = TaskLog.class.getDeclaredField("LOG_DIR"); + logDirField.setAccessible(true); + + Field modifiersField = ReflectionUtils.getModifiersField(); + modifiersField.setAccessible(true); + modifiersField.setInt(logDirField, logDirField.getModifiers() & ~Modifier.FINAL); + + logDirField.set(null, new File(hadoopLogDir, "userlogs")); + } catch (SecurityException e) { + throw new RuntimeException(e); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + /** + * Starts a MiniMRCluster. Call {@link #setFileSystemURI(String)} to use a different + * filesystem. + * @param servers The number of TaskTracker's to start. + * @throws IOException When starting the cluster fails. + */ + private void startMiniMapReduceCluster(final int servers) throws IOException { + if (mrCluster != null) { + throw new IllegalStateException("MiniMRCluster is already running"); + } + LOG.info("Starting mini mapreduce cluster..."); + setupClusterTestDir(); + createDirsAndSetProperties(); + + forceChangeTaskLogDir(); + + //// hadoop2 specific settings + // Tests were failing because this process used 6GB of virtual memory and was getting killed. + // we up the VM usable so that processes don't get killed. + conf.setFloat("yarn.nodemanager.vmem-pmem-ratio", 8.0f); + + // Tests were failing due to MAPREDUCE-4880 / MAPREDUCE-4607 against hadoop 2.0.2-alpha and + // this avoids the problem by disabling speculative task execution in tests. + conf.setBoolean("mapreduce.map.speculative", false); + conf.setBoolean("mapreduce.reduce.speculative", false); + //// + + // Allow the user to override FS URI for this map-reduce cluster to use. + mrCluster = new MiniMRCluster(servers, + FS_URI != null ? FS_URI : FileSystem.get(conf).getUri().toString(), 1, + null, null, new JobConf(this.conf)); + JobConf jobConf = MapreduceTestingShim.getJobConf(mrCluster); + if (jobConf == null) { + jobConf = mrCluster.createJobConf(); + } + + jobConf.set("mapreduce.cluster.local.dir", + conf.get("mapreduce.cluster.local.dir")); //Hadoop MiniMR overwrites this while it should not + LOG.info("Mini mapreduce cluster started"); + + // In hadoop2, YARN/MR2 starts a mini cluster with its own conf instance and updates settings. + // Our HBase MR jobs need several of these settings in order to properly run. So we copy the + // necessary config properties here. YARN-129 required adding a few properties. + conf.set("mapreduce.jobtracker.address", jobConf.get("mapreduce.jobtracker.address")); + // this for mrv2 support; mr1 ignores this + conf.set("mapreduce.framework.name", "yarn"); + conf.setBoolean("yarn.is.minicluster", true); + String rmAddress = jobConf.get("yarn.resourcemanager.address"); + if (rmAddress != null) { + conf.set("yarn.resourcemanager.address", rmAddress); + } + String historyAddress = jobConf.get("mapreduce.jobhistory.address"); + if (historyAddress != null) { + conf.set("mapreduce.jobhistory.address", historyAddress); + } + String schedulerAddress = + jobConf.get("yarn.resourcemanager.scheduler.address"); + if (schedulerAddress != null) { + conf.set("yarn.resourcemanager.scheduler.address", schedulerAddress); + } + String mrJobHistoryWebappAddress = + jobConf.get("mapreduce.jobhistory.webapp.address"); + if (mrJobHistoryWebappAddress != null) { + conf.set("mapreduce.jobhistory.webapp.address", mrJobHistoryWebappAddress); + } + String yarnRMWebappAddress = + jobConf.get("yarn.resourcemanager.webapp.address"); + if (yarnRMWebappAddress != null) { + conf.set("yarn.resourcemanager.webapp.address", yarnRMWebappAddress); + } + } + + /** + * Stops the previously started MiniMRCluster. + */ + public void shutdownMiniMapReduceCluster() { + if (mrCluster != null) { + LOG.info("Stopping mini mapreduce cluster..."); + mrCluster.shutdown(); + mrCluster = null; + LOG.info("Mini mapreduce cluster stopped"); + } + // Restore configuration to point to local jobtracker + conf.set("mapreduce.jobtracker.address", "local"); + } + + /** + * Create a stubbed out RegionServerService, mainly for getting FS. + */ + public RegionServerServices createMockRegionServerService() throws IOException { + return createMockRegionServerService((ServerName)null); + } + + /** + * Create a stubbed out RegionServerService, mainly for getting FS. + * This version is used by TestTokenAuthentication + */ + public RegionServerServices createMockRegionServerService(RpcServerInterface rpc) throws + IOException { + final MockRegionServerServices rss = new MockRegionServerServices(getZooKeeperWatcher()); + rss.setFileSystem(getTestFileSystem()); + rss.setRpcServer(rpc); + return rss; + } + + /** + * Create a stubbed out RegionServerService, mainly for getting FS. + * This version is used by TestOpenRegionHandler + */ + public RegionServerServices createMockRegionServerService(ServerName name) throws IOException { + final MockRegionServerServices rss = new MockRegionServerServices(getZooKeeperWatcher(), name); + rss.setFileSystem(getTestFileSystem()); + return rss; + } + + /** + * Switches the logger for the given class to DEBUG level. + * @param clazz The class for which to switch to debug logging. + * @deprecated In 2.3.0, will be removed in 4.0.0. Only support changing log level on log4j now as + * HBase only uses log4j. You should do this by your own as it you know which log + * framework you are using then set the log level to debug is very easy. + */ + @Deprecated + public void enableDebug(Class clazz) { + Log4jUtils.enableDebug(clazz); + } + + /** + * Expire the Master's session + * @throws Exception + */ + public void expireMasterSession() throws Exception { + HMaster master = getMiniHBaseCluster().getMaster(); + expireSession(master.getZooKeeper(), false); + } + + /** + * Expire a region server's session + * @param index which RS + */ + public void expireRegionServerSession(int index) throws Exception { + HRegionServer rs = getMiniHBaseCluster().getRegionServer(index); + expireSession(rs.getZooKeeper(), false); + decrementMinRegionServerCount(); + } + + private void decrementMinRegionServerCount() { + // decrement the count for this.conf, for newly spwaned master + // this.hbaseCluster shares this configuration too + decrementMinRegionServerCount(getConfiguration()); + + // each master thread keeps a copy of configuration + for (MasterThread master : getHBaseCluster().getMasterThreads()) { + decrementMinRegionServerCount(master.getMaster().getConfiguration()); + } + } + + private void decrementMinRegionServerCount(Configuration conf) { + int currentCount = conf.getInt( + ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1); + if (currentCount != -1) { + conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, + Math.max(currentCount - 1, 1)); + } + } + + public void expireSession(ZKWatcher nodeZK) throws Exception { + expireSession(nodeZK, false); + } + + /** + * Expire a ZooKeeper session as recommended in ZooKeeper documentation + * http://hbase.apache.org/book.html#trouble.zookeeper + * There are issues when doing this: + * [1] http://www.mail-archive.com/dev@zookeeper.apache.org/msg01942.html + * [2] https://issues.apache.org/jira/browse/ZOOKEEPER-1105 + * + * @param nodeZK - the ZK watcher to expire + * @param checkStatus - true to check if we can create a Table with the + * current configuration. + */ + public void expireSession(ZKWatcher nodeZK, boolean checkStatus) + throws Exception { + Configuration c = new Configuration(this.conf); + String quorumServers = ZKConfig.getZKQuorumServersString(c); + ZooKeeper zk = nodeZK.getRecoverableZooKeeper().getZooKeeper(); + byte[] password = zk.getSessionPasswd(); + long sessionID = zk.getSessionId(); + + // Expiry seems to be asynchronous (see comment from P. Hunt in [1]), + // so we create a first watcher to be sure that the + // event was sent. We expect that if our watcher receives the event + // other watchers on the same machine will get is as well. + // When we ask to close the connection, ZK does not close it before + // we receive all the events, so don't have to capture the event, just + // closing the connection should be enough. + ZooKeeper monitor = new ZooKeeper(quorumServers, + 1000, new org.apache.zookeeper.Watcher(){ + @Override + public void process(WatchedEvent watchedEvent) { + LOG.info("Monitor ZKW received event="+watchedEvent); + } + } , sessionID, password); + + // Making it expire + ZooKeeper newZK = new ZooKeeper(quorumServers, + 1000, EmptyWatcher.instance, sessionID, password); + + //ensure that we have connection to the server before closing down, otherwise + //the close session event will be eaten out before we start CONNECTING state + long start = EnvironmentEdgeManager.currentTime(); + while (newZK.getState() != States.CONNECTED + && EnvironmentEdgeManager.currentTime() - start < 1000) { + Thread.sleep(1); + } + newZK.close(); + LOG.info("ZK Closed Session 0x" + Long.toHexString(sessionID)); + + // Now closing & waiting to be sure that the clients get it. + monitor.close(); + + if (checkStatus) { + getConnection().getTable(TableName.META_TABLE_NAME).close(); + } + } + + /** + * Get the Mini HBase cluster. + * + * @return hbase cluster + * @see #getHBaseClusterInterface() + */ + public SingleProcessHBaseCluster getHBaseCluster() { + return getMiniHBaseCluster(); + } + + /** + * Returns the HBaseCluster instance. + *

Returned object can be any of the subclasses of HBaseCluster, and the + * tests referring this should not assume that the cluster is a mini cluster or a + * distributed one. If the test only works on a mini cluster, then specific + * method {@link #getMiniHBaseCluster()} can be used instead w/o the + * need to type-cast. + */ + public HBaseClusterInterface getHBaseClusterInterface() { + //implementation note: we should rename this method as #getHBaseCluster(), + //but this would require refactoring 90+ calls. + return hbaseCluster; + } + + /** + * Resets the connections so that the next time getConnection() is called, a new connection is + * created. This is needed in cases where the entire cluster / all the masters are shutdown and + * the connection is not valid anymore. + * TODO: There should be a more coherent way of doing this. Unfortunately the way tests are + * written, not all start() stop() calls go through this class. Most tests directly operate on + * the underlying mini/local hbase cluster. That makes it difficult for this wrapper class to + * maintain the connection state automatically. Cleaning this is a much bigger refactor. + */ + public void invalidateConnection() throws IOException { + closeConnection(); + // Update the master addresses if they changed. + final String masterConfigBefore = conf.get(HConstants.MASTER_ADDRS_KEY); + final String masterConfAfter = getMiniHBaseCluster().getConf().get(HConstants.MASTER_ADDRS_KEY); + LOG.info("Invalidated connection. Updating master addresses before: {} after: {}", + masterConfigBefore, masterConfAfter); + conf.set(HConstants.MASTER_ADDRS_KEY, + getMiniHBaseCluster().getConf().get(HConstants.MASTER_ADDRS_KEY)); + } + + /** + * Get a shared Connection to the cluster. + * this method is thread safe. + * @return A Connection that can be shared. Don't close. Will be closed on shutdown of cluster. + */ + public Connection getConnection() throws IOException { + return getAsyncConnection().toConnection(); + } + + /** + * Get a assigned Connection to the cluster. + * this method is thread safe. + * @param user assigned user + * @return A Connection with assigned user. + */ + public Connection getConnection(User user) throws IOException { + return getAsyncConnection(user).toConnection(); + } + + /** + * Get a shared AsyncClusterConnection to the cluster. + * this method is thread safe. + * @return An AsyncClusterConnection that can be shared. Don't close. Will be closed on shutdown of cluster. + */ + public AsyncClusterConnection getAsyncConnection() throws IOException { + try { + return asyncConnection.updateAndGet(connection -> { + if (connection == null) { + try { + User user = UserProvider.instantiate(conf).getCurrent(); + connection = getAsyncConnection(user); + } catch(IOException ioe) { + throw new UncheckedIOException("Failed to create connection", ioe); + } + } + return connection; + }); + } catch (UncheckedIOException exception) { + throw exception.getCause(); + } + } + + /** + * Get a assigned AsyncClusterConnection to the cluster. + * this method is thread safe. + * @param user assigned user + * @return An AsyncClusterConnection with assigned user. + */ + public AsyncClusterConnection getAsyncConnection(User user) throws IOException { + return ClusterConnectionFactory.createAsyncClusterConnection(conf, null, user); + } + + public void closeConnection() throws IOException { + if (hbaseAdmin != null) { + Closeables.close(hbaseAdmin, true); + hbaseAdmin = null; + } + AsyncClusterConnection asyncConnection = this.asyncConnection.getAndSet(null); + if (asyncConnection != null) { + Closeables.close(asyncConnection, true); + } + } + + /** + * Returns an Admin instance which is shared between HBaseTestingUtility instance users. + * Closing it has no effect, it will be closed automatically when the cluster shutdowns + */ + public Admin getAdmin() throws IOException { + if (hbaseAdmin == null){ + this.hbaseAdmin = getConnection().getAdmin(); + } + return hbaseAdmin; + } + + private Admin hbaseAdmin = null; + + /** + * Returns an {@link Hbck} instance. Needs be closed when done. + */ + public Hbck getHbck() throws IOException { + return getConnection().getHbck(); + } + + /** + * Unassign the named region. + * + * @param regionName The region to unassign. + */ + public void unassignRegion(String regionName) throws IOException { + unassignRegion(Bytes.toBytes(regionName)); + } + + /** + * Unassign the named region. + * + * @param regionName The region to unassign. + */ + public void unassignRegion(byte[] regionName) throws IOException { + getAdmin().unassign(regionName, true); + } + + /** + * Closes the region containing the given row. + * + * @param row The row to find the containing region. + * @param table The table to find the region. + */ + public void unassignRegionByRow(String row, RegionLocator table) throws IOException { + unassignRegionByRow(Bytes.toBytes(row), table); + } + + /** + * Closes the region containing the given row. + * + * @param row The row to find the containing region. + * @param table The table to find the region. + * @throws IOException + */ + public void unassignRegionByRow(byte[] row, RegionLocator table) throws IOException { + HRegionLocation hrl = table.getRegionLocation(row); + unassignRegion(hrl.getRegion().getRegionName()); + } + + /** + * Retrieves a splittable region randomly from tableName + * @param tableName name of table + * @param maxAttempts maximum number of attempts, unlimited for value of -1 + * @return the HRegion chosen, null if none was found within limit of maxAttempts + */ + public HRegion getSplittableRegion(TableName tableName, int maxAttempts) { + List regions = getHBaseCluster().getRegions(tableName); + int regCount = regions.size(); + Set attempted = new HashSet<>(); + int idx; + int attempts = 0; + do { + regions = getHBaseCluster().getRegions(tableName); + if (regCount != regions.size()) { + // if there was region movement, clear attempted Set + attempted.clear(); + } + regCount = regions.size(); + // There are chances that before we get the region for the table from an RS the region may + // be going for CLOSE. This may be because online schema change is enabled + if (regCount > 0) { + idx = random.nextInt(regCount); + // if we have just tried this region, there is no need to try again + if (attempted.contains(idx)) { + continue; + } + HRegion region = regions.get(idx); + if (region.checkSplit().isPresent()) { + return region; + } + attempted.add(idx); + } + attempts++; + } while (maxAttempts == -1 || attempts < maxAttempts); + return null; + } + + public MiniDFSCluster getDFSCluster() { + return dfsCluster; + } + + public void setDFSCluster(MiniDFSCluster cluster) throws IllegalStateException, IOException { + setDFSCluster(cluster, true); + } + + /** + * Set the MiniDFSCluster + * @param cluster cluster to use + * @param requireDown require the that cluster not be "up" (MiniDFSCluster#isClusterUp) before + * it is set. + * @throws IllegalStateException if the passed cluster is up when it is required to be down + * @throws IOException if the FileSystem could not be set from the passed dfs cluster + */ + public void setDFSCluster(MiniDFSCluster cluster, boolean requireDown) + throws IllegalStateException, IOException { + if (dfsCluster != null && requireDown && dfsCluster.isClusterUp()) { + throw new IllegalStateException("DFSCluster is already running! Shut it down first."); + } + this.dfsCluster = cluster; + this.setFs(); + } + + public FileSystem getTestFileSystem() throws IOException { + return HFileSystem.get(conf); + } + + /** + * Wait until all regions in a table have been assigned. Waits default timeout before giving up + * (30 seconds). + * @param table Table to wait on. + * @throws InterruptedException + * @throws IOException + */ + public void waitTableAvailable(TableName table) + throws InterruptedException, IOException { + waitTableAvailable(table.getName(), 30000); + } + + public void waitTableAvailable(TableName table, long timeoutMillis) + throws InterruptedException, IOException { + waitFor(timeoutMillis, predicateTableAvailable(table)); + } + + /** + * Wait until all regions in a table have been assigned + * @param table Table to wait on. + * @param timeoutMillis Timeout. + */ + public void waitTableAvailable(byte[] table, long timeoutMillis) + throws InterruptedException, IOException { + waitFor(timeoutMillis, predicateTableAvailable(TableName.valueOf(table))); + } + + public String explainTableAvailability(TableName tableName) throws IOException { + StringBuilder msg = + new StringBuilder(explainTableState(tableName, TableState.State.ENABLED)).append(", "); + if (getHBaseCluster().getMaster().isAlive()) { + Map assignments = getHBaseCluster().getMaster().getAssignmentManager() + .getRegionStates().getRegionAssignments(); + final List> metaLocations = + MetaTableAccessor.getTableRegionsAndLocations(getConnection(), tableName); + for (Pair metaLocation : metaLocations) { + RegionInfo hri = metaLocation.getFirst(); + ServerName sn = metaLocation.getSecond(); + if (!assignments.containsKey(hri)) { + msg.append(", region ").append(hri) + .append(" not assigned, but found in meta, it expected to be on ").append(sn); + } else if (sn == null) { + msg.append(", region ").append(hri).append(" assigned, but has no server in meta"); + } else if (!sn.equals(assignments.get(hri))) { + msg.append(", region ").append(hri) + .append(" assigned, but has different servers in meta and AM ( ").append(sn) + .append(" <> ").append(assignments.get(hri)); + } + } + } + return msg.toString(); + } + + public String explainTableState(final TableName table, TableState.State state) + throws IOException { + TableState tableState = MetaTableAccessor.getTableState(getConnection(), table); + if (tableState == null) { + return "TableState in META: No table state in META for table " + table + + " last state in meta (including deleted is " + findLastTableState(table) + ")"; + } else if (!tableState.inStates(state)) { + return "TableState in META: Not " + state + " state, but " + tableState; + } else { + return "TableState in META: OK"; + } + } + + @Nullable + public TableState findLastTableState(final TableName table) throws IOException { + final AtomicReference lastTableState = new AtomicReference<>(null); + ClientMetaTableAccessor.Visitor visitor = new ClientMetaTableAccessor.Visitor() { + @Override + public boolean visit(Result r) throws IOException { + if (!Arrays.equals(r.getRow(), table.getName())) { + return false; + } + TableState state = CatalogFamilyFormat.getTableState(r); + if (state != null) { + lastTableState.set(state); + } + return true; + } + }; + MetaTableAccessor.scanMeta(getConnection(), null, null, + ClientMetaTableAccessor.QueryType.TABLE, Integer.MAX_VALUE, visitor); + return lastTableState.get(); + } + + /** + * Waits for a table to be 'enabled'. Enabled means that table is set as 'enabled' and the + * regions have been all assigned. Will timeout after default period (30 seconds) + * Tolerates nonexistent table. + * @param table the table to wait on. + * @throws InterruptedException if interrupted while waiting + * @throws IOException if an IO problem is encountered + */ + public void waitTableEnabled(TableName table) + throws InterruptedException, IOException { + waitTableEnabled(table, 30000); + } + + /** + * Waits for a table to be 'enabled'. Enabled means that table is set as 'enabled' and the + * regions have been all assigned. + * @see #waitTableEnabled(TableName, long) + * @param table Table to wait on. + * @param timeoutMillis Time to wait on it being marked enabled. + * @throws InterruptedException + * @throws IOException + */ + public void waitTableEnabled(byte[] table, long timeoutMillis) + throws InterruptedException, IOException { + waitTableEnabled(TableName.valueOf(table), timeoutMillis); + } + + public void waitTableEnabled(TableName table, long timeoutMillis) + throws IOException { + waitFor(timeoutMillis, predicateTableEnabled(table)); + } + + /** + * Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled' + * Will timeout after default period (30 seconds) + * @param table Table to wait on. + * @throws InterruptedException + * @throws IOException + */ + public void waitTableDisabled(byte[] table) + throws InterruptedException, IOException { + waitTableDisabled(table, 30000); + } + + public void waitTableDisabled(TableName table, long millisTimeout) + throws InterruptedException, IOException { + waitFor(millisTimeout, predicateTableDisabled(table)); + } + + /** + * Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled' + * @param table Table to wait on. + * @param timeoutMillis Time to wait on it being marked disabled. + * @throws InterruptedException + * @throws IOException + */ + public void waitTableDisabled(byte[] table, long timeoutMillis) + throws InterruptedException, IOException { + waitTableDisabled(TableName.valueOf(table), timeoutMillis); + } + + /** + * Make sure that at least the specified number of region servers + * are running + * @param num minimum number of region servers that should be running + * @return true if we started some servers + * @throws IOException + */ + public boolean ensureSomeRegionServersAvailable(final int num) + throws IOException { + boolean startedServer = false; + SingleProcessHBaseCluster hbaseCluster = getMiniHBaseCluster(); + for (int i=hbaseCluster.getLiveRegionServerThreads().size(); i getAllOnlineRegions(SingleProcessHBaseCluster cluster) + throws IOException { + NavigableSet online = new TreeSet<>(); + for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) { + try { + for (RegionInfo region : + ProtobufUtil.getOnlineRegions(rst.getRegionServer().getRSRpcServices())) { + online.add(region.getRegionNameAsString()); + } + } catch (RegionServerStoppedException e) { + // That's fine. + } + } + for (MasterThread mt : cluster.getLiveMasterThreads()) { + try { + for (RegionInfo region : + ProtobufUtil.getOnlineRegions(mt.getMaster().getRSRpcServices())) { + online.add(region.getRegionNameAsString()); + } + } catch (RegionServerStoppedException e) { + // That's fine. + } catch (ServerNotRunningYetException e) { + // That's fine. + } + } + return online; + } + + /** + * Set maxRecoveryErrorCount in DFSClient. In 0.20 pre-append its hard-coded to 5 and + * makes tests linger. Here is the exception you'll see: + *

+   * 2010-06-15 11:52:28,511 WARN  [DataStreamer for file /hbase/.logs/wal.1276627923013 block
+   * blk_928005470262850423_1021] hdfs.DFSClient$DFSOutputStream(2657): Error Recovery for block
+   * blk_928005470262850423_1021 failed  because recovery from primary datanode 127.0.0.1:53683
+   * failed 4 times.  Pipeline was 127.0.0.1:53687, 127.0.0.1:53683. Will retry...
+   * 
+ * @param stream A DFSClient.DFSOutputStream. + * @param max + * @throws NoSuchFieldException + * @throws SecurityException + * @throws IllegalAccessException + * @throws IllegalArgumentException + */ + public static void setMaxRecoveryErrorCount(final OutputStream stream, + final int max) { + try { + Class [] clazzes = DFSClient.class.getDeclaredClasses(); + for (Class clazz: clazzes) { + String className = clazz.getSimpleName(); + if (className.equals("DFSOutputStream")) { + if (clazz.isInstance(stream)) { + Field maxRecoveryErrorCountField = + stream.getClass().getDeclaredField("maxRecoveryErrorCount"); + maxRecoveryErrorCountField.setAccessible(true); + maxRecoveryErrorCountField.setInt(stream, max); + break; + } + } + } + } catch (Exception e) { + LOG.info("Could not set max recovery field", e); + } + } + + /** + * Uses directly the assignment manager to assign the region. and waits until the specified region + * has completed assignment. + * @return true if the region is assigned false otherwise. + */ + public boolean assignRegion(final RegionInfo regionInfo) + throws IOException, InterruptedException { + final AssignmentManager am = getHBaseCluster().getMaster().getAssignmentManager(); + am.assign(regionInfo); + return AssignmentTestingUtil.waitForAssignment(am, regionInfo); + } + + /** + * Move region to destination server and wait till region is completely moved and online + * + * @param destRegion region to move + * @param destServer destination server of the region + * @throws InterruptedException + * @throws IOException + */ + public void moveRegionAndWait(RegionInfo destRegion, ServerName destServer) + throws InterruptedException, IOException { + HMaster master = getMiniHBaseCluster().getMaster(); + // TODO: Here we start the move. The move can take a while. + getAdmin().move(destRegion.getEncodedNameAsBytes(), destServer); + while (true) { + ServerName serverName = master.getAssignmentManager().getRegionStates() + .getRegionServerOfRegion(destRegion); + if (serverName != null && serverName.equals(destServer)) { + assertRegionOnServer(destRegion, serverName, 2000); + break; + } + Thread.sleep(10); + } + } + + /** + * Wait until all regions for a table in hbase:meta have a non-empty + * info:server, up to a configuable timeout value (default is 60 seconds) + * This means all regions have been deployed, + * master has been informed and updated hbase:meta with the regions deployed + * server. + * @param tableName the table name + * @throws IOException + */ + public void waitUntilAllRegionsAssigned(final TableName tableName) throws IOException { + waitUntilAllRegionsAssigned(tableName, + this.conf.getLong("hbase.client.sync.wait.timeout.msec", 60000)); + } + + /** + * Waith until all system table's regions get assigned + * @throws IOException + */ + public void waitUntilAllSystemRegionsAssigned() throws IOException { + waitUntilAllRegionsAssigned(TableName.META_TABLE_NAME); + } + + /** + * Wait until all regions for a table in hbase:meta have a non-empty + * info:server, or until timeout. This means all regions have been deployed, + * master has been informed and updated hbase:meta with the regions deployed + * server. + * @param tableName the table name + * @param timeout timeout, in milliseconds + * @throws IOException + */ + public void waitUntilAllRegionsAssigned(final TableName tableName, final long timeout) + throws IOException { + if (!TableName.isMetaTableName(tableName)) { + try (final Table meta = getConnection().getTable(TableName.META_TABLE_NAME)) { + LOG.debug("Waiting until all regions of table " + tableName + " get assigned. Timeout = " + + timeout + "ms"); + waitFor(timeout, 200, true, new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + return explainTableAvailability(tableName); + } + + @Override + public boolean evaluate() throws IOException { + Scan scan = new Scan(); + scan.addFamily(HConstants.CATALOG_FAMILY); + boolean tableFound = false; + try (ResultScanner s = meta.getScanner(scan)) { + for (Result r; (r = s.next()) != null;) { + byte[] b = r.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); + RegionInfo info = RegionInfo.parseFromOrNull(b); + if (info != null && info.getTable().equals(tableName)) { + // Get server hosting this region from catalog family. Return false if no server + // hosting this region, or if the server hosting this region was recently killed + // (for fault tolerance testing). + tableFound = true; + byte[] server = + r.getValue(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER); + if (server == null) { + return false; + } else { + byte[] startCode = + r.getValue(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER); + ServerName serverName = + ServerName.valueOf(Bytes.toString(server).replaceFirst(":", ",") + "," + + Bytes.toLong(startCode)); + if (!getHBaseClusterInterface().isDistributedCluster() && + getHBaseCluster().isKilledRS(serverName)) { + return false; + } + } + if (RegionStateStore.getRegionState(r, info) != RegionState.State.OPEN) { + return false; + } + } + } + } + if (!tableFound) { + LOG.warn("Didn't find the entries for table " + tableName + " in meta, already deleted?"); + } + return tableFound; + } + }); + } + } + LOG.info("All regions for table " + tableName + " assigned to meta. Checking AM states."); + // check from the master state if we are using a mini cluster + if (!getHBaseClusterInterface().isDistributedCluster()) { + // So, all regions are in the meta table but make sure master knows of the assignments before + // returning -- sometimes this can lag. + HMaster master = getHBaseCluster().getMaster(); + final RegionStates states = master.getAssignmentManager().getRegionStates(); + waitFor(timeout, 200, new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + return explainTableAvailability(tableName); + } + + @Override + public boolean evaluate() throws IOException { + List hris = states.getRegionsOfTable(tableName); + return hris != null && !hris.isEmpty(); + } + }); + } + LOG.info("All regions for table " + tableName + " assigned."); + } + + /** + * Do a small get/scan against one store. This is required because store + * has no actual methods of querying itself, and relies on StoreScanner. + */ + public static List getFromStoreFile(HStore store, + Get get) throws IOException { + Scan scan = new Scan(get); + InternalScanner scanner = (InternalScanner) store.getScanner(scan, + scan.getFamilyMap().get(store.getColumnFamilyDescriptor().getName()), + // originally MultiVersionConcurrencyControl.resetThreadReadPoint() was called to set + // readpoint 0. + 0); + + List result = new ArrayList<>(); + scanner.next(result); + if (!result.isEmpty()) { + // verify that we are on the row we want: + Cell kv = result.get(0); + if (!CellUtil.matchingRows(kv, get.getRow())) { + result.clear(); + } + } + scanner.close(); + return result; + } + + /** + * Create region split keys between startkey and endKey + * + * @param startKey + * @param endKey + * @param numRegions the number of regions to be created. it has to be greater than 3. + * @return resulting split keys + */ + public byte[][] getRegionSplitStartKeys(byte[] startKey, byte[] endKey, int numRegions){ + assertTrue(numRegions>3); + byte [][] tmpSplitKeys = Bytes.split(startKey, endKey, numRegions - 3); + byte [][] result = new byte[tmpSplitKeys.length+1][]; + System.arraycopy(tmpSplitKeys, 0, result, 1, tmpSplitKeys.length); + result[0] = HConstants.EMPTY_BYTE_ARRAY; + return result; + } + + /** + * Do a small get/scan against one store. This is required because store + * has no actual methods of querying itself, and relies on StoreScanner. + */ + public static List getFromStoreFile(HStore store, + byte [] row, + NavigableSet columns + ) throws IOException { + Get get = new Get(row); + Map> s = get.getFamilyMap(); + s.put(store.getColumnFamilyDescriptor().getName(), columns); + + return getFromStoreFile(store,get); + } + + public static void assertKVListsEqual(String additionalMsg, + final List expected, + final List actual) { + final int eLen = expected.size(); + final int aLen = actual.size(); + final int minLen = Math.min(eLen, aLen); + + int i; + for (i = 0; i < minLen + && CellComparator.getInstance().compare(expected.get(i), actual.get(i)) == 0; + ++i) {} + + if (additionalMsg == null) { + additionalMsg = ""; + } + if (!additionalMsg.isEmpty()) { + additionalMsg = ". " + additionalMsg; + } + + if (eLen != aLen || i != minLen) { + throw new AssertionError( + "Expected and actual KV arrays differ at position " + i + ": " + + safeGetAsStr(expected, i) + " (length " + eLen +") vs. " + + safeGetAsStr(actual, i) + " (length " + aLen + ")" + additionalMsg); + } + } + + public static String safeGetAsStr(List lst, int i) { + if (0 <= i && i < lst.size()) { + return lst.get(i).toString(); + } else { + return ""; + } + } + + public String getClusterKey() { + return conf.get(HConstants.ZOOKEEPER_QUORUM) + ":" + + conf.get(HConstants.ZOOKEEPER_CLIENT_PORT) + ":" + + conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT, + HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT); + } + + /** Creates a random table with the given parameters */ + public Table createRandomTable(TableName tableName, + final Collection families, + final int maxVersions, + final int numColsPerRow, + final int numFlushes, + final int numRegions, + final int numRowsPerFlush) + throws IOException, InterruptedException { + + LOG.info("\n\nCreating random table " + tableName + " with " + numRegions + + " regions, " + numFlushes + " storefiles per region, " + + numRowsPerFlush + " rows per flush, maxVersions=" + maxVersions + + "\n"); + + final Random rand = new Random(tableName.hashCode() * 17L + 12938197137L); + final int numCF = families.size(); + final byte[][] cfBytes = new byte[numCF][]; + { + int cfIndex = 0; + for (String cf : families) { + cfBytes[cfIndex++] = Bytes.toBytes(cf); + } + } + + final int actualStartKey = 0; + final int actualEndKey = Integer.MAX_VALUE; + final int keysPerRegion = (actualEndKey - actualStartKey) / numRegions; + final int splitStartKey = actualStartKey + keysPerRegion; + final int splitEndKey = actualEndKey - keysPerRegion; + final String keyFormat = "%08x"; + final Table table = createTable(tableName, cfBytes, + maxVersions, + Bytes.toBytes(String.format(keyFormat, splitStartKey)), + Bytes.toBytes(String.format(keyFormat, splitEndKey)), + numRegions); + + if (hbaseCluster != null) { + getMiniHBaseCluster().flushcache(TableName.META_TABLE_NAME); + } + + BufferedMutator mutator = getConnection().getBufferedMutator(tableName); + + for (int iFlush = 0; iFlush < numFlushes; ++iFlush) { + for (int iRow = 0; iRow < numRowsPerFlush; ++iRow) { + final byte[] row = Bytes.toBytes(String.format(keyFormat, + actualStartKey + rand.nextInt(actualEndKey - actualStartKey))); + + Put put = new Put(row); + Delete del = new Delete(row); + for (int iCol = 0; iCol < numColsPerRow; ++iCol) { + final byte[] cf = cfBytes[rand.nextInt(numCF)]; + final long ts = rand.nextInt(); + final byte[] qual = Bytes.toBytes("col" + iCol); + if (rand.nextBoolean()) { + final byte[] value = Bytes.toBytes("value_for_row_" + iRow + + "_cf_" + Bytes.toStringBinary(cf) + "_col_" + iCol + "_ts_" + + ts + "_random_" + rand.nextLong()); + put.addColumn(cf, qual, ts, value); + } else if (rand.nextDouble() < 0.8) { + del.addColumn(cf, qual, ts); + } else { + del.addColumns(cf, qual, ts); + } + } + + if (!put.isEmpty()) { + mutator.mutate(put); + } + + if (!del.isEmpty()) { + mutator.mutate(del); + } + } + LOG.info("Initiating flush #" + iFlush + " for table " + tableName); + mutator.flush(); + if (hbaseCluster != null) { + getMiniHBaseCluster().flushcache(table.getName()); + } + } + mutator.close(); + + return table; + } + + public static int randomFreePort() { + return HBaseCommonTestingUtil.randomFreePort(); + } + public static String randomMultiCastAddress() { + return "226.1.1." + random.nextInt(254); + } + + public static void waitForHostPort(String host, int port) + throws IOException { + final int maxTimeMs = 10000; + final int maxNumAttempts = maxTimeMs / HConstants.SOCKET_RETRY_WAIT_MS; + IOException savedException = null; + LOG.info("Waiting for server at " + host + ":" + port); + for (int attempt = 0; attempt < maxNumAttempts; ++attempt) { + try { + Socket sock = new Socket(InetAddress.getByName(host), port); + sock.close(); + savedException = null; + LOG.info("Server at " + host + ":" + port + " is available"); + break; + } catch (UnknownHostException e) { + throw new IOException("Failed to look up " + host, e); + } catch (IOException e) { + savedException = e; + } + Threads.sleepWithoutInterrupt(HConstants.SOCKET_RETRY_WAIT_MS); + } + + if (savedException != null) { + throw savedException; + } + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, + TableName tableName, byte[] columnFamily, Algorithm compression, + DataBlockEncoding dataBlockEncoding) throws IOException { + return createPreSplitLoadTestTable(conf, tableName, + columnFamily, compression, dataBlockEncoding, DEFAULT_REGIONS_PER_SERVER, 1, + Durability.USE_DEFAULT); + } + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, TableName tableName, + byte[] columnFamily, Algorithm compression, DataBlockEncoding dataBlockEncoding, + int numRegionsPerServer, int regionReplication, Durability durability) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + builder.setDurability(durability); + builder.setRegionReplication(regionReplication); + ColumnFamilyDescriptorBuilder cfBuilder = + ColumnFamilyDescriptorBuilder.newBuilder(columnFamily); + cfBuilder.setDataBlockEncoding(dataBlockEncoding); + cfBuilder.setCompressionType(compression); + return createPreSplitLoadTestTable(conf, builder.build(), cfBuilder.build(), + numRegionsPerServer); + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, TableName tableName, + byte[][] columnFamilies, Algorithm compression, DataBlockEncoding dataBlockEncoding, + int numRegionsPerServer, int regionReplication, Durability durability) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); + builder.setDurability(durability); + builder.setRegionReplication(regionReplication); + ColumnFamilyDescriptor[] hcds = new ColumnFamilyDescriptor[columnFamilies.length]; + for (int i = 0; i < columnFamilies.length; i++) { + ColumnFamilyDescriptorBuilder cfBuilder = + ColumnFamilyDescriptorBuilder.newBuilder(columnFamilies[i]); + cfBuilder.setDataBlockEncoding(dataBlockEncoding); + cfBuilder.setCompressionType(compression); + hcds[i] = cfBuilder.build(); + } + return createPreSplitLoadTestTable(conf, builder.build(), hcds, numRegionsPerServer); + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, + TableDescriptor desc, ColumnFamilyDescriptor hcd) throws IOException { + return createPreSplitLoadTestTable(conf, desc, hcd, DEFAULT_REGIONS_PER_SERVER); + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, + TableDescriptor desc, ColumnFamilyDescriptor hcd, int numRegionsPerServer) throws IOException { + return createPreSplitLoadTestTable(conf, desc, new ColumnFamilyDescriptor[] {hcd}, + numRegionsPerServer); + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, + TableDescriptor desc, ColumnFamilyDescriptor[] hcds, + int numRegionsPerServer) throws IOException { + return createPreSplitLoadTestTable(conf, desc, hcds, + new RegionSplitter.HexStringSplit(), numRegionsPerServer); + } + + /** + * Creates a pre-split table for load testing. If the table already exists, + * logs a warning and continues. + * @return the number of regions the table was split into + */ + public static int createPreSplitLoadTestTable(Configuration conf, + TableDescriptor td, ColumnFamilyDescriptor[] cds, + SplitAlgorithm splitter, int numRegionsPerServer) throws IOException { + TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(td); + for (ColumnFamilyDescriptor cd : cds) { + if (!td.hasColumnFamily(cd.getName())) { + builder.setColumnFamily(cd); + } + } + td = builder.build(); + int totalNumberOfRegions = 0; + Connection unmanagedConnection = ConnectionFactory.createConnection(conf); + Admin admin = unmanagedConnection.getAdmin(); + + try { + // create a table a pre-splits regions. + // The number of splits is set as: + // region servers * regions per region server). + int numberOfServers = admin.getRegionServers().size(); + if (numberOfServers == 0) { + throw new IllegalStateException("No live regionservers"); + } + + totalNumberOfRegions = numberOfServers * numRegionsPerServer; + LOG.info("Number of live regionservers: " + numberOfServers + ", " + + "pre-splitting table into " + totalNumberOfRegions + " regions " + + "(regions per server: " + numRegionsPerServer + ")"); + + byte[][] splits = splitter.split( + totalNumberOfRegions); + + admin.createTable(td, splits); + } catch (MasterNotRunningException e) { + LOG.error("Master not running", e); + throw new IOException(e); + } catch (TableExistsException e) { + LOG.warn("Table " + td.getTableName() + + " already exists, continuing"); + } finally { + admin.close(); + unmanagedConnection.close(); + } + return totalNumberOfRegions; + } + + public static int getMetaRSPort(Connection connection) throws IOException { + try (RegionLocator locator = connection.getRegionLocator(TableName.META_TABLE_NAME)) { + return locator.getRegionLocation(Bytes.toBytes("")).getPort(); + } + } + + /** + * Due to async racing issue, a region may not be in + * the online region list of a region server yet, after + * the assignment znode is deleted and the new assignment + * is recorded in master. + */ + public void assertRegionOnServer( + final RegionInfo hri, final ServerName server, + final long timeout) throws IOException, InterruptedException { + long timeoutTime = EnvironmentEdgeManager.currentTime() + timeout; + while (true) { + List regions = getAdmin().getRegions(server); + if (regions.stream().anyMatch(r -> RegionInfo.COMPARATOR.compare(r, hri) == 0)) return; + long now = EnvironmentEdgeManager.currentTime(); + if (now > timeoutTime) break; + Thread.sleep(10); + } + fail("Could not find region " + hri.getRegionNameAsString() + + " on server " + server); + } + + /** + * Check to make sure the region is open on the specified + * region server, but not on any other one. + */ + public void assertRegionOnlyOnServer( + final RegionInfo hri, final ServerName server, + final long timeout) throws IOException, InterruptedException { + long timeoutTime = EnvironmentEdgeManager.currentTime() + timeout; + while (true) { + List regions = getAdmin().getRegions(server); + if (regions.stream().anyMatch(r -> RegionInfo.COMPARATOR.compare(r, hri) == 0)) { + List rsThreads = + getHBaseCluster().getLiveRegionServerThreads(); + for (JVMClusterUtil.RegionServerThread rsThread: rsThreads) { + HRegionServer rs = rsThread.getRegionServer(); + if (server.equals(rs.getServerName())) { + continue; + } + Collection hrs = rs.getOnlineRegionsLocalContext(); + for (HRegion r: hrs) { + assertTrue("Region should not be double assigned", + r.getRegionInfo().getRegionId() != hri.getRegionId()); + } + } + return; // good, we are happy + } + long now = EnvironmentEdgeManager.currentTime(); + if (now > timeoutTime) break; + Thread.sleep(10); + } + fail("Could not find region " + hri.getRegionNameAsString() + + " on server " + server); + } + + public HRegion createTestRegion(String tableName, ColumnFamilyDescriptor cd) throws IOException { + TableDescriptor td = + TableDescriptorBuilder.newBuilder(TableName.valueOf(tableName)).setColumnFamily(cd).build(); + RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(tableName)).build(); + return createRegionAndWAL(info, getDataTestDir(), getConfiguration(), td); + } + + public HRegion createTestRegion(String tableName, ColumnFamilyDescriptor cd, + BlockCache blockCache) throws IOException { + TableDescriptor td = + TableDescriptorBuilder.newBuilder(TableName.valueOf(tableName)).setColumnFamily(cd).build(); + RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(tableName)).build(); + return createRegionAndWAL(info, getDataTestDir(), getConfiguration(), td, blockCache); + } + + public static void setFileSystemURI(String fsURI) { + FS_URI = fsURI; + } + + /** + * Returns a {@link Predicate} for checking that there are no regions in transition in master + */ + public ExplainingPredicate predicateNoRegionsInTransition() { + return new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + final RegionStates regionStates = getMiniHBaseCluster().getMaster() + .getAssignmentManager().getRegionStates(); + return "found in transition: " + regionStates.getRegionsInTransition().toString(); + } + + @Override + public boolean evaluate() throws IOException { + HMaster master = getMiniHBaseCluster().getMaster(); + if (master == null) return false; + AssignmentManager am = master.getAssignmentManager(); + if (am == null) return false; + return !am.hasRegionsInTransition(); + } + }; + } + + /** + * Returns a {@link Predicate} for checking that table is enabled + */ + public Waiter.Predicate predicateTableEnabled(final TableName tableName) { + return new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + return explainTableState(tableName, TableState.State.ENABLED); + } + + @Override + public boolean evaluate() throws IOException { + return getAdmin().tableExists(tableName) && getAdmin().isTableEnabled(tableName); + } + }; + } + + /** + * Returns a {@link Predicate} for checking that table is enabled + */ + public Waiter.Predicate predicateTableDisabled(final TableName tableName) { + return new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + return explainTableState(tableName, TableState.State.DISABLED); + } + + @Override + public boolean evaluate() throws IOException { + return getAdmin().isTableDisabled(tableName); + } + }; + } + + /** + * Returns a {@link Predicate} for checking that table is enabled + */ + public Waiter.Predicate predicateTableAvailable(final TableName tableName) { + return new ExplainingPredicate() { + @Override + public String explainFailure() throws IOException { + return explainTableAvailability(tableName); + } + + @Override + public boolean evaluate() throws IOException { + boolean tableAvailable = getAdmin().isTableAvailable(tableName); + if (tableAvailable) { + try (Table table = getConnection().getTable(tableName)) { + TableDescriptor htd = table.getDescriptor(); + for (HRegionLocation loc : getConnection().getRegionLocator(tableName) + .getAllRegionLocations()) { + Scan scan = new Scan().withStartRow(loc.getRegion().getStartKey()) + .withStopRow(loc.getRegion().getEndKey()).setOneRowLimit() + .setMaxResultsPerColumnFamily(1).setCacheBlocks(false); + for (byte[] family : htd.getColumnFamilyNames()) { + scan.addFamily(family); + } + try (ResultScanner scanner = table.getScanner(scan)) { + scanner.next(); + } + } + } + } + return tableAvailable; + } + }; + } + + /** + * Wait until no regions in transition. + * @param timeout How long to wait. + * @throws IOException + */ + public void waitUntilNoRegionsInTransition(final long timeout) throws IOException { + waitFor(timeout, predicateNoRegionsInTransition()); + } + + /** + * Wait until no regions in transition. (time limit 15min) + * @throws IOException + */ + public void waitUntilNoRegionsInTransition() throws IOException { + waitUntilNoRegionsInTransition(15 * 60000); + } + + /** + * Wait until labels is ready in VisibilityLabelsCache. + * @param timeoutMillis + * @param labels + */ + public void waitLabelAvailable(long timeoutMillis, final String... labels) { + final VisibilityLabelsCache labelsCache = VisibilityLabelsCache.get(); + waitFor(timeoutMillis, new Waiter.ExplainingPredicate() { + + @Override + public boolean evaluate() { + for (String label : labels) { + if (labelsCache.getLabelOrdinal(label) == 0) { + return false; + } + } + return true; + } + + @Override + public String explainFailure() { + for (String label : labels) { + if (labelsCache.getLabelOrdinal(label) == 0) { + return label + " is not available yet"; + } + } + return ""; + } + }); + } + + /** + * Create a set of column descriptors with the combination of compression, + * encoding, bloom codecs available. + * @return the list of column descriptors + */ + public static List generateColumnDescriptors() { + return generateColumnDescriptors(""); + } + + /** + * Create a set of column descriptors with the combination of compression, + * encoding, bloom codecs available. + * @param prefix family names prefix + * @return the list of column descriptors + */ + public static List generateColumnDescriptors(final String prefix) { + List columnFamilyDescriptors = new ArrayList<>(); + long familyId = 0; + for (Compression.Algorithm compressionType: getSupportedCompressionAlgorithms()) { + for (DataBlockEncoding encodingType: DataBlockEncoding.values()) { + for (BloomType bloomType: BloomType.values()) { + String name = String.format("%s-cf-!@#&-%d!@#", prefix, familyId); + ColumnFamilyDescriptorBuilder columnFamilyDescriptorBuilder = + ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(name)); + columnFamilyDescriptorBuilder.setCompressionType(compressionType); + columnFamilyDescriptorBuilder.setDataBlockEncoding(encodingType); + columnFamilyDescriptorBuilder.setBloomFilterType(bloomType); + columnFamilyDescriptors.add(columnFamilyDescriptorBuilder.build()); + familyId++; + } + } + } + return columnFamilyDescriptors; + } + + /** + * Get supported compression algorithms. + * @return supported compression algorithms. + */ + public static Compression.Algorithm[] getSupportedCompressionAlgorithms() { + String[] allAlgos = HFile.getSupportedCompressionAlgorithms(); + List supportedAlgos = new ArrayList<>(); + for (String algoName : allAlgos) { + try { + Compression.Algorithm algo = Compression.getCompressionAlgorithmByName(algoName); + algo.getCompressor(); + supportedAlgos.add(algo); + } catch (Throwable t) { + // this algo is not available + } + } + return supportedAlgos.toArray(new Algorithm[supportedAlgos.size()]); + } + + public Result getClosestRowBefore(Region r, byte[] row, byte[] family) throws IOException { + Scan scan = new Scan().withStartRow(row); + scan.setReadType(ReadType.PREAD); + scan.setCaching(1); + scan.setReversed(true); + scan.addFamily(family); + try (RegionScanner scanner = r.getScanner(scan)) { + List cells = new ArrayList<>(1); + scanner.next(cells); + if (r.getRegionInfo().isMetaRegion() && !isTargetTable(row, cells.get(0))) { + return null; + } + return Result.create(cells); + } + } + + private boolean isTargetTable(final byte[] inRow, Cell c) { + String inputRowString = Bytes.toString(inRow); + int i = inputRowString.indexOf(HConstants.DELIMITER); + String outputRowString = Bytes.toString(c.getRowArray(), c.getRowOffset(), c.getRowLength()); + int o = outputRowString.indexOf(HConstants.DELIMITER); + return inputRowString.substring(0, i).equals(outputRowString.substring(0, o)); + } + + /** + * Sets up {@link MiniKdc} for testing security. + * Uses {@link HBaseKerberosUtils} to set the given keytab file as + * {@link HBaseKerberosUtils#KRB_KEYTAB_FILE}. + * FYI, there is also the easier-to-use kerby KDC server and utility for using it, + * {@link org.apache.hadoop.hbase.util.SimpleKdcServerUtil}. The kerby KDC server is preferred; + * less baggage. It came in in HBASE-5291. + */ + public MiniKdc setupMiniKdc(File keytabFile) throws Exception { + Properties conf = MiniKdc.createConf(); + conf.put(MiniKdc.DEBUG, true); + MiniKdc kdc = null; + File dir = null; + // There is time lag between selecting a port and trying to bind with it. It's possible that + // another service captures the port in between which'll result in BindException. + boolean bindException; + int numTries = 0; + do { + try { + bindException = false; + dir = new File(getDataTestDir("kdc").toUri().getPath()); + kdc = new MiniKdc(conf, dir); + kdc.start(); + } catch (BindException e) { + FileUtils.deleteDirectory(dir); // clean directory + numTries++; + if (numTries == 3) { + LOG.error("Failed setting up MiniKDC. Tried " + numTries + " times."); + throw e; + } + LOG.error("BindException encountered when setting up MiniKdc. Trying again."); + bindException = true; + } + } while (bindException); + HBaseKerberosUtils.setKeytabFileForTesting(keytabFile.getAbsolutePath()); + return kdc; + } + + public int getNumHFiles(final TableName tableName, final byte[] family) { + int numHFiles = 0; + for (RegionServerThread regionServerThread : getMiniHBaseCluster().getRegionServerThreads()) { + numHFiles+= getNumHFilesForRS(regionServerThread.getRegionServer(), tableName, + family); + } + return numHFiles; + } + + public int getNumHFilesForRS(final HRegionServer rs, final TableName tableName, + final byte[] family) { + int numHFiles = 0; + for (Region region : rs.getRegions(tableName)) { + numHFiles += region.getStore(family).getStorefilesCount(); + } + return numHFiles; + } + + public void verifyTableDescriptorIgnoreTableName(TableDescriptor ltd, TableDescriptor rtd) { + assertEquals(ltd.getValues().hashCode(), rtd.getValues().hashCode()); + Collection ltdFamilies = Arrays.asList(ltd.getColumnFamilies()); + Collection rtdFamilies = Arrays.asList(rtd.getColumnFamilies()); + assertEquals(ltdFamilies.size(), rtdFamilies.size()); + for (Iterator it = ltdFamilies.iterator(), it2 = + rtdFamilies.iterator(); it.hasNext();) { + assertEquals(0, + ColumnFamilyDescriptor.COMPARATOR.compare(it.next(), it2.next())); + } + } + + /** + * Await the successful return of {@code condition}, sleeping {@code sleepMillis} between + * invocations. + */ + public static void await(final long sleepMillis, final BooleanSupplier condition) + throws InterruptedException { + try { + while (!condition.getAsBoolean()) { + Thread.sleep(sleepMillis); + } + } catch (RuntimeException e) { + if (e.getCause() instanceof AssertionError) { + throw (AssertionError) e.getCause(); + } + throw e; + } + } +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java index 4ee068f98e5..099b82b5e95 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java @@ -28,22 +28,25 @@ import org.junit.rules.ExternalResource; import org.junit.rules.TestRule; /** - * A {@link TestRule} that manages an instance of the {@link MiniHBaseCluster}. Can be used in - * either the {@link Rule} or {@link ClassRule} positions. Built on top of an instance of - * {@link HBaseTestingUtility}, so be weary of intermixing direct use of that class with this Rule. + * A {@link TestRule} that manages an instance of the {@link SingleProcessHBaseCluster}. Can be used + * in either the {@link Rule} or {@link ClassRule} positions. Built on top of an instance of + * {@link HBaseTestingUtil}, so be weary of intermixing direct use of that class with this Rule. *

* Use in combination with {@link ConnectionRule}, for example: * - *
{@code
+ * 
+ * {
+ *   @code
  *   public class TestMyClass {
- *     @ClassRule
+ *     @ClassRule
  *     public static final MiniClusterRule miniClusterRule = MiniClusterRule.newBuilder().build();
  *
- *     @Rule
+ *     @Rule
  *     public final ConnectionRule connectionRule =
  *       new ConnectionRule(miniClusterRule::createConnection);
  *   }
- * }
+ * } + *
*/ public final class MiniClusterRule extends ExternalResource { @@ -52,19 +55,20 @@ public final class MiniClusterRule extends ExternalResource { */ public static class Builder { - private StartMiniClusterOption miniClusterOption; + private StartTestingClusterOption miniClusterOption; private Configuration conf; /** - * Use the provided {@link StartMiniClusterOption} to construct the {@link MiniHBaseCluster}. + * Use the provided {@link StartTestingClusterOption} to construct the + * {@link SingleProcessHBaseCluster}. */ - public Builder setMiniClusterOption(final StartMiniClusterOption miniClusterOption) { + public Builder setMiniClusterOption(final StartTestingClusterOption miniClusterOption) { this.miniClusterOption = miniClusterOption; return this; } /** - * Seed the underlying {@link HBaseTestingUtility} with the provided {@link Configuration}. + * Seed the underlying {@link HBaseTestingUtil} with the provided {@link Configuration}. */ public Builder setConfiguration(final Configuration conf) { this.conf = conf; @@ -72,22 +76,19 @@ public final class MiniClusterRule extends ExternalResource { } public MiniClusterRule build() { - return new MiniClusterRule( - conf, - miniClusterOption != null - ? miniClusterOption - : StartMiniClusterOption.builder().build()); + return new MiniClusterRule(conf, miniClusterOption != null ? miniClusterOption : + StartTestingClusterOption.builder().build()); } } - private final HBaseTestingUtility testingUtility; - private final StartMiniClusterOption miniClusterOptions; + private final HBaseTestingUtil testingUtility; + private final StartTestingClusterOption miniClusterOptions; - private MiniHBaseCluster miniCluster; + private SingleProcessHBaseCluster miniCluster; private MiniClusterRule(final Configuration conf, - final StartMiniClusterOption miniClusterOptions) { - this.testingUtility = new HBaseTestingUtility(conf); + final StartTestingClusterOption miniClusterOptions) { + this.testingUtility = new HBaseTestingUtil(conf); this.miniClusterOptions = miniClusterOptions; } @@ -96,15 +97,15 @@ public final class MiniClusterRule extends ExternalResource { } /** - * @return the underlying instance of {@link HBaseTestingUtility} + * @return the underlying instance of {@link HBaseTestingUtil} */ - public HBaseTestingUtility getTestingUtility() { + public HBaseTestingUtil getTestingUtility() { return testingUtility; } /** - * Create a {@link AsyncConnection} to the managed {@link MiniHBaseCluster}. It's up to the caller - * to {@link AsyncConnection#close() close()} the connection when finished. + * Create a {@link AsyncConnection} to the managed {@link SingleProcessHBaseCluster}. It's up to + * the caller to {@link AsyncConnection#close() close()} the connection when finished. */ public CompletableFuture createConnection() { if (miniCluster == null) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java index f0a85b580d4..82f7a85df39 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MockRegionServerServices.java @@ -84,17 +84,17 @@ public class MockRegionServerServices implements RegionServerServices { private volatile boolean stopping = false; private final AtomicBoolean running = new AtomicBoolean(true); - MockRegionServerServices(ZKWatcher zkw) { + public MockRegionServerServices(ZKWatcher zkw) { this(zkw, null); } - MockRegionServerServices(ZKWatcher zkw, ServerName serverName) { + public MockRegionServerServices(ZKWatcher zkw, ServerName serverName) { this.zkw = zkw; this.serverName = serverName; this.conf = (zkw == null ? new Configuration() : zkw.getConfiguration()); } - MockRegionServerServices(){ + public MockRegionServerServices(){ this(null, null); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ProcedureTestUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ProcedureTestUtil.java index ff23d85616b..b4ba729b1d5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ProcedureTestUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ProcedureTestUtil.java @@ -38,7 +38,7 @@ public final class ProcedureTestUtil { private ProcedureTestUtil() { } - private static Optional getProcedure(HBaseTestingUtility util, + private static Optional getProcedure(HBaseTestingUtil util, Class> clazz, JsonParser parser) throws IOException { JsonArray array = parser.parse(util.getAdmin().getProcedures()).getAsJsonArray(); Iterator iterator = array.iterator(); @@ -53,7 +53,7 @@ public final class ProcedureTestUtil { return Optional.empty(); } - public static void waitUntilProcedureWaitingTimeout(HBaseTestingUtility util, + public static void waitUntilProcedureWaitingTimeout(HBaseTestingUtil util, Class> clazz, long timeout) throws IOException { JsonParser parser = new JsonParser(); util.waitFor(timeout, @@ -62,7 +62,7 @@ public final class ProcedureTestUtil { .isPresent()); } - public static void waitUntilProcedureTimeoutIncrease(HBaseTestingUtility util, + public static void waitUntilProcedureTimeoutIncrease(HBaseTestingUtil util, Class> clazz, int times) throws IOException, InterruptedException { JsonParser parser = new JsonParser(); long oldTimeout = 0; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/SingleProcessHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/SingleProcessHBaseCluster.java new file mode 100644 index 00000000000..dc899e038fa --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/SingleProcessHBaseCluster.java @@ -0,0 +1,928 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import java.io.IOException; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hbase.client.RegionInfoBuilder; +import org.apache.hadoop.hbase.master.HMaster; +import org.apache.hadoop.hbase.regionserver.HRegion; +import org.apache.hadoop.hbase.regionserver.HRegion.FlushResult; +import org.apache.hadoop.hbase.regionserver.HRegionServer; +import org.apache.hadoop.hbase.regionserver.Region; +import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.test.MetricsAssertHelper; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.hbase.util.JVMClusterUtil; +import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; +import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; +import org.apache.hadoop.hbase.util.Threads; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; + +/** + * This class creates a single process HBase cluster. + * each server. The master uses the 'default' FileSystem. The RegionServers, + * if we are running on DistributedFilesystem, create a FileSystem instance + * each and will close down their instance on the way out. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public class SingleProcessHBaseCluster extends HBaseClusterInterface { + private static final Logger LOG = + LoggerFactory.getLogger(SingleProcessHBaseCluster.class.getName()); + public LocalHBaseCluster hbaseCluster; + private static int index; + + /** + * Start a MiniHBaseCluster. + * @param conf Configuration to be used for cluster + * @param numRegionServers initial number of region servers to start. + */ + public SingleProcessHBaseCluster(Configuration conf, int numRegionServers) + throws IOException, InterruptedException { + this(conf, 1, numRegionServers); + } + + /** + * Start a MiniHBaseCluster. + * @param conf Configuration to be used for cluster + * @param numMasters initial number of masters to start. + * @param numRegionServers initial number of region servers to start. + */ + public SingleProcessHBaseCluster(Configuration conf, int numMasters, int numRegionServers) + throws IOException, InterruptedException { + this(conf, numMasters, numRegionServers, null, null); + } + + /** + * Start a MiniHBaseCluster. + * @param conf Configuration to be used for cluster + * @param numMasters initial number of masters to start. + * @param numRegionServers initial number of region servers to start. + */ + public SingleProcessHBaseCluster(Configuration conf, int numMasters, int numRegionServers, + Class masterClass, + Class regionserverClass) + throws IOException, InterruptedException { + this(conf, numMasters, 0, numRegionServers, null, masterClass, regionserverClass); + } + + /** + * @param rsPorts Ports that RegionServer should use; pass ports if you want to test cluster + * restart where for sure the regionservers come up on same address+port (but just with + * different startcode); by default mini hbase clusters choose new arbitrary ports on + * each cluster start. + */ + public SingleProcessHBaseCluster(Configuration conf, int numMasters, int numAlwaysStandByMasters, + int numRegionServers, List rsPorts, Class masterClass, + Class regionserverClass) + throws IOException, InterruptedException { + super(conf); + + // Hadoop 2 + CompatibilityFactory.getInstance(MetricsAssertHelper.class).init(); + + init(numMasters, numAlwaysStandByMasters, numRegionServers, rsPorts, masterClass, + regionserverClass); + this.initialClusterStatus = getClusterMetrics(); + } + + public Configuration getConfiguration() { + return this.conf; + } + + /** + * Subclass so can get at protected methods (none at moment). Also, creates + * a FileSystem instance per instantiation. Adds a shutdown own FileSystem + * on the way out. Shuts down own Filesystem only, not All filesystems as + * the FileSystem system exit hook does. + */ + public static class MiniHBaseClusterRegionServer extends HRegionServer { + private Thread shutdownThread = null; + private User user = null; + /** + * List of RegionServers killed so far. ServerName also comprises startCode of a server, + * so any restarted instances of the same server will have different ServerName and will not + * coincide with past dead ones. So there's no need to cleanup this list. + */ + static Set killedServers = new HashSet<>(); + + public MiniHBaseClusterRegionServer(Configuration conf) + throws IOException, InterruptedException { + super(conf); + this.user = User.getCurrent(); + } + + @Override + protected void handleReportForDutyResponse( + final RegionServerStartupResponse c) throws IOException { + super.handleReportForDutyResponse(c); + // Run this thread to shutdown our filesystem on way out. + this.shutdownThread = new SingleFileSystemShutdownThread(getFileSystem()); + } + + @Override + public void run() { + try { + this.user.runAs(new PrivilegedAction() { + @Override + public Object run() { + runRegionServer(); + return null; + } + }); + } catch (Throwable t) { + LOG.error("Exception in run", t); + } finally { + // Run this on the way out. + if (this.shutdownThread != null) { + this.shutdownThread.start(); + Threads.shutdown(this.shutdownThread, 30000); + } + } + } + + private void runRegionServer() { + super.run(); + } + + @Override + protected void kill() { + killedServers.add(getServerName()); + super.kill(); + } + + @Override + public void abort(final String reason, final Throwable cause) { + this.user.runAs(new PrivilegedAction() { + @Override + public Object run() { + abortRegionServer(reason, cause); + return null; + } + }); + } + + private void abortRegionServer(String reason, Throwable cause) { + super.abort(reason, cause); + } + } + + /** + * Alternate shutdown hook. + * Just shuts down the passed fs, not all as default filesystem hook does. + */ + static class SingleFileSystemShutdownThread extends Thread { + private final FileSystem fs; + SingleFileSystemShutdownThread(final FileSystem fs) { + super("Shutdown of " + fs); + this.fs = fs; + } + @Override + public void run() { + try { + LOG.info("Hook closing fs=" + this.fs); + this.fs.close(); + } catch (NullPointerException npe) { + LOG.debug("Need to fix these: " + npe.toString()); + } catch (IOException e) { + LOG.warn("Running hook", e); + } + } + } + + private void init(final int nMasterNodes, final int numAlwaysStandByMasters, + final int nRegionNodes, List rsPorts, Class masterClass, + Class regionserverClass) + throws IOException, InterruptedException { + try { + if (masterClass == null) { + masterClass = HMaster.class; + } + if (regionserverClass == null) { + regionserverClass = SingleProcessHBaseCluster.MiniHBaseClusterRegionServer.class; + } + + // start up a LocalHBaseCluster + hbaseCluster = new LocalHBaseCluster(conf, nMasterNodes, numAlwaysStandByMasters, 0, + masterClass, regionserverClass); + + // manually add the regionservers as other users + for (int i = 0; i < nRegionNodes; i++) { + Configuration rsConf = HBaseConfiguration.create(conf); + if (rsPorts != null) { + rsConf.setInt(HConstants.REGIONSERVER_PORT, rsPorts.get(i)); + } + User user = HBaseTestingUtil.getDifferentUser(rsConf, + ".hfs."+index++); + hbaseCluster.addRegionServer(rsConf, i, user); + } + + hbaseCluster.startup(); + } catch (IOException e) { + shutdown(); + throw e; + } catch (Throwable t) { + LOG.error("Error starting cluster", t); + shutdown(); + throw new IOException("Shutting down", t); + } + } + + @Override + public void startRegionServer(String hostname, int port) throws IOException { + final Configuration newConf = HBaseConfiguration.create(conf); + newConf.setInt(HConstants.REGIONSERVER_PORT, port); + startRegionServer(newConf); + } + + @Override + public void killRegionServer(ServerName serverName) throws IOException { + HRegionServer server = getRegionServer(getRegionServerIndex(serverName)); + if (server instanceof MiniHBaseClusterRegionServer) { + LOG.info("Killing " + server.toString()); + ((MiniHBaseClusterRegionServer) server).kill(); + } else { + abortRegionServer(getRegionServerIndex(serverName)); + } + } + + @Override + public boolean isKilledRS(ServerName serverName) { + return MiniHBaseClusterRegionServer.killedServers.contains(serverName); + } + + @Override + public void stopRegionServer(ServerName serverName) throws IOException { + stopRegionServer(getRegionServerIndex(serverName)); + } + + @Override + public void suspendRegionServer(ServerName serverName) throws IOException { + suspendRegionServer(getRegionServerIndex(serverName)); + } + + @Override + public void resumeRegionServer(ServerName serverName) throws IOException { + resumeRegionServer(getRegionServerIndex(serverName)); + } + + @Override + public void waitForRegionServerToStop(ServerName serverName, long timeout) throws IOException { + //ignore timeout for now + waitOnRegionServer(getRegionServerIndex(serverName)); + } + + @Override + public void startZkNode(String hostname, int port) throws IOException { + LOG.warn("Starting zookeeper nodes on mini cluster is not supported"); + } + + @Override + public void killZkNode(ServerName serverName) throws IOException { + LOG.warn("Aborting zookeeper nodes on mini cluster is not supported"); + } + + @Override + public void stopZkNode(ServerName serverName) throws IOException { + LOG.warn("Stopping zookeeper nodes on mini cluster is not supported"); + } + + @Override + public void waitForZkNodeToStart(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for zookeeper nodes to start on mini cluster is not supported"); + } + + @Override + public void waitForZkNodeToStop(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for zookeeper nodes to stop on mini cluster is not supported"); + } + + @Override + public void startDataNode(ServerName serverName) throws IOException { + LOG.warn("Starting datanodes on mini cluster is not supported"); + } + + @Override + public void killDataNode(ServerName serverName) throws IOException { + LOG.warn("Aborting datanodes on mini cluster is not supported"); + } + + @Override + public void stopDataNode(ServerName serverName) throws IOException { + LOG.warn("Stopping datanodes on mini cluster is not supported"); + } + + @Override + public void waitForDataNodeToStart(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for datanodes to start on mini cluster is not supported"); + } + + @Override + public void waitForDataNodeToStop(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for datanodes to stop on mini cluster is not supported"); + } + + @Override + public void startNameNode(ServerName serverName) throws IOException { + LOG.warn("Starting namenodes on mini cluster is not supported"); + } + + @Override + public void killNameNode(ServerName serverName) throws IOException { + LOG.warn("Aborting namenodes on mini cluster is not supported"); + } + + @Override + public void stopNameNode(ServerName serverName) throws IOException { + LOG.warn("Stopping namenodes on mini cluster is not supported"); + } + + @Override + public void waitForNameNodeToStart(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for namenodes to start on mini cluster is not supported"); + } + + @Override + public void waitForNameNodeToStop(ServerName serverName, long timeout) throws IOException { + LOG.warn("Waiting for namenodes to stop on mini cluster is not supported"); + } + + @Override + public void startMaster(String hostname, int port) throws IOException { + this.startMaster(); + } + + @Override + public void killMaster(ServerName serverName) throws IOException { + abortMaster(getMasterIndex(serverName)); + } + + @Override + public void stopMaster(ServerName serverName) throws IOException { + stopMaster(getMasterIndex(serverName)); + } + + @Override + public void waitForMasterToStop(ServerName serverName, long timeout) throws IOException { + //ignore timeout for now + waitOnMaster(getMasterIndex(serverName)); + } + + /** + * Starts a region server thread running + * @return New RegionServerThread + */ + public JVMClusterUtil.RegionServerThread startRegionServer() + throws IOException { + final Configuration newConf = HBaseConfiguration.create(conf); + return startRegionServer(newConf); + } + + private JVMClusterUtil.RegionServerThread startRegionServer(Configuration configuration) + throws IOException { + User rsUser = + HBaseTestingUtil.getDifferentUser(configuration, ".hfs."+index++); + JVMClusterUtil.RegionServerThread t = null; + try { + t = hbaseCluster.addRegionServer( + configuration, hbaseCluster.getRegionServers().size(), rsUser); + t.start(); + t.waitForServerOnline(); + } catch (InterruptedException ie) { + throw new IOException("Interrupted adding regionserver to cluster", ie); + } + return t; + } + + /** + * Starts a region server thread and waits until its processed by master. Throws an exception + * when it can't start a region server or when the region server is not processed by master + * within the timeout. + * + * @return New RegionServerThread + */ + public JVMClusterUtil.RegionServerThread startRegionServerAndWait(long timeout) + throws IOException { + + JVMClusterUtil.RegionServerThread t = startRegionServer(); + ServerName rsServerName = t.getRegionServer().getServerName(); + + long start = EnvironmentEdgeManager.currentTime(); + ClusterMetrics clusterStatus = getClusterMetrics(); + while ((EnvironmentEdgeManager.currentTime() - start) < timeout) { + if (clusterStatus != null && clusterStatus.getLiveServerMetrics().containsKey(rsServerName)) { + return t; + } + Threads.sleep(100); + } + if (t.getRegionServer().isOnline()) { + throw new IOException("RS: " + rsServerName + " online, but not processed by master"); + } else { + throw new IOException("RS: " + rsServerName + " is offline"); + } + } + + /** + * Cause a region server to exit doing basic clean up only on its way out. + * @param serverNumber Used as index into a list. + */ + public String abortRegionServer(int serverNumber) { + HRegionServer server = getRegionServer(serverNumber); + LOG.info("Aborting " + server.toString()); + server.abort("Aborting for tests", new Exception("Trace info")); + return server.toString(); + } + + /** + * Shut down the specified region server cleanly + * + * @param serverNumber Used as index into a list. + * @return the region server that was stopped + */ + public JVMClusterUtil.RegionServerThread stopRegionServer(int serverNumber) { + return stopRegionServer(serverNumber, true); + } + + /** + * Shut down the specified region server cleanly + * @param serverNumber Used as index into a list. + * @param shutdownFS True is we are to shutdown the filesystem as part of this regionserver's + * shutdown. Usually we do but you do not want to do this if you are running multiple + * regionservers in a test and you shut down one before end of the test. + * @return the region server that was stopped + */ + public JVMClusterUtil.RegionServerThread stopRegionServer(int serverNumber, + final boolean shutdownFS) { + JVMClusterUtil.RegionServerThread server = + hbaseCluster.getRegionServers().get(serverNumber); + LOG.info("Stopping " + server.toString()); + server.getRegionServer().stop("Stopping rs " + serverNumber); + return server; + } + + /** + * Suspend the specified region server + * @param serverNumber Used as index into a list. + */ + public JVMClusterUtil.RegionServerThread suspendRegionServer(int serverNumber) { + JVMClusterUtil.RegionServerThread server = + hbaseCluster.getRegionServers().get(serverNumber); + LOG.info("Suspending {}", server.toString()); + server.suspend(); + return server; + } + + /** + * Resume the specified region server + * @param serverNumber Used as index into a list. + */ + public JVMClusterUtil.RegionServerThread resumeRegionServer(int serverNumber) { + JVMClusterUtil.RegionServerThread server = + hbaseCluster.getRegionServers().get(serverNumber); + LOG.info("Resuming {}", server.toString()); + server.resume(); + return server; + } + + /** + * Wait for the specified region server to stop. Removes this thread from list of running threads. + * @return Name of region server that just went down. + */ + public String waitOnRegionServer(final int serverNumber) { + return this.hbaseCluster.waitOnRegionServer(serverNumber); + } + + + /** + * Starts a master thread running + * + * @return New RegionServerThread + */ + public JVMClusterUtil.MasterThread startMaster() throws IOException { + Configuration c = HBaseConfiguration.create(conf); + User user = + HBaseTestingUtil.getDifferentUser(c, ".hfs."+index++); + + JVMClusterUtil.MasterThread t = null; + try { + t = hbaseCluster.addMaster(c, hbaseCluster.getMasters().size(), user); + t.start(); + } catch (InterruptedException ie) { + throw new IOException("Interrupted adding master to cluster", ie); + } + conf.set(HConstants.MASTER_ADDRS_KEY, + hbaseCluster.getConfiguration().get(HConstants.MASTER_ADDRS_KEY)); + return t; + } + + /** + * Returns the current active master, if available. + * @return the active HMaster, null if none is active. + */ + public HMaster getMaster() { + return this.hbaseCluster.getActiveMaster(); + } + + /** + * Returns the current active master thread, if available. + * @return the active MasterThread, null if none is active. + */ + public MasterThread getMasterThread() { + for (MasterThread mt: hbaseCluster.getLiveMasters()) { + if (mt.getMaster().isActiveMaster()) { + return mt; + } + } + return null; + } + + /** + * Returns the master at the specified index, if available. + * @return the active HMaster, null if none is active. + */ + public HMaster getMaster(final int serverNumber) { + return this.hbaseCluster.getMaster(serverNumber); + } + + /** + * Cause a master to exit without shutting down entire cluster. + * @param serverNumber Used as index into a list. + */ + public String abortMaster(int serverNumber) { + HMaster server = getMaster(serverNumber); + LOG.info("Aborting " + server.toString()); + server.abort("Aborting for tests", new Exception("Trace info")); + return server.toString(); + } + + /** + * Shut down the specified master cleanly + * + * @param serverNumber Used as index into a list. + * @return the region server that was stopped + */ + public JVMClusterUtil.MasterThread stopMaster(int serverNumber) { + return stopMaster(serverNumber, true); + } + + /** + * Shut down the specified master cleanly + * @param serverNumber Used as index into a list. + * @param shutdownFS True is we are to shutdown the filesystem as part of this master's shutdown. + * Usually we do but you do not want to do this if you are running multiple master in a + * test and you shut down one before end of the test. + * @return the master that was stopped + */ + public JVMClusterUtil.MasterThread stopMaster(int serverNumber, + final boolean shutdownFS) { + JVMClusterUtil.MasterThread server = + hbaseCluster.getMasters().get(serverNumber); + LOG.info("Stopping " + server.toString()); + server.getMaster().stop("Stopping master " + serverNumber); + return server; + } + + /** + * Wait for the specified master to stop. Removes this thread from list of running threads. + * @return Name of master that just went down. + */ + public String waitOnMaster(final int serverNumber) { + return this.hbaseCluster.waitOnMaster(serverNumber); + } + + /** + * Blocks until there is an active master and that master has completed + * initialization. + * + * @return true if an active master becomes available. false if there are no + * masters left. + */ + @Override + public boolean waitForActiveAndReadyMaster(long timeout) throws IOException { + List mts; + long start = EnvironmentEdgeManager.currentTime(); + while (!(mts = getMasterThreads()).isEmpty() + && (EnvironmentEdgeManager.currentTime() - start) < timeout) { + for (JVMClusterUtil.MasterThread mt : mts) { + if (mt.getMaster().isActiveMaster() && mt.getMaster().isInitialized()) { + return true; + } + } + + Threads.sleep(100); + } + return false; + } + + /** + * Returns list of master threads. + */ + public List getMasterThreads() { + return this.hbaseCluster.getMasters(); + } + + /** + * Returns list of live master threads (skips the aborted and the killed) + */ + public List getLiveMasterThreads() { + return this.hbaseCluster.getLiveMasters(); + } + + /** + * Wait for Mini HBase Cluster to shut down. + */ + public void join() { + this.hbaseCluster.join(); + } + + /** + * Shut down the mini HBase cluster + */ + @Override + public void shutdown() throws IOException { + if (this.hbaseCluster != null) { + this.hbaseCluster.shutdown(); + } + } + + @Override + public void close() throws IOException { + } + + @Override + public ClusterMetrics getClusterMetrics() throws IOException { + HMaster master = getMaster(); + return master == null ? null : master.getClusterMetrics(); + } + + private void executeFlush(HRegion region) throws IOException { + // retry 5 times if we can not flush + for (int i = 0; i < 5; i++) { + FlushResult result = region.flush(true); + if (result.getResult() != FlushResult.Result.CANNOT_FLUSH) { + return; + } + Threads.sleep(1000); + } + } + + /** + * Call flushCache on all regions on all participating regionservers. + */ + public void flushcache() throws IOException { + for (JVMClusterUtil.RegionServerThread t : this.hbaseCluster.getRegionServers()) { + for (HRegion r : t.getRegionServer().getOnlineRegionsLocalContext()) { + executeFlush(r); + } + } + } + + /** + * Call flushCache on all regions of the specified table. + */ + public void flushcache(TableName tableName) throws IOException { + for (JVMClusterUtil.RegionServerThread t : this.hbaseCluster.getRegionServers()) { + for (HRegion r : t.getRegionServer().getOnlineRegionsLocalContext()) { + if (r.getTableDescriptor().getTableName().equals(tableName)) { + executeFlush(r); + } + } + } + } + + /** + * Call flushCache on all regions on all participating regionservers. + */ + public void compact(boolean major) throws IOException { + for (JVMClusterUtil.RegionServerThread t: + this.hbaseCluster.getRegionServers()) { + for(HRegion r: t.getRegionServer().getOnlineRegionsLocalContext()) { + r.compact(major); + } + } + } + + /** + * Call flushCache on all regions of the specified table. + */ + public void compact(TableName tableName, boolean major) throws IOException { + for (JVMClusterUtil.RegionServerThread t: + this.hbaseCluster.getRegionServers()) { + for(HRegion r: t.getRegionServer().getOnlineRegionsLocalContext()) { + if(r.getTableDescriptor().getTableName().equals(tableName)) { + r.compact(major); + } + } + } + } + + /** + * Returns number of live region servers in the cluster currently. + */ + public int getNumLiveRegionServers() { + return this.hbaseCluster.getLiveRegionServers().size(); + } + + /** + * Returns list of region server threads. Does not return the master even though it is also a + * region server. + */ + public List getRegionServerThreads() { + return this.hbaseCluster.getRegionServers(); + } + + /** + * @return List of live region server threads (skips the aborted and the killed) + */ + public List getLiveRegionServerThreads() { + return this.hbaseCluster.getLiveRegionServers(); + } + + /** + * Grab a numbered region server of your choice. + * @return region server + */ + public HRegionServer getRegionServer(int serverNumber) { + return hbaseCluster.getRegionServer(serverNumber); + } + + public HRegionServer getRegionServer(ServerName serverName) { + return hbaseCluster.getRegionServers().stream() + .map(t -> t.getRegionServer()) + .filter(r -> r.getServerName().equals(serverName)) + .findFirst().orElse(null); + } + + public List getRegions(byte[] tableName) { + return getRegions(TableName.valueOf(tableName)); + } + + public List getRegions(TableName tableName) { + List ret = new ArrayList<>(); + for (JVMClusterUtil.RegionServerThread rst : getRegionServerThreads()) { + HRegionServer hrs = rst.getRegionServer(); + for (Region region : hrs.getOnlineRegionsLocalContext()) { + if (region.getTableDescriptor().getTableName().equals(tableName)) { + ret.add((HRegion)region); + } + } + } + return ret; + } + + /** + * Returns index into List of {@link SingleProcessHBaseCluster#getRegionServerThreads()} of HRS + * carrying regionName. Returns -1 if none found. + */ + public int getServerWithMeta() { + return getServerWith(RegionInfoBuilder.FIRST_META_REGIONINFO.getRegionName()); + } + + /** + * Get the location of the specified region + * @param regionName Name of the region in bytes + * @return Index into List of {@link SingleProcessHBaseCluster#getRegionServerThreads()} + * of HRS carrying hbase:meta. Returns -1 if none found. + */ + public int getServerWith(byte[] regionName) { + int index = 0; + for (JVMClusterUtil.RegionServerThread rst: getRegionServerThreads()) { + HRegionServer hrs = rst.getRegionServer(); + if (!hrs.isStopped()) { + Region region = hrs.getOnlineRegion(regionName); + if (region != null) { + return index; + } + } + index++; + } + return -1; + } + + @Override + public ServerName getServerHoldingRegion(final TableName tn, byte[] regionName) + throws IOException { + // Assume there is only one master thread which is the active master. + // If there are multiple master threads, the backup master threads + // should hold some regions. Please refer to #countServedRegions + // to see how we find out all regions. + HMaster master = getMaster(); + Region region = master.getOnlineRegion(regionName); + if (region != null) { + return master.getServerName(); + } + int index = getServerWith(regionName); + if (index < 0) { + return null; + } + return getRegionServer(index).getServerName(); + } + + /** + * Counts the total numbers of regions being served by the currently online region servers by + * asking each how many regions they have. Does not look at hbase:meta at all. Count includes + * catalog tables. + * @return number of regions being served by all region servers + */ + public long countServedRegions() { + long count = 0; + for (JVMClusterUtil.RegionServerThread rst : getLiveRegionServerThreads()) { + count += rst.getRegionServer().getNumberOfOnlineRegions(); + } + for (JVMClusterUtil.MasterThread mt : getLiveMasterThreads()) { + count += mt.getMaster().getNumberOfOnlineRegions(); + } + return count; + } + + /** + * Do a simulated kill all masters and regionservers. Useful when it is + * impossible to bring the mini-cluster back for clean shutdown. + */ + public void killAll() { + // Do backups first. + MasterThread activeMaster = null; + for (MasterThread masterThread : getMasterThreads()) { + if (!masterThread.getMaster().isActiveMaster()) { + masterThread.getMaster().abort("killAll"); + } else { + activeMaster = masterThread; + } + } + // Do active after. + if (activeMaster != null) { + activeMaster.getMaster().abort("killAll"); + } + for (RegionServerThread rst : getRegionServerThreads()) { + rst.getRegionServer().abort("killAll"); + } + } + + @Override + public void waitUntilShutDown() { + this.hbaseCluster.join(); + } + + public List findRegionsForTable(TableName tableName) { + ArrayList ret = new ArrayList<>(); + for (JVMClusterUtil.RegionServerThread rst : getRegionServerThreads()) { + HRegionServer hrs = rst.getRegionServer(); + for (Region region : hrs.getRegions(tableName)) { + if (region.getTableDescriptor().getTableName().equals(tableName)) { + ret.add((HRegion)region); + } + } + } + return ret; + } + + + protected int getRegionServerIndex(ServerName serverName) { + //we have a small number of region servers, this should be fine for now. + List servers = getRegionServerThreads(); + for (int i=0; i < servers.size(); i++) { + if (servers.get(i).getRegionServer().getServerName().equals(serverName)) { + return i; + } + } + return -1; + } + + protected int getMasterIndex(ServerName serverName) { + List masters = getMasterThreads(); + for (int i = 0; i < masters.size(); i++) { + if (masters.get(i).getMaster().getServerName().equals(serverName)) { + return i; + } + } + return -1; + } +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/StartTestingClusterOption.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/StartTestingClusterOption.java new file mode 100644 index 00000000000..60e61f6451a --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/StartTestingClusterOption.java @@ -0,0 +1,279 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import java.util.Arrays; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.hbase.master.HMaster; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; + +/** + * Options for starting up a testing cluster (including an hbase, dfs and zookeeper clusters) in + * test. The options include HDFS options to build mini dfs cluster, Zookeeper options to build mini + * zk cluster, and mostly HBase options to build mini hbase cluster. + *

+ * To create an object, use a {@link Builder}. + *

+ * Example usage: + * + *

+ *    StartTestingClusterOption option = StartTestingClusterOption.builder().
+ *        .numMasters(3).rsClass(MyRegionServer.class).createWALDir(true).build();
+ * 
+ * + * Default values can be found in {@link Builder}. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public final class StartTestingClusterOption { + /** + * Number of masters to start up. We'll start this many hbase masters. If numMasters > 1, you + * can find the active/primary master with {@link SingleProcessHBaseCluster#getMaster()}. + */ + private final int numMasters; + + /** + * Number of masters that always remain standby. These set of masters never transition to active + * even if an active master does not exist. These are needed for testing scenarios where there are + * no active masters in the cluster but the cluster connection (backed by master registry) should + * still work. + */ + private final int numAlwaysStandByMasters; + /** + * The class to use as HMaster, or null for default. + */ + private final Class masterClass; + + /** + * Number of region servers to start up. + * If this value is > 1, then make sure config "hbase.regionserver.info.port" is -1 + * (i.e. no ui per regionserver) otherwise bind errors. + */ + private final int numRegionServers; + /** + * Ports that RegionServer should use. Pass ports if you want to test cluster restart where for + * sure the regionservers come up on same address+port (but just with different startcode); by + * default mini hbase clusters choose new arbitrary ports on each cluster start. + */ + private final List rsPorts; + /** + * The class to use as HRegionServer, or null for default. + */ + private Class rsClass; + + /** + * Number of datanodes. Used to create mini DSF cluster. Surpassed by {@link #dataNodeHosts} size. + */ + private final int numDataNodes; + /** + * The hostnames of DataNodes to run on. This is useful if you want to run datanode on distinct + * hosts for things like HDFS block location verification. If you start MiniDFSCluster without + * host names, all instances of the datanodes will have the same host name. + */ + private final String[] dataNodeHosts; + + /** + * Number of Zookeeper servers. + */ + private final int numZkServers; + + /** + * Whether to create a new root or data directory path. If true, the newly created data directory + * will be configured as HBase rootdir. This will overwrite existing root directory config. + */ + private final boolean createRootDir; + + /** + * Whether to create a new WAL directory. If true, the newly created directory will be configured + * as HBase wal.dir which is separate from HBase rootdir. + */ + private final boolean createWALDir; + + /** + * Private constructor. Use {@link Builder#build()}. + */ + private StartTestingClusterOption(int numMasters, int numAlwaysStandByMasters, + Class masterClass, int numRegionServers, List rsPorts, + Class rsClass, + int numDataNodes, String[] dataNodeHosts, int numZkServers, boolean createRootDir, + boolean createWALDir) { + this.numMasters = numMasters; + this.numAlwaysStandByMasters = numAlwaysStandByMasters; + this.masterClass = masterClass; + this.numRegionServers = numRegionServers; + this.rsPorts = rsPorts; + this.rsClass = rsClass; + this.numDataNodes = numDataNodes; + this.dataNodeHosts = dataNodeHosts; + this.numZkServers = numZkServers; + this.createRootDir = createRootDir; + this.createWALDir = createWALDir; + } + + public int getNumMasters() { + return numMasters; + } + + public int getNumAlwaysStandByMasters() { + return numAlwaysStandByMasters; + } + + public Class getMasterClass() { + return masterClass; + } + + public int getNumRegionServers() { + return numRegionServers; + } + + public List getRsPorts() { + return rsPorts; + } + + public Class getRsClass() { + return rsClass; + } + + public int getNumDataNodes() { + return numDataNodes; + } + + public String[] getDataNodeHosts() { + return dataNodeHosts; + } + + public int getNumZkServers() { + return numZkServers; + } + + public boolean isCreateRootDir() { + return createRootDir; + } + + public boolean isCreateWALDir() { + return createWALDir; + } + + @Override + public String toString() { + return "StartMiniClusterOption{" + "numMasters=" + numMasters + ", masterClass=" + masterClass + + ", numRegionServers=" + numRegionServers + ", rsPorts=" + StringUtils.join(rsPorts) + + ", rsClass=" + rsClass + ", numDataNodes=" + numDataNodes + + ", dataNodeHosts=" + Arrays.toString(dataNodeHosts) + ", numZkServers=" + numZkServers + + ", createRootDir=" + createRootDir + ", createWALDir=" + createWALDir + '}'; + } + + /** + * @return a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Builder pattern for creating an {@link StartTestingClusterOption}. + * + * The default values of its fields should be considered public and constant. Changing the default + * values may cause other tests fail. + */ + public static final class Builder { + private int numMasters = 1; + private int numAlwaysStandByMasters = 0; + private Class masterClass = null; + private int numRegionServers = 1; + private List rsPorts = null; + private Class rsClass = null; + private int numDataNodes = 1; + private String[] dataNodeHosts = null; + private int numZkServers = 1; + private boolean createRootDir = false; + private boolean createWALDir = false; + + private Builder() { + } + + public StartTestingClusterOption build() { + if (dataNodeHosts != null && dataNodeHosts.length != 0) { + numDataNodes = dataNodeHosts.length; + } + return new StartTestingClusterOption(numMasters,numAlwaysStandByMasters, masterClass, + numRegionServers, rsPorts, rsClass, numDataNodes, dataNodeHosts, numZkServers, + createRootDir, createWALDir); + } + + public Builder numMasters(int numMasters) { + this.numMasters = numMasters; + return this; + } + + public Builder numAlwaysStandByMasters(int numAlwaysStandByMasters) { + this.numAlwaysStandByMasters = numAlwaysStandByMasters; + return this; + } + + public Builder masterClass(Class masterClass) { + this.masterClass = masterClass; + return this; + } + + public Builder numRegionServers(int numRegionServers) { + this.numRegionServers = numRegionServers; + return this; + } + + public Builder rsPorts(List rsPorts) { + this.rsPorts = rsPorts; + return this; + } + + public Builder + rsClass(Class rsClass) { + this.rsClass = rsClass; + return this; + } + + public Builder numDataNodes(int numDataNodes) { + this.numDataNodes = numDataNodes; + return this; + } + + public Builder dataNodeHosts(String[] dataNodeHosts) { + this.dataNodeHosts = dataNodeHosts; + return this; + } + + public Builder numZkServers(int numZkServers) { + this.numZkServers = numZkServers; + return this; + } + + public Builder createRootDir(boolean createRootDir) { + this.createRootDir = createRootDir; + return this; + } + + public Builder createWALDir(boolean createWALDir) { + this.createWALDir = createWALDir; + return this; + } + } + +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestCachedClusterId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestCachedClusterId.java index c146685699e..8dd82fe0e0c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestCachedClusterId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestCachedClusterId.java @@ -36,7 +36,7 @@ public class TestCachedClusterId { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCachedClusterId.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static String clusterId; private static HMaster activeMaster; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java index b578ffe7459..6aef56b2ca1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterMetrics.java @@ -71,11 +71,11 @@ public class TestClientClusterMetrics { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClientClusterMetrics.class); - private static HBaseTestingUtility UTIL; + private static HBaseTestingUtil UTIL; private static Admin ADMIN; private final static int SLAVES = 5; private final static int MASTERS = 3; - private static MiniHBaseCluster CLUSTER; + private static SingleProcessHBaseCluster CLUSTER; private static HRegionServer DEAD; private static final TableName TABLE_NAME = TableName.valueOf("test"); private static final byte[] CF = Bytes.toBytes("cf"); @@ -85,8 +85,8 @@ public class TestClientClusterMetrics { public static void setUpBeforeClass() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, MyObserver.class.getName()); - UTIL = new HBaseTestingUtility(conf); - StartMiniClusterOption option = StartMiniClusterOption.builder() + UTIL = new HBaseTestingUtil(conf); + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(MASTERS).numRegionServers(SLAVES).numDataNodes(SLAVES).build(); UTIL.startMiniCluster(option); CLUSTER = UTIL.getHBaseCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java index f7de667832f..8dee17d0a3f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientClusterStatus.java @@ -53,19 +53,19 @@ public class TestClientClusterStatus { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClientClusterStatus.class); - private static HBaseTestingUtility UTIL; + private static HBaseTestingUtil UTIL; private static Admin ADMIN; private final static int SLAVES = 5; private final static int MASTERS = 3; - private static MiniHBaseCluster CLUSTER; + private static SingleProcessHBaseCluster CLUSTER; private static HRegionServer DEAD; @BeforeClass public static void setUpBeforeClass() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, MyObserver.class.getName()); - UTIL = new HBaseTestingUtility(conf); - StartMiniClusterOption option = StartMiniClusterOption.builder() + UTIL = new HBaseTestingUtil(conf); + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(MASTERS).numRegionServers(SLAVES).numDataNodes(SLAVES).build(); UTIL.startMiniCluster(option); CLUSTER = UTIL.getHBaseCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientOperationTimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientOperationTimeout.java index eb62c973a65..a70f1245265 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientOperationTimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClientOperationTimeout.java @@ -80,7 +80,7 @@ public class TestClientOperationTimeout { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClientOperationTimeout.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // Activate the delays after table creation to test get/scan/put private static int DELAY_GET; @@ -100,8 +100,8 @@ public class TestClientOperationTimeout { @BeforeClass public static void setUp() throws Exception { // Set RegionServer class and use default values for other options. - StartMiniClusterOption option = - StartMiniClusterOption.builder().rsClass(DelayedRegionServer.class).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().rsClass(DelayedRegionServer.class).build(); UTIL.startMiniCluster(option); UTIL.getAdmin().createTable(TableDescriptorBuilder.newBuilder(TABLE_NAME) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY)).build()); @@ -211,7 +211,7 @@ public class TestClientOperationTimeout { } public static final class DelayedRegionServer - extends MiniHBaseCluster.MiniHBaseClusterRegionServer { + extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer { public DelayedRegionServer(Configuration conf) throws IOException, InterruptedException { super(conf); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java index 2d16a90ef1f..1f6381a2438 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java @@ -42,14 +42,14 @@ public class TestClusterBootOrder { private static final long SLEEP_INTERVAL = 1000; private static final long SLEEP_TIME = 4000; - private HBaseTestingUtility testUtil; + private HBaseTestingUtil testUtil; private LocalHBaseCluster cluster; private RegionServerThread rs; private MasterThread master; @Before public void setUp() throws Exception { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); testUtil.startMiniDFSCluster(1); testUtil.startMiniZKCluster(1); testUtil.createRootDir(); //manually setup hbase dir to point to minidfscluster diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterPortAssignment.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterPortAssignment.java index 4d37ca5dcfc..38d1627ac5f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterPortAssignment.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClusterPortAssignment.java @@ -35,7 +35,7 @@ public class TestClusterPortAssignment { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClusterPortAssignment.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestClusterPortAssignment.class); /** @@ -46,10 +46,10 @@ public class TestClusterPortAssignment { public void testClusterPortAssignment() throws Exception { boolean retry = false; do { - int masterPort = HBaseTestingUtility.randomFreePort(); - int masterInfoPort = HBaseTestingUtility.randomFreePort(); - int rsPort = HBaseTestingUtility.randomFreePort(); - int rsInfoPort = HBaseTestingUtility.randomFreePort(); + int masterPort = HBaseTestingUtil.randomFreePort(); + int masterInfoPort = HBaseTestingUtil.randomFreePort(); + int rsPort = HBaseTestingUtil.randomFreePort(); + int rsInfoPort = HBaseTestingUtil.randomFreePort(); TEST_UTIL.getConfiguration().setBoolean(LocalHBaseCluster.ASSIGN_RANDOM_PORTS, false); TEST_UTIL.getConfiguration().setBoolean(HConstants.REGIONSERVER_INFO_PORT_AUTO, false); TEST_UTIL.getConfiguration().setBoolean("fs.hdfs.impl.disable.cache", true); @@ -59,7 +59,7 @@ public class TestClusterPortAssignment { TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_INFO_PORT, rsInfoPort); LOG.info("Ports: {}, {}, {}, {}", masterPort, masterInfoPort, rsPort, rsInfoPort); try { - MiniHBaseCluster cluster = TEST_UTIL.startMiniCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.startMiniCluster(); assertTrue("Cluster failed to come up", cluster.waitForActiveAndReadyMaster(30000)); retry = false; assertEquals("Master RPC port is incorrect", masterPort, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestColumnFamilyDescriptorDefaultVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestColumnFamilyDescriptorDefaultVersions.java index eab1916be50..67bdcd10d4b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestColumnFamilyDescriptorDefaultVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestColumnFamilyDescriptorDefaultVersions.java @@ -54,7 +54,7 @@ public class TestColumnFamilyDescriptorDefaultVersions { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = null; private static final byte[] FAMILY = Bytes.toBytes("cf0"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFSTableDescriptorForceCreation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFSTableDescriptorForceCreation.java index d6272442cb0..a69d68b0f43 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFSTableDescriptorForceCreation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFSTableDescriptorForceCreation.java @@ -41,7 +41,7 @@ public class TestFSTableDescriptorForceCreation { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFSTableDescriptorForceCreation.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java index c6119b2583c..250d9a1c469 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java @@ -42,7 +42,7 @@ public class TestFullLogReconstruction { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFullLogReconstruction.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static TableName TABLE_NAME = TableName.valueOf("tabletest"); private final static byte[] FAMILY = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java index 882bc9d254c..0ff2bd1fe92 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java @@ -62,8 +62,8 @@ public class TestGlobalMemStoreSize { // total region num = region num + meta regions private static int totalRegionNum = regionNum + 1; - private HBaseTestingUtility TEST_UTIL; - private MiniHBaseCluster cluster; + private HBaseTestingUtil TEST_UTIL; + private SingleProcessHBaseCluster cluster; @Rule public TestName name = new TestName(); @@ -78,7 +78,7 @@ public class TestGlobalMemStoreSize { // Start the cluster LOG.info("Starting cluster"); Configuration conf = HBaseConfiguration.create(); - TEST_UTIL = new HBaseTestingUtility(conf); + TEST_UTIL = new HBaseTestingUtil(conf); TEST_UTIL.startMiniCluster(regionServerNum); cluster = TEST_UTIL.getHBaseCluster(); LOG.info("Waiting for active/ready master"); @@ -178,7 +178,7 @@ public class TestGlobalMemStoreSize { */ private void waitForAllRegionsAssigned() throws IOException { while (true) { - int regionCount = HBaseTestingUtility.getAllOnlineRegions(cluster).size(); + int regionCount = HBaseTestingUtil.getAllOnlineRegions(cluster).size(); if (regionCount >= totalRegionNum) break; LOG.debug("Waiting for there to be "+ totalRegionNum +" regions, but there are " + regionCount + " right now."); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseMetaEdit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseMetaEdit.java index 33c0f1041b0..fb3ea93fe5b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseMetaEdit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseMetaEdit.java @@ -53,7 +53,7 @@ public class TestHBaseMetaEdit { HBaseClassTestRule.forClass(TestHBaseMetaEdit.class); @Rule public TestName name = new TestName(); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Before public void before() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseOnOtherDfsCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseOnOtherDfsCluster.java index 531ba079c4f..d2bcebb066b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseOnOtherDfsCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseOnOtherDfsCluster.java @@ -49,11 +49,11 @@ public class TestHBaseOnOtherDfsCluster { @Test public void testOveralyOnOtherCluster() throws Exception { // just run HDFS - HBaseTestingUtility util1 = new HBaseTestingUtility(); + HBaseTestingUtil util1 = new HBaseTestingUtil(); MiniDFSCluster dfs = util1.startMiniDFSCluster(1); // run HBase on that HDFS - HBaseTestingUtility util2 = new HBaseTestingUtility(); + HBaseTestingUtil util2 = new HBaseTestingUtil(); // set the dfs util2.setDFSCluster(dfs, false); util2.startMiniCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtil.java similarity index 91% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java rename to hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtil.java index 993af218723..7076bf93612 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtil.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + import java.io.File; import java.util.List; import java.util.Random; @@ -57,16 +58,16 @@ import org.slf4j.LoggerFactory; * Test our testing utility class */ @Category({MiscTests.class, LargeTests.class}) -public class TestHBaseTestingUtility { +public class TestHBaseTestingUtil { private static final int NUMTABLES = 1; private static final int NUMROWS = 100; private static final int NUMREGIONS = 10; @ClassRule public static final HBaseClassTestRule CLASS_RULE = - HBaseClassTestRule.forClass(TestHBaseTestingUtility.class); + HBaseClassTestRule.forClass(TestHBaseTestingUtil.class); - private static final Logger LOG = LoggerFactory.getLogger(TestHBaseTestingUtility.class); + private static final Logger LOG = LoggerFactory.getLogger(TestHBaseTestingUtil.class); @Rule public TestName name = new TestName(); @@ -82,13 +83,13 @@ public class TestHBaseTestingUtility { // Create three clusters // Cluster 1. - HBaseTestingUtility htu1 = new HBaseTestingUtility(); + HBaseTestingUtil htu1 = new HBaseTestingUtil(); // Set a different zk path for each cluster htu1.getConfiguration().set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1"); htu1.startMiniZKCluster(); // Cluster 2 - HBaseTestingUtility htu2 = new HBaseTestingUtility(); + HBaseTestingUtil htu2 = new HBaseTestingUtil(); htu2.getConfiguration().set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); htu2.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT, htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1")); @@ -97,7 +98,7 @@ public class TestHBaseTestingUtility { // Cluster 3; seed it with the conf from htu1 so we pickup the 'right' // zk cluster config; it is set back into the config. as part of the // start of minizkcluster. - HBaseTestingUtility htu3 = new HBaseTestingUtility(); + HBaseTestingUtil htu3 = new HBaseTestingUtil(); htu3.getConfiguration().set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/3"); htu3.getConfiguration().set(HConstants.ZOOKEEPER_CLIENT_PORT, htu1.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT, "-1")); @@ -140,9 +141,9 @@ public class TestHBaseTestingUtility { } @Test public void testMiniCluster() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); - MiniHBaseCluster cluster = hbt.startMiniCluster(); + SingleProcessHBaseCluster cluster = hbt.startMiniCluster(); try { assertEquals(1, cluster.getLiveRegionServerThreads().size()); } finally { @@ -152,9 +153,9 @@ public class TestHBaseTestingUtility { @Test public void testMiniClusterBindToWildcard() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); hbt.getConfiguration().set("hbase.regionserver.ipc.address", "0.0.0.0"); - MiniHBaseCluster cluster = hbt.startMiniCluster(); + SingleProcessHBaseCluster cluster = hbt.startMiniCluster(); try { assertEquals(1, cluster.getLiveRegionServerThreads().size()); } finally { @@ -165,11 +166,11 @@ public class TestHBaseTestingUtility { @Test public void testMiniClusterWithSSLOn() throws Exception { final String BASEDIR = System.getProperty("test.build.dir", - "target/test-dir") + "/" + TestHBaseTestingUtility.class.getSimpleName(); - String sslConfDir = KeyStoreTestUtil.getClasspathDir(TestHBaseTestingUtility.class); + "target/test-dir") + "/" + TestHBaseTestingUtil.class.getSimpleName(); + String sslConfDir = KeyStoreTestUtil.getClasspathDir(TestHBaseTestingUtil.class); String keystoresDir = new File(BASEDIR).getAbsolutePath(); - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); File base = new File(BASEDIR); FileUtil.fullyDelete(base); base.mkdirs(); @@ -180,7 +181,7 @@ public class TestHBaseTestingUtility { hbt.getConfiguration().addResource(hbt.getConfiguration().get(SSLFactory.SSL_CLIENT_CONF_KEY)); hbt.getConfiguration().addResource(hbt.getConfiguration().get(SSLFactory.SSL_SERVER_CONF_KEY)); - MiniHBaseCluster cluster = hbt.startMiniCluster(); + SingleProcessHBaseCluster cluster = hbt.startMiniCluster(); try { assertEquals(1, cluster.getLiveRegionServerThreads().size()); } finally { @@ -193,7 +194,7 @@ public class TestHBaseTestingUtility { * with the same HBaseTestingUtility. */ @Test public void testMultipleStartStop() throws Exception{ - HBaseTestingUtility htu1 = new HBaseTestingUtility(); + HBaseTestingUtil htu1 = new HBaseTestingUtil(); Path foo = new Path("foo"); htu1.startMiniCluster(); @@ -210,7 +211,7 @@ public class TestHBaseTestingUtility { @Test public void testMiniZooKeeperWithOneServer() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); MiniZooKeeperCluster cluster1 = hbt.startMiniZKCluster(); try { assertEquals(0, cluster1.getBackupZooKeeperServerNum()); @@ -222,7 +223,7 @@ public class TestHBaseTestingUtility { @Test public void testMiniZooKeeperWithMultipleServers() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); // set up zookeeper cluster with 5 zk servers MiniZooKeeperCluster cluster2 = hbt.startMiniZKCluster(5); int defaultClientPort = 21818; @@ -266,7 +267,7 @@ public class TestHBaseTestingUtility { public void testMiniZooKeeperWithMultipleClientPorts() throws Exception { int defaultClientPort = 8888; int i, j; - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); // Test 1 - set up zookeeper cluster with same number of ZK servers and specified client ports int [] clientPortList1 = {1111, 1112, 1113}; @@ -370,7 +371,7 @@ public class TestHBaseTestingUtility { } @Test public void testMiniDFSCluster() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); MiniDFSCluster cluster = hbt.startMiniDFSCluster(null); FileSystem dfs = cluster.getFileSystem(); Path dir = new Path("dir"); @@ -383,7 +384,7 @@ public class TestHBaseTestingUtility { } @Test public void testSetupClusterTestBuildDir() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); Path testdir = hbt.getClusterTestDir(); LOG.info("uuid-subdir=" + testdir); FileSystem fs = hbt.getTestFileSystem(); @@ -398,7 +399,7 @@ public class TestHBaseTestingUtility { } @Test public void testTestDir() throws Exception { - HBaseTestingUtility hbt = new HBaseTestingUtility(); + HBaseTestingUtil hbt = new HBaseTestingUtil(); Path testdir = hbt.getDataTestDir(); LOG.info("testdir=" + testdir); FileSystem fs = hbt.getTestFileSystem(); @@ -423,12 +424,12 @@ public class TestHBaseTestingUtility { } }); - HBaseTestingUtility.PortAllocator.AvailablePortChecker portChecker = - mock(HBaseTestingUtility.PortAllocator.AvailablePortChecker.class); + HBaseTestingUtil.PortAllocator.AvailablePortChecker portChecker = + mock(HBaseTestingUtil.PortAllocator.AvailablePortChecker.class); when(portChecker.available(anyInt())).thenReturn(true); - HBaseTestingUtility.PortAllocator portAllocator = - new HBaseTestingUtility.PortAllocator(random, portChecker); + HBaseTestingUtil.PortAllocator portAllocator = + new HBaseTestingUtil.PortAllocator(random, portChecker); int port1 = portAllocator.randomFreePort(); int port2 = portAllocator.randomFreePort(); @@ -444,9 +445,9 @@ public class TestHBaseTestingUtility { defaultConfig.setInt(HConstants.MASTER_INFO_PORT, HConstants.DEFAULT_MASTER_INFOPORT); defaultConfig.setInt(HConstants.REGIONSERVER_INFO_PORT, HConstants.DEFAULT_REGIONSERVER_INFOPORT); - HBaseTestingUtility htu = new HBaseTestingUtility(defaultConfig); + HBaseTestingUtil htu = new HBaseTestingUtil(defaultConfig); try { - MiniHBaseCluster defaultCluster = htu.startMiniCluster(); + SingleProcessHBaseCluster defaultCluster = htu.startMiniCluster(); final String masterHostPort = defaultCluster.getMaster().getServerName().getAddress().toString(); assertNotEquals(HConstants.DEFAULT_MASTER_INFOPORT, @@ -465,9 +466,9 @@ public class TestHBaseTestingUtility { final int nonDefaultRegionServerPort = 4444; altConfig.setInt(HConstants.MASTER_INFO_PORT, nonDefaultMasterInfoPort); altConfig.setInt(HConstants.REGIONSERVER_INFO_PORT, nonDefaultRegionServerPort); - htu = new HBaseTestingUtility(altConfig); + htu = new HBaseTestingUtil(altConfig); try { - MiniHBaseCluster customCluster = htu.startMiniCluster(); + SingleProcessHBaseCluster customCluster = htu.startMiniCluster(); final String masterHostPort = customCluster.getMaster().getServerName().getAddress().toString(); assertEquals(nonDefaultMasterInfoPort, @@ -486,7 +487,7 @@ public class TestHBaseTestingUtility { @Test public void testKillMiniHBaseCluster() throws Exception { - HBaseTestingUtility htu = new HBaseTestingUtility(); + HBaseTestingUtil htu = new HBaseTestingUtil(); htu.startMiniZKCluster(); try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java index fa2a3374174..3c2bc3f0cb1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIOFencing.java @@ -221,7 +221,7 @@ public class TestIOFencing { } } - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static TableName TABLE_NAME = TableName.valueOf("tabletest"); private final static byte[] FAMILY = Bytes.toBytes("family"); @@ -365,7 +365,7 @@ public class TestIOFencing { int count; for (int i = 0;; i++) { try { - count = HBaseTestingUtility.countRows(table); + count = HBaseTestingUtil.countRows(table); break; } catch (DoNotRetryIOException e) { // wait up to 30s diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java index 44c10efcab5..4eb6aa48df6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java @@ -58,7 +58,7 @@ public class TestIPv6NIOServerSocketChannel { */ private void bindServerSocket(InetAddress inetAddr) throws IOException { while(true) { - int port = HBaseTestingUtility.randomFreePort(); + int port = HBaseTestingUtil.randomFreePort(); InetSocketAddress addr = new InetSocketAddress(inetAddr, port); ServerSocket serverSocket = null; try { @@ -84,7 +84,7 @@ public class TestIPv6NIOServerSocketChannel { */ private void bindNIOServerSocket(InetAddress inetAddr) throws IOException { while (true) { - int port = HBaseTestingUtility.randomFreePort(); + int port = HBaseTestingUtil.randomFreePort(); InetSocketAddress addr = new InetSocketAddress(inetAddr, port); ServerSocketChannel channel = null; ServerSocket serverSocket = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java index 179220c1f36..329add7aade 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestInfoServers.java @@ -51,7 +51,7 @@ public class TestInfoServers { HBaseClassTestRule.forClass(TestInfoServers.class); private static final Logger LOG = LoggerFactory.getLogger(TestInfoServers.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXConnectorServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXConnectorServer.java index 303540149ab..159d76f2411 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXConnectorServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXConnectorServer.java @@ -53,7 +53,7 @@ public class TestJMXConnectorServer { HBaseClassTestRule.forClass(TestJMXConnectorServer.class); private static final Logger LOG = LoggerFactory.getLogger(TestJMXConnectorServer.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Configuration conf = null; private static Admin admin; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java index f43d390461e..fc8a162e468 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXListener.java @@ -46,7 +46,7 @@ public class TestJMXListener { HBaseClassTestRule.forClass(TestJMXListener.class); private static final Logger LOG = LoggerFactory.getLogger(TestJMXListener.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static int CONNECTOR_PORT; @BeforeClass @@ -60,7 +60,7 @@ public class TestJMXListener { // To test what happens when the jmx listener can't put up its port, uncomment the below. BoundSocketMaker bsm = null; // new BoundSocketMaker(HBaseTestingUtility::randomFreePort); conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, JMXListener.class.getName()); - CONNECTOR_PORT = bsm == null? HBaseTestingUtility.randomFreePort(): bsm.getPort(); + CONNECTOR_PORT = bsm == null? HBaseTestingUtil.randomFreePort(): bsm.getPort(); // Make sure the JMX listener is up before we proceed. If it is not up, retry. It may not // come up if there is a port clash/bind exception except its called something else in rmi. for (int i = 0; i < 10; i++) { @@ -75,7 +75,7 @@ public class TestJMXListener { break; } catch (IOException ioe) { UTIL.shutdownMiniCluster(); - CONNECTOR_PORT = HBaseTestingUtility.randomFreePort(); + CONNECTOR_PORT = HBaseTestingUtil.randomFreePort(); } finally { if (connector != null) { connector.close(); @@ -110,7 +110,7 @@ public class TestJMXListener { public ExpectedException expectedEx = ExpectedException.none(); @Test public void testStop() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestLocalHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestLocalHBaseCluster.java index 7e9e7cb7af6..702bf459a07 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestLocalHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestLocalHBaseCluster.java @@ -36,7 +36,7 @@ public class TestLocalHBaseCluster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLocalHBaseCluster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /** * Check that we can start a local HBase cluster specifying a custom master @@ -48,7 +48,7 @@ public class TestLocalHBaseCluster { @Test public void testLocalHBaseCluster() throws Exception { // Set Master class and RegionServer class, and use default values for other options. - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .masterClass(MyHMaster.class).rsClass(MyHRegionServer.class).build(); TEST_UTIL.startMiniCluster(option); // Can we cast back to our master class? @@ -86,7 +86,8 @@ public class TestLocalHBaseCluster { /** * A private regionserver class with a dummy method for testing casts */ - public static class MyHRegionServer extends MiniHBaseCluster.MiniHBaseClusterRegionServer { + public static class MyHRegionServer + extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer { public MyHRegionServer(Configuration conf) throws IOException, InterruptedException { super(conf); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java index f317fdf2857..922da6f02a5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableAccessor.java @@ -78,7 +78,7 @@ public class TestMetaTableAccessor { HBaseClassTestRule.forClass(TestMetaTableAccessor.class); private static final Logger LOG = LoggerFactory.getLogger(TestMetaTableAccessor.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Connection connection; private Random random = new Random(); @@ -408,7 +408,7 @@ public class TestMetaTableAccessor { UTIL.createTable(tableName, FAMILY, SPLIT_KEYS); Table table = connection.getTable(tableName); // Make sure all the regions are deployed - HBaseTestingUtility.countRows(table); + HBaseTestingUtil.countRows(table); ClientMetaTableAccessor.Visitor visitor = mock(ClientMetaTableAccessor.Visitor.class); doReturn(true).when(visitor).visit((Result) anyObject()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableLocator.java index db72ae7f648..3bea0a742d2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableLocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableLocator.java @@ -59,7 +59,7 @@ public class TestMetaTableLocator { HBaseClassTestRule.forClass(TestMetaTableLocator.class); private static final Logger LOG = LoggerFactory.getLogger(TestMetaTableLocator.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final ServerName SN = ServerName.valueOf("example.org", 1234, EnvironmentEdgeManager.currentTime()); private ZKWatcher watcher; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaUpdatesGoToPriorityQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaUpdatesGoToPriorityQueue.java index e2a8adb9f8f..cd04157ae6e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaUpdatesGoToPriorityQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaUpdatesGoToPriorityQueue.java @@ -57,7 +57,7 @@ public class TestMetaUpdatesGoToPriorityQueue { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaUpdatesGoToPriorityQueue.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void beforeClass() throws Exception { @@ -111,7 +111,7 @@ public class TestMetaUpdatesGoToPriorityQueue { .setEndKey(parent.getEndKey()).setSplit(false).setRegionId(rid).build(); // find the meta server - MiniHBaseCluster cluster = UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getMiniHBaseCluster(); int rsIndex = cluster.getServerWithMeta(); HRegionServer rs; if (rsIndex >= 0) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java index ea0b9f87e17..6662ffbcc03 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMovedRegionCache.java @@ -50,7 +50,7 @@ public class TestMovedRegionCache { @Rule public TestName name = new TestName(); - private HBaseTestingUtility UTIL; + private HBaseTestingUtil UTIL; private MiniZooKeeperCluster zkCluster; private HRegionServer source; private HRegionServer dest; @@ -58,10 +58,11 @@ public class TestMovedRegionCache { @Before public void setup() throws Exception { - UTIL = new HBaseTestingUtility(); + UTIL = new HBaseTestingUtil(); zkCluster = UTIL.startMiniZKCluster(); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(2).build(); - MiniHBaseCluster cluster = UTIL.startMiniHBaseCluster(option); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(2).build(); + SingleProcessHBaseCluster cluster = UTIL.startMiniHBaseCluster(option); source = cluster.getRegionServer(0); dest = cluster.getRegionServer(1); assertEquals(2, cluster.getRegionServerThreads().size()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java index edf553bf71b..45728b4efeb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java @@ -54,7 +54,7 @@ import org.slf4j.LoggerFactory; /** * Port of old TestScanMultipleVersions, TestTimestamp and TestGetRowVersions - * from old testing framework to {@link HBaseTestingUtility}. + * from old testing framework to {@link HBaseTestingUtil}. */ @Category({MiscTests.class, MediumTests.class}) public class TestMultiVersions { @@ -64,7 +64,7 @@ public class TestMultiVersions { HBaseClassTestRule.forClass(TestMultiVersions.class); private static final Logger LOG = LoggerFactory.getLogger(TestMultiVersions.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private Admin admin; private static final int NUM_SLAVES = 3; @@ -155,7 +155,7 @@ public class TestMultiVersions { table.close(); UTIL.shutdownMiniHBaseCluster(); LOG.debug("HBase cluster shut down -- restarting"); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(NUM_SLAVES).build(); UTIL.startMiniHBaseCluster(option); // Make a new connection. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java index 9eb7d819a97..b63054f544b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNamespace.java @@ -65,9 +65,9 @@ public class TestNamespace { private static final Logger LOG = LoggerFactory.getLogger(TestNamespace.class); private static HMaster master; protected final static int NUM_SLAVES_BASE = 4; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; protected static Admin admin; - protected static HBaseCluster cluster; + protected static HBaseClusterInterface cluster; private String prefix = "TestNamespace"; @Rule @@ -75,11 +75,11 @@ public class TestNamespace { @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniCluster(NUM_SLAVES_BASE); admin = TEST_UTIL.getAdmin(); cluster = TEST_UTIL.getHBaseCluster(); - master = ((MiniHBaseCluster)cluster).getMaster(); + master = ((SingleProcessHBaseCluster)cluster).getMaster(); LOG.info("Done initializing cluster"); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java index 1603d3ac83a..60a0880d3fa 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java @@ -47,7 +47,7 @@ public class TestNodeHealthCheckChore { HBaseClassTestRule.forClass(TestNodeHealthCheckChore.class); private static final Logger LOG = LoggerFactory.getLogger(TestNodeHealthCheckChore.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final int SCRIPT_TIMEOUT = 5000; private File healthScriptFile; private String eol = System.getProperty("line.separator"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java index cb1a192c233..1b2b2629112 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java @@ -75,7 +75,7 @@ public class TestPartialResultsFromClientSide { private static final Logger LOG = LoggerFactory.getLogger(TestPartialResultsFromClientSide.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static int MINICLUSTER_SIZE = 5; private static Table TABLE = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionMetrics.java index 49d8668f1d8..bb683e41b42 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionMetrics.java @@ -54,7 +54,7 @@ public class TestRegionMetrics { HBaseClassTestRule.forClass(TestRegionMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestRegionMetrics.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Admin admin; private static final TableName TABLE_1 = TableName.valueOf("table_1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java index 483eddecc4c..c9ac60d2f8c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java @@ -76,7 +76,7 @@ public class TestRegionRebalancing { private static final byte[] FAMILY_NAME = Bytes.toBytes("col"); private static final Logger LOG = LoggerFactory.getLogger(TestRegionRebalancing.class); - private final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private RegionLocator regionLocator; private TableDescriptor tableDescriptor; private String balancerName; @@ -112,14 +112,14 @@ public class TestRegionRebalancing { throws IOException, InterruptedException { try(Connection connection = ConnectionFactory.createConnection(UTIL.getConfiguration()); Admin admin = connection.getAdmin()) { - admin.createTable(this.tableDescriptor, Arrays.copyOfRange(HBaseTestingUtility.KEYS, - 1, HBaseTestingUtility.KEYS.length)); + admin.createTable(this.tableDescriptor, Arrays.copyOfRange(HBaseTestingUtil.KEYS, + 1, HBaseTestingUtil.KEYS.length)); this.regionLocator = connection.getRegionLocator(this.tableDescriptor.getTableName()); MetaTableAccessor.fullScanMetaAndPrint(admin.getConnection()); assertEquals("Test table should have right number of regions", - HBaseTestingUtility.KEYS.length, + HBaseTestingUtil.KEYS.length, this.regionLocator.getStartKeys().length); // verify that the region assignments are balanced to start out @@ -264,7 +264,7 @@ public class TestRegionRebalancing { * Wait until all the regions are assigned. */ private void waitForAllRegionsAssigned() throws IOException { - int totalRegions = HBaseTestingUtility.KEYS.length; + int totalRegions = HBaseTestingUtil.KEYS.length; try { Thread.sleep(200); } catch (InterruptedException e) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSequenceIdMonotonicallyIncreasing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSequenceIdMonotonicallyIncreasing.java index e657d9c74a3..07348488ac7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSequenceIdMonotonicallyIncreasing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSequenceIdMonotonicallyIncreasing.java @@ -55,7 +55,7 @@ public class TestSequenceIdMonotonicallyIncreasing { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSequenceIdMonotonicallyIncreasing.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME = TableName.valueOf("test"); @@ -137,7 +137,7 @@ public class TestSequenceIdMonotonicallyIncreasing { table.put(new Put(Bytes.toBytes(2)).addColumn(CF, CQ, Bytes.toBytes(0))); } UTIL.flush(NAME); - MiniHBaseCluster cluster = UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getMiniHBaseCluster(); List regions = cluster.getRegions(NAME); HRegion regionA = regions.get(0); HRegion regionB = regions.get(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java index 19dde6de524..3eaa2ffd7bd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java @@ -57,7 +57,7 @@ public class TestServerSideScanMetricsFromClientSide { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestServerSideScanMetricsFromClientSide.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Table TABLE = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSplitMerge.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSplitMerge.java index b129017c7ca..ce700353ee5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSplitMerge.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSplitMerge.java @@ -46,7 +46,7 @@ public class TestSplitMerge { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSplitMerge.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java index fba8f0ed862..1acf0a9d71c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java @@ -68,7 +68,7 @@ public class TestZooKeeper { private static final Logger LOG = LoggerFactory.getLogger(TestZooKeeper.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -94,7 +94,7 @@ public class TestZooKeeper { @Before public void setUp() throws Exception { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(2).numRegionServers(2).build(); TEST_UTIL.startMiniHBaseCluster(option); } @@ -138,7 +138,7 @@ public class TestZooKeeper { @Test public void testMasterZKSessionRecoveryFailure() throws Exception { LOG.info("Starting " + name.getMethodName()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); m.abort("Test recovery from zk session expired", new KeeperException.SessionExpiredException()); @@ -176,7 +176,7 @@ public class TestZooKeeper { */ @Test public void testRegionAssignmentAfterMasterRecoveryDueToZKExpiry() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); cluster.startRegionServer(); cluster.waitForActiveAndReadyMaster(10000); HMaster m = cluster.getMaster(); @@ -242,7 +242,7 @@ public class TestZooKeeper { */ @Test public void testLogSplittingAfterMasterRecoveryDueToZKExpiry() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); cluster.startRegionServer(); TableName tableName = TableName.valueOf(name.getMethodName()); byte[] family = Bytes.toBytes("col"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java index c8e9a561dd4..70d39eb3154 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java @@ -44,7 +44,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; @@ -93,7 +93,7 @@ public class TestHFileArchiving { HBaseClassTestRule.forClass(TestHFileArchiving.class); private static final Logger LOG = LoggerFactory.getLogger(TestHFileArchiving.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] TEST_FAM = Bytes.toBytes("fam"); private static DirScanPool POOL; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java index 7472f91738c..6355abd0f36 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -82,7 +82,7 @@ public class TestZooKeeperTableArchiveClient { HBaseClassTestRule.forClass(TestZooKeeperTableArchiveClient.class); private static final Logger LOG = LoggerFactory.getLogger(TestZooKeeperTableArchiveClient.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String STRING_TABLE_NAME = "test"; private static final byte[] TEST_FAM = Bytes.toBytes("fam"); private static final byte[] TABLE_NAME = Bytes.toBytes(STRING_TABLE_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableRegionReplicasRead.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableRegionReplicasRead.java index 0a72d836bbc..6134a54bba5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableRegionReplicasRead.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableRegionReplicasRead.java @@ -29,7 +29,7 @@ import java.util.concurrent.ForkJoinPool; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -49,7 +49,7 @@ import org.apache.hbase.thirdparty.com.google.common.io.Closeables; public abstract class AbstractTestAsyncTableRegionReplicasRead { - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java index 5831bfcc60b..c34f8727949 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java @@ -28,8 +28,7 @@ import java.util.concurrent.ForkJoinPool; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException; import org.apache.hadoop.hbase.util.Bytes; @@ -40,7 +39,7 @@ import org.junit.Test; public abstract class AbstractTestAsyncTableScan { - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestCITimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestCITimeout.java index 33e7fe4ace9..5923236c854 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestCITimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestCITimeout.java @@ -23,7 +23,7 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -42,7 +42,7 @@ import org.junit.rules.TestName; */ public abstract class AbstractTestCITimeout { - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static final byte[] FAM_NAM = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestRegionLocator.java index 09a08131751..f14faf7568c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestRegionLocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestRegionLocator.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Collections; import java.util.List; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; @@ -36,7 +36,7 @@ import org.junit.Test; public abstract class AbstractTestRegionLocator { - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static TableName TABLE_NAME = TableName.valueOf("Locator"); @@ -48,7 +48,7 @@ public abstract class AbstractTestRegionLocator { protected static void startClusterAndCreateTable() throws Exception { UTIL.startMiniCluster(3); - HBaseTestingUtility.setReplicas(UTIL.getAdmin(), TableName.META_TABLE_NAME, REGION_REPLICATION); + HBaseTestingUtil.setReplicas(UTIL.getAdmin(), TableName.META_TABLE_NAME, REGION_REPLICATION); TableDescriptor td = TableDescriptorBuilder.newBuilder(TABLE_NAME).setRegionReplication(REGION_REPLICATION) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY)).build(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestScanCursor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestScanCursor.java index 14f2caa3262..e8d51a55743 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestScanCursor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestScanCursor.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; @@ -39,7 +39,7 @@ import org.junit.BeforeClass; public abstract class AbstractTestScanCursor { - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /** * Table configuration diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestUpdateConfiguration.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestUpdateConfiguration.java index ec6204dbe14..ff84bfc8392 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestUpdateConfiguration.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestUpdateConfiguration.java @@ -22,7 +22,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; /** @@ -39,7 +39,7 @@ public abstract class AbstractTestUpdateConfiguration { private static Path overrideConfigFileUnderTestDataDir; private static Path backupConfigFileUnderTestDataDir; - protected static void setUpConfigurationFiles(final HBaseTestingUtility testUtil) + protected static void setUpConfigurationFiles(final HBaseTestingUtil testUtil) throws Exception { // Before this change, the test will update hbase-site.xml under target/test-classes and // trigger a config reload. Since target/test-classes/hbase-site.xml is being used by @@ -74,7 +74,7 @@ public abstract class AbstractTestUpdateConfiguration { testUtil.getConfiguration().addResource(testUtil.getDataTestDir(SERVER_CONFIG)); } - protected static void addResourceToRegionServerConfiguration(final HBaseTestingUtility testUtil) { + protected static void addResourceToRegionServerConfiguration(final HBaseTestingUtil testUtil) { // When RegionServer is created in MiniHBaseCluster, it uses HBaseConfiguration.create(conf) of // the master Configuration. The create() just copies config params over, it does not do // a clone for a historic reason. Properties such as resources are lost during this process. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/ClientPushbackTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/ClientPushbackTestBase.java index a7202b857e6..c818d6f80d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/ClientPushbackTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/ClientPushbackTestBase.java @@ -28,7 +28,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; public abstract class ClientPushbackTestBase { private static final Logger LOG = LoggerFactory.getLogger(ClientPushbackTestBase.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final TableName tableName = TableName.valueOf("client-pushback"); private static final byte[] family = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientTestBase.java index 611d9001725..fa44c5c35ec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/CloneSnapshotFromClientTestBase.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -37,7 +37,7 @@ import org.junit.rules.TestName; */ public class CloneSnapshotFromClientTestBase { - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final byte[] FAMILY = Bytes.toBytes("cf"); @@ -145,7 +145,7 @@ public class CloneSnapshotFromClientTestBase { return 1; } - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java index d15f2d96407..540acc60223 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.client; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -30,11 +30,11 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.filter.BinaryComparator; import org.apache.hadoop.hbase.filter.Filter; @@ -66,7 +66,7 @@ import org.apache.hbase.thirdparty.com.google.common.base.Preconditions; @RunWith(Parameterized.class) class FromClientSideBase { private static final Logger LOG = LoggerFactory.getLogger(FromClientSideBase.class); - static HBaseTestingUtility TEST_UTIL; + static HBaseTestingUtil TEST_UTIL; static byte [] ROW = Bytes.toBytes("testRow"); static byte [] FAMILY = Bytes.toBytes("testFamily"); static final byte[] INVALID_FAMILY = Bytes.toBytes("invalidTestFamily"); @@ -118,7 +118,7 @@ class FromClientSideBase { // We reached end of a parameterized run, clean up. TEST_UTIL.shutdownMiniCluster(); } - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); Configuration conf = TEST_UTIL.getConfiguration(); conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, Arrays.stream(cps).map(Class::getName).toArray(String[]::new)); @@ -127,7 +127,7 @@ class FromClientSideBase { ConnectionRegistry.class); Preconditions.checkArgument(numHedgedReqs > 0); conf.setInt(MasterRegistry.MASTER_REGISTRY_HEDGED_REQS_FANOUT_KEY, numHedgedReqs); - StartMiniClusterOption.Builder builder = StartMiniClusterOption.builder(); + StartTestingClusterOption.Builder builder = StartTestingClusterOption.builder(); // Multiple masters needed only when hedged reads for master registry are enabled. builder.numMasters(numHedgedReqs > 1 ? 3 : 1).numRegionServers(SLAVES); TEST_UTIL.startMiniCluster(builder.build()); @@ -200,7 +200,7 @@ class FromClientSideBase { protected void putRows(Table ht, int numRows, String value, String key) throws IOException { for (int i = 0; i < numRows; i++) { - String row = key + "_" + HBaseCommonTestingUtility.getRandomUUID().toString(); + String row = key + "_" + HBaseCommonTestingUtil.getRandomUUID().toString(); System.out.println(String.format("Saving row: %s, with value %s", row, value)); Put put = new Put(Bytes.toBytes(row)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java index 8cfad19f66d..d34b4192744 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/MetaWithReplicasTestBase.java @@ -25,9 +25,9 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.master.assignment.AssignmentManager; @@ -47,7 +47,7 @@ public class MetaWithReplicasTestBase { private static final Logger LOG = LoggerFactory.getLogger(MetaWithReplicasTestBase.class); - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static final int REGIONSERVERS_COUNT = 3; @@ -58,11 +58,11 @@ public class MetaWithReplicasTestBase { TEST_UTIL.getConfiguration().setInt("zookeeper.session.timeout", 30000); TEST_UTIL.getConfiguration() .setInt(StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, 1000); - StartMiniClusterOption option = StartMiniClusterOption.builder().numAlwaysStandByMasters(1) - .numMasters(1).numRegionServers(REGIONSERVERS_COUNT).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numAlwaysStandByMasters(1).numMasters(1).numRegionServers(REGIONSERVERS_COUNT).build(); TEST_UTIL.startMiniCluster(option); Admin admin = TEST_UTIL.getAdmin(); - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, 3); AssignmentManager am = TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager(); Set sns = new HashSet(); ServerName hbaseMetaServerName = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RegionReplicaTestHelper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RegionReplicaTestHelper.java index 989fdbb51ff..abb0c110344 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RegionReplicaTestHelper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RegionReplicaTestHelper.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionLocations; @@ -43,7 +43,7 @@ public final class RegionReplicaTestHelper { } // waits for all replicas to have region location - static void waitUntilAllMetaReplicasAreReady(HBaseTestingUtility util, + static void waitUntilAllMetaReplicasAreReady(HBaseTestingUtil util, ConnectionRegistry registry) throws IOException { Configuration conf = util.getConfiguration(); int regionReplicaCount = @@ -81,7 +81,7 @@ public final class RegionReplicaTestHelper { }); } - static Optional getRSCarryingReplica(HBaseTestingUtility util, TableName tableName, + static Optional getRSCarryingReplica(HBaseTestingUtil util, TableName tableName, int replicaId) { return util.getHBaseCluster().getRegionServerThreads().stream().map(t -> t.getRegionServer()) .filter(rs -> rs.getRegions(tableName).stream() @@ -92,7 +92,7 @@ public final class RegionReplicaTestHelper { /** * Return the new location. */ - static ServerName moveRegion(HBaseTestingUtility util, HRegionLocation currentLoc) + static ServerName moveRegion(HBaseTestingUtil util, HRegionLocation currentLoc) throws Exception { ServerName serverName = currentLoc.getServerName(); RegionInfo regionInfo = currentLoc.getRegion(); @@ -125,7 +125,7 @@ public final class RegionReplicaTestHelper { void updateCachedLocationOnError(HRegionLocation loc, Throwable error) throws Exception; } - static void testLocator(HBaseTestingUtility util, TableName tableName, Locator locator) + static void testLocator(HBaseTestingUtil util, TableName tableName, Locator locator) throws Exception { RegionLocations locs = locator.getRegionLocations(tableName, RegionReplicaUtil.DEFAULT_REPLICA_ID, false); @@ -185,7 +185,7 @@ public final class RegionReplicaTestHelper { locator.getRegionLocations(tableName, 2, false).getRegionLocation(2).getServerName()); } - public static void assertReplicaDistributed(HBaseTestingUtility util, Table t) + public static void assertReplicaDistributed(HBaseTestingUtil util, Table t) throws IOException { if (t.getDescriptor().getRegionReplication() <= 1) { return; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java index 0b1ffdeffd8..f1ad4627cc9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -37,7 +37,7 @@ import org.junit.rules.TestName; * Base class for testing restore snapshot */ public class RestoreSnapshotFromClientTestBase { - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final byte[] FAMILY = Bytes.toBytes("cf"); protected final byte[] TEST_FAMILY2 = Bytes.toBytes("cf2"); @@ -134,7 +134,7 @@ public class RestoreSnapshotFromClientTestBase { return TEST_UTIL.countRows(table, families); } - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java index cfdbf43f847..f0e47d1d74d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java @@ -22,8 +22,8 @@ import java.util.List; import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.master.MasterCoprocessorHost; @@ -50,7 +50,7 @@ public abstract class SnapshotWithAclTestBase extends SecureTestUtil { private static byte[] TEST_QUALIFIER = Bytes.toBytes("cq"); private static byte[] TEST_ROW = Bytes.toBytes(0); - protected static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // user is table owner. will have all permissions on table private static User USER_OWNER; @@ -253,9 +253,9 @@ public abstract class SnapshotWithAclTestBase extends SecureTestUtil { @Test public void testDeleteSnapshot() throws Exception { - String testSnapshotName = HBaseCommonTestingUtility.getRandomUUID().toString(); + String testSnapshotName = HBaseCommonTestingUtil.getRandomUUID().toString(); verifyAllowed(new AccessSnapshotAction(testSnapshotName), USER_OWNER); - verifyDenied(new AccessSnapshotAction(HBaseCommonTestingUtility.getRandomUUID().toString()), + verifyDenied(new AccessSnapshotAction(HBaseCommonTestingUtil.getRandomUUID().toString()), USER_RO, USER_RW, USER_NONE); List snapshotDescriptions = TEST_UTIL.getAdmin().listSnapshots( Pattern.compile(testSnapshotName)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java index e5bf4b1441d..22302629dc7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.client; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java index 102e7e20c37..f9677091054 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java @@ -37,8 +37,8 @@ import java.util.stream.Collectors; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotDisabledException; @@ -394,7 +394,7 @@ public class TestAdmin2 extends TestAdminBase { @Test public void testMoveToPreviouslyAssignedRS() throws IOException, InterruptedException { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); final TableName tableName = TableName.valueOf(name.getMethodName()); Admin localAdmin = createTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdminBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdminBase.java index c379775a602..605efcd958a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdminBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdminBase.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import static org.junit.Assert.assertNotNull; import java.io.IOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -32,7 +32,7 @@ import org.junit.rules.TestName; public class TestAdminBase { - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static Admin ADMIN; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAlwaysSetScannerId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAlwaysSetScannerId.java index 22093265749..ac1bdb60389 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAlwaysSetScannerId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAlwaysSetScannerId.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.BlockingRpcCallback; import org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl; @@ -53,7 +53,7 @@ public class TestAlwaysSetScannerId { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAlwaysSetScannerId.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAppendFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAppendFromClientSide.java index 78515c6c2f2..366990a2b95 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAppendFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAppendFromClientSide.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -47,7 +47,7 @@ public class TestAppendFromClientSide { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAppendFromClientSide.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] ROW = Bytes.toBytes("testRow"); private static byte [] FAMILY = Bytes.toBytes("testFamily"); private static byte [] QUALIFIER = Bytes.toBytes("testQualifier"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBase.java index e895f164cb9..a185501f6a4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBase.java @@ -26,9 +26,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ForkJoinPool; import java.util.function.Supplier; import java.util.regex.Pattern; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.util.Bytes; import org.junit.After; @@ -50,7 +50,7 @@ import org.apache.hbase.thirdparty.com.google.common.io.Closeables; public abstract class TestAsyncAdminBase extends AbstractTestUpdateConfiguration { protected static final Logger LOG = LoggerFactory.getLogger(TestAsyncAdminBase.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static final byte[] FAMILY = Bytes.toBytes("testFamily"); protected static final byte[] FAMILY_0 = Bytes.toBytes("cf0"); protected static final byte[] FAMILY_1 = Bytes.toBytes("cf1"); @@ -85,7 +85,7 @@ public abstract class TestAsyncAdminBase extends AbstractTestUpdateConfiguration TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 120000); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); TEST_UTIL.getConfiguration().setInt(START_LOG_ERRORS_AFTER_COUNT_KEY, 0); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(2). + StartTestingClusterOption option = StartTestingClusterOption.builder().numRegionServers(2). numMasters(2).build(); TEST_UTIL.startMiniCluster(option); ASYNC_CONN = ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBuilder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBuilder.java index d4d0703c9c2..f084eec45bb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBuilder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminBuilder.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Supplier; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessor; @@ -63,7 +63,7 @@ public class TestAsyncAdminBuilder { HBaseClassTestRule.forClass(TestAsyncAdminBuilder.class); private static final Logger LOG = LoggerFactory.getLogger(TestAsyncAdminBuilder.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static AsyncConnection ASYNC_CONN; @Parameter diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminWithRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminWithRegionReplicas.java index c447510cbe4..81dafae9f97 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminWithRegionReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminWithRegionReplicas.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; @@ -53,7 +53,7 @@ public class TestAsyncAdminWithRegionReplicas extends TestAsyncAdminBase { @BeforeClass public static void setUpBeforeClass() throws Exception { TestAsyncAdminBase.setUpBeforeClass(); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); try (ConnectionRegistry registry = ConnectionRegistryFactory.getRegistry(TEST_UTIL.getConfiguration())) { RegionReplicaTestHelper.waitUntilAllMetaReplicasAreReady(TEST_UTIL, registry); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBufferMutator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBufferMutator.java index 874a01c8c71..602bc62ea9a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBufferMutator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBufferMutator.java @@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -58,7 +58,7 @@ public class TestAsyncBufferMutator { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncBufferMutator.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClientPauseForCallQueueTooBig.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClientPauseForCallQueueTooBig.java index 075e1bc2212..675c9e1cd91 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClientPauseForCallQueueTooBig.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClientPauseForCallQueueTooBig.java @@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.CallRunner; @@ -64,7 +64,7 @@ public class TestAsyncClientPauseForCallQueueTooBig { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncClientPauseForCallQueueTooBig.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("CQTBE"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClusterAdminApi.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClusterAdminApi.java index 808bc5d86d6..1fd0b0de26e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClusterAdminApi.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClusterAdminApi.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.RegionMetrics; import org.apache.hadoop.hbase.ServerMetrics; @@ -323,7 +323,7 @@ public class TestAsyncClusterAdminApi extends TestAsyncAdminBase { admin.createTable(builder.build(), Bytes.toBytes("aaaaa"), Bytes.toBytes("zzzzz"), 16).join(); AsyncTable asyncTable = ASYNC_CONN.getTable(table); List puts = new ArrayList<>(); - for (byte[] row : HBaseTestingUtility.ROWS) { + for (byte[] row : HBaseTestingUtil.ROWS) { puts.add(new Put(row).addColumn(FAMILY, Bytes.toBytes("q"), Bytes.toBytes("v"))); } asyncTable.putAll(puts).join(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java index 15067070642..480d797d595 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncMetaRegionLocator.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import static org.apache.hadoop.hbase.client.RegionReplicaTestHelper.testLocator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.TableName; @@ -42,7 +42,7 @@ public class TestAsyncMetaRegionLocator { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncMetaRegionLocator.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static ConnectionRegistry REGISTRY; @@ -51,7 +51,7 @@ public class TestAsyncMetaRegionLocator { @BeforeClass public static void setUp() throws Exception { TEST_UTIL.startMiniCluster(3); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); TEST_UTIL.waitUntilNoRegionsInTransition(); REGISTRY = ConnectionRegistryFactory.getRegistry(TEST_UTIL.getConfiguration()); RegionReplicaTestHelper.waitUntilAllMetaReplicasAreReady(TEST_UTIL, REGISTRY); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java index 99d98c92e7b..44b954e635e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java @@ -37,7 +37,7 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.stream.IntStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionLocations; @@ -74,7 +74,7 @@ public class TestAsyncNonMetaRegionLocator { private static final Logger LOG = LoggerFactory.getLogger(TestAsyncNonMetaRegionLocator.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); @@ -103,7 +103,7 @@ public class TestAsyncNonMetaRegionLocator { admin.balancerSwitch(false, true); // Enable hbase:meta replication. - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, numOfMetaReplica); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, numOfMetaReplica); TEST_UTIL.waitFor(30000, () -> TEST_UTIL.getMiniHBaseCluster().getRegions( TableName.META_TABLE_NAME).size() >= numOfMetaReplica); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocatorConcurrenyLimit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocatorConcurrenyLimit.java index 6aad76c37a4..690a3848a4f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocatorConcurrenyLimit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocatorConcurrenyLimit.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.TableName; @@ -63,7 +63,7 @@ public class TestAsyncNonMetaRegionLocatorConcurrenyLimit { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncNonMetaRegionLocatorConcurrenyLimit.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionLocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionLocator.java index bdc688e0d9f..0a0885e2b7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionLocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionLocator.java @@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -64,7 +64,7 @@ public class TestAsyncRegionLocator { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncRegionLocator.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApiWithClusters.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApiWithClusters.java index c9599630ba7..6337bd0d013 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApiWithClusters.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApiWithClusters.java @@ -33,7 +33,7 @@ import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -64,7 +64,7 @@ public class TestAsyncReplicationAdminApiWithClusters extends TestAsyncAdminBase private final static String ID_SECOND = "2"; - private static HBaseTestingUtility TEST_UTIL2; + private static HBaseTestingUtil TEST_UTIL2; private static Configuration conf2; private static AsyncAdmin admin2; private static AsyncConnection connection; @@ -80,7 +80,7 @@ public class TestAsyncReplicationAdminApiWithClusters extends TestAsyncAdminBase conf2 = HBaseConfiguration.create(TEST_UTIL.getConfiguration()); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - TEST_UTIL2 = new HBaseTestingUtility(conf2); + TEST_UTIL2 = new HBaseTestingUtil(conf2); TEST_UTIL2.startMiniCluster(); connection = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSingleRequestRpcRetryingCaller.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSingleRequestRpcRetryingCaller.java index 58c6a04f153..9da38ae4959 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSingleRequestRpcRetryingCaller.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSingleRequestRpcRetryingCaller.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.security.User; @@ -52,7 +52,7 @@ public class TestAsyncSingleRequestRpcRetryingCaller { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncSingleRequestRpcRetryingCaller.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTable.java index 50f30d6c7ad..d37f3c369da 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTable.java @@ -43,7 +43,7 @@ import java.util.function.Supplier; import java.util.stream.IntStream; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.filter.BinaryComparator; @@ -81,7 +81,7 @@ public class TestAsyncTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatch.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatch.java index 78dbf0bac8b..e6544b2d1cb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatch.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatch.java @@ -44,7 +44,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -74,7 +74,7 @@ public class TestAsyncTableBatch { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableBatch.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatchRetryImmediately.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatchRetryImmediately.java index 028b8fd8c30..d9c4bc91d17 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatchRetryImmediately.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableBatchRetryImmediately.java @@ -26,7 +26,7 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.logging.Log4jUtils; @@ -46,7 +46,7 @@ public class TestAsyncTableBatchRetryImmediately { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableBatchRetryImmediately.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreaded.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreaded.java index 6c84b0aafdf..ca11ea69b96 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreaded.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableGetMultiThreaded.java @@ -36,7 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MemoryCompactionPolicy; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -72,7 +72,7 @@ public class TestAsyncTableGetMultiThreaded { private static final Logger LOG = LoggerFactory.getLogger(TestAsyncTableGetMultiThreaded.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("async"); private static final byte[] FAMILY = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocatePrefetch.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocatePrefetch.java index 6c6bb98d84e..245d7555484 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocatePrefetch.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocatePrefetch.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertNotNull; import java.util.concurrent.ExecutionException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -41,7 +41,7 @@ public class TestAsyncTableLocatePrefetch { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableLocatePrefetch.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); @@ -75,7 +75,7 @@ public class TestAsyncTableLocatePrefetch { Thread.sleep(1000); // confirm that the locations of all the regions have been cached. assertNotNull(LOCATOR.getRegionLocationInCache(TABLE_NAME, Bytes.toBytes("aaa"))); - for (byte[] row : HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE) { + for (byte[] row : HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE) { assertNotNull(LOCATOR.getRegionLocationInCache(TABLE_NAME, row)); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocateRegionForDeletedTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocateRegionForDeletedTable.java index ac647c69370..ad52e635699 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocateRegionForDeletedTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocateRegionForDeletedTable.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -46,7 +46,7 @@ public class TestAsyncTableLocateRegionForDeletedTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableLocateRegionForDeletedTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableNoncedRetry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableNoncedRetry.java index 9bc4150440c..a384bf194d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableNoncedRetry.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableNoncedRetry.java @@ -29,7 +29,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -58,7 +58,7 @@ public class TestAsyncTableNoncedRetry { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableNoncedRetry.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableRSCrashPublish.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableRSCrashPublish.java index 461bf1b9e0b..6c538f5e3e7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableRSCrashPublish.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableRSCrashPublish.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.concurrent.ExecutionException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -45,7 +45,7 @@ public class TestAsyncTableRSCrashPublish { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableRSCrashPublish.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("Publish"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanException.java index 3dbb1d01e82..893c3839378 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanException.java @@ -29,7 +29,7 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -56,7 +56,7 @@ public class TestAsyncTableScanException { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableScanException.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("scan"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanMetrics.java index f5aa1967690..6420806d7ee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanMetrics.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.ForkJoinPool; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; @@ -54,7 +54,7 @@ public class TestAsyncTableScanMetrics { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableScanMetrics.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("ScanMetrics"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanRenewLease.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanRenewLease.java index 8a05e19c831..0936bbe4049 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanRenewLease.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScanRenewLease.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -44,7 +44,7 @@ public class TestAsyncTableScanRenewLease { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableScanRenewLease.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScannerCloseWhileSuspending.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScannerCloseWhileSuspending.java index 4ac0856ae1f..10b6b622fec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScannerCloseWhileSuspending.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableScannerCloseWhileSuspending.java @@ -23,7 +23,7 @@ import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -42,7 +42,7 @@ public class TestAsyncTableScannerCloseWhileSuspending { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableScannerCloseWhileSuspending.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableUseMetaReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableUseMetaReplicas.java index 47d6ddb4294..61bb1635a51 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableUseMetaReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableUseMetaReplicas.java @@ -25,7 +25,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -52,7 +52,7 @@ public class TestAsyncTableUseMetaReplicas { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAsyncTableUseMetaReplicas.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("Replica"); @@ -91,7 +91,7 @@ public class TestAsyncTableUseMetaReplicas { conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, FailPrimaryMetaScanCp.class.getName()); UTIL.startMiniCluster(3); - HBaseTestingUtility.setReplicas(UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); try (ConnectionRegistry registry = ConnectionRegistryFactory.getRegistry(conf)) { RegionReplicaTestHelper.waitUntilAllMetaReplicasAreReady(UTIL, registry); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java index 34b45f02314..18e0b5cda8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAvoidCellReferencesIntoShippedBlocks.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -72,7 +72,7 @@ public class TestAvoidCellReferencesIntoShippedBlocks { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAvoidCellReferencesIntoShippedBlocks.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static byte[][] ROWS = new byte[2][]; private static byte[] ROW = Bytes.toBytes("testRow"); private static byte[] ROW1 = Bytes.toBytes("testRow1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java index 48b16ff7f4a..a69bc4d4dc5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBlockEvictionFromClient.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -83,7 +83,7 @@ public class TestBlockEvictionFromClient { HBaseClassTestRule.forClass(TestBlockEvictionFromClient.class); private static final Logger LOG = LoggerFactory.getLogger(TestBlockEvictionFromClient.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static byte[][] ROWS = new byte[2][]; private static int NO_OF_THREADS = 3; private static byte[] ROW = Bytes.toBytes("testRow"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutator.java index 3c660d90509..03f32b09761 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutator.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -41,7 +41,7 @@ public class TestBufferedMutator { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBufferedMutator.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCatalogReplicaLoadBalanceSimpleSelector.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCatalogReplicaLoadBalanceSimpleSelector.java index a0b49b91a09..bebc843933e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCatalogReplicaLoadBalanceSimpleSelector.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCatalogReplicaLoadBalanceSimpleSelector.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.security.User; @@ -52,7 +52,7 @@ public class TestCatalogReplicaLoadBalanceSimpleSelector { private static final Logger LOG = LoggerFactory.getLogger( TestCatalogReplicaLoadBalanceSimpleSelector.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int NB_SERVERS = 4; private static int numOfMetaReplica = NB_SERVERS - 1; @@ -71,7 +71,7 @@ public class TestCatalogReplicaLoadBalanceSimpleSelector { admin.balancerSwitch(false, true); // Enable hbase:meta replication. - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, numOfMetaReplica); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, numOfMetaReplica); TEST_UTIL.waitFor(30000, () -> TEST_UTIL.getMiniHBaseCluster().getRegions( TableName.META_TABLE_NAME).size() >= numOfMetaReplica); @@ -110,7 +110,7 @@ public class TestCatalogReplicaLoadBalanceSimpleSelector { RegionReplicaUtil.DEFAULT_REPLICA_ID); // Change to No meta replica - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 1); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, 1); TEST_UTIL.waitFor(30000, () -> TEST_UTIL.getMiniHBaseCluster().getRegions( TableName.META_TABLE_NAME).size() == 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java index 262b6080538..1c58db33e54 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java @@ -31,7 +31,7 @@ import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.filter.BinaryComparator; import org.apache.hadoop.hbase.filter.FamilyFilter; @@ -58,7 +58,7 @@ public class TestCheckAndMutate { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCheckAndMutate.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROWKEY = Bytes.toBytes("12345"); private static final byte[] ROWKEY2 = Bytes.toBytes("67890"); private static final byte[] ROWKEY3 = Bytes.toBytes("abcde"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutateWithByteBuff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutateWithByteBuff.java index 876259f4e81..de1d02bfe73 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutateWithByteBuff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutateWithByteBuff.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.client; import static org.apache.hadoop.hbase.util.Threads.sleep; import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; @@ -26,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.io.ByteBuffAllocator; @@ -60,7 +61,7 @@ public class TestCheckAndMutateWithByteBuff { public TestName name = new TestName(); private static final byte[] CF = Bytes.toBytes("CF"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Configuration conf = TEST_UTIL.getConfiguration(); private static Admin admin = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCleanupMetaReplica.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCleanupMetaReplica.java index 15815e40d6b..dc922844692 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCleanupMetaReplica.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCleanupMetaReplica.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; @@ -48,7 +48,7 @@ public class TestCleanupMetaReplica extends MetaWithReplicasTestBase { ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher(); List metaReplicaZnodes = zkw.getMetaReplicaNodes(); assertEquals(3, metaReplicaZnodes.size()); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 1); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 1); metaReplicaZnodes = zkw.getMetaReplicaNodes(); assertEquals(1, metaReplicaZnodes.size()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java index 8af1f408a06..9de23a1bce2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -57,7 +57,7 @@ public class TestClientOperationInterrupt { private static final Logger LOG = LoggerFactory.getLogger(TestClientOperationInterrupt.class); - private static HBaseTestingUtility util; + private static HBaseTestingUtil util; private static final TableName tableName = TableName.valueOf("test"); private static final byte[] dummy = Bytes.toBytes("dummy"); private static final byte[] row1 = Bytes.toBytes("r1"); @@ -83,7 +83,7 @@ public class TestClientOperationInterrupt { conf = HBaseConfiguration.create(); conf.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, TestCoprocessor.class.getName()); - util = new HBaseTestingUtility(conf); + util = new HBaseTestingUtil(conf); util.startMiniCluster(); Admin admin = util.getAdmin(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java index a47ebf37492..e58a66ffebc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientScannerRPCTimeout.java @@ -22,9 +22,9 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster.MiniHBaseClusterRegionServer; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.RSRpcServices; @@ -60,7 +60,7 @@ public class TestClientScannerRPCTimeout { HBaseClassTestRule.forClass(TestClientScannerRPCTimeout.class); private static final Logger LOG = LoggerFactory.getLogger(TestClientScannerRPCTimeout.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY = Bytes.toBytes("testFamily"); private static final byte[] QUALIFIER = Bytes.toBytes("testQualifier"); private static final byte[] VALUE = Bytes.toBytes("testValue"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java index 5958d3867c1..610fa7b3e57 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java @@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.exceptions.MasterRegistryFetchException; @@ -60,7 +60,7 @@ public class TestClientTimeouts { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClientTimeouts.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static int SLAVES = 1; @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java index 3eecb69c77a..662790de0ad 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnection.java @@ -32,7 +32,7 @@ import java.util.stream.IntStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; @@ -75,7 +75,7 @@ public class TestConnection { HBaseClassTestRule.forClass(TestConnection.class); private static final Logger LOG = LoggerFactory.getLogger(TestConnection.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAM_NAM = Bytes.toBytes("f"); private static final byte[] ROW = Bytes.toBytes("bbb"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestDropTimeoutRequest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestDropTimeoutRequest.java index b8ebccd7d5e..8fd2566dd89 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestDropTimeoutRequest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestDropTimeoutRequest.java @@ -23,7 +23,7 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -59,7 +59,7 @@ public class TestDropTimeoutRequest { public TestName name = new TestName(); private static final Logger LOG = LoggerFactory.getLogger(TestDropTimeoutRequest.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAM_NAM = Bytes.toBytes("f"); private static final int RPC_RETRY = 5; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java index 25e8be24644..006f2e69694 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestEnableTable.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -53,7 +53,7 @@ public class TestEnableTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestEnableTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestEnableTable.class); private static final byte[] FAMILYNAME = Bytes.toBytes("fam"); @@ -85,7 +85,7 @@ public class TestEnableTable { TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILYNAME)).build(); try { - createTable(TEST_UTIL, tableDescriptor, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + createTable(TEST_UTIL, tableDescriptor, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } catch (Exception e) { LOG.error("", e); fail("Got an exception while creating " + tableName); @@ -158,7 +158,7 @@ public class TestEnableTable { } } - public static void createTable(HBaseTestingUtility testUtil, TableDescriptor tableDescriptor, + public static void createTable(HBaseTestingUtil testUtil, TableDescriptor tableDescriptor, byte[][] splitKeys) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. @@ -176,7 +176,7 @@ public class TestEnableTable { testUtil.waitUntilAllRegionsAssigned(tableDescriptor.getTableName()); } - public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName) + public static void deleteTable(HBaseTestingUtil testUtil, TableName tableName) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFailedMetaReplicaAssigment.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFailedMetaReplicaAssigment.java index 18235ebbcf9..e33655473d0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFailedMetaReplicaAssigment.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFailedMetaReplicaAssigment.java @@ -27,9 +27,9 @@ import java.util.Collections; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterServices; import org.apache.hadoop.hbase.master.assignment.AssignmentManager; @@ -54,7 +54,7 @@ public class TestFailedMetaReplicaAssigment { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFailedMetaReplicaAssigment.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { @@ -62,8 +62,9 @@ public class TestFailedMetaReplicaAssigment { // this test can be removed once we remove the HConstants.META_REPLICAS_NUM config. Configuration conf = TEST_UTIL.getConfiguration(); conf.setInt(HConstants.META_REPLICAS_NUM, 3); - StartMiniClusterOption option = StartMiniClusterOption.builder().numAlwaysStandByMasters(1) - .numMasters(1).numRegionServers(1).masterClass(BrokenMetaReplicaMaster.class).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numAlwaysStandByMasters(1).numMasters(1) + .numRegionServers(1).masterClass(BrokenMetaReplicaMaster.class).build(); TEST_UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClient.java index cd496bea35c..61520d33752 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClient.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; @@ -56,7 +56,7 @@ public class TestFlushFromClient { HBaseClassTestRule.forClass(TestFlushFromClient.class); private static final Logger LOG = LoggerFactory.getLogger(TestFlushFromClient.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static AsyncConnection asyncConn; private static final byte[][] SPLITS = new byte[][]{Bytes.toBytes("3"), Bytes.toBytes("7")}; private static final List ROWS = Arrays.asList( diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java index 87ad7db8322..e5bf90b2aa7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.client; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.KeepDeletedCells; @@ -136,19 +136,19 @@ public class TestFromClientSide extends FromClientSideBase { Table table = connection.getTableBuilder(name.getTableName(), null). setOperationTimeout(3 * 1000).build()) { Append append = new Append(ROW); - append.addColumn(HBaseTestingUtility.fam1, QUALIFIER, VALUE); + append.addColumn(HBaseTestingUtil.fam1, QUALIFIER, VALUE); Result result = table.append(append); // Verify expected result Cell[] cells = result.rawCells(); assertEquals(1, cells.length); - assertKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, VALUE); + assertKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, VALUE); // Verify expected result again Result readResult = table.get(new Get(ROW)); cells = readResult.rawCells(); assertEquals(1, cells.length); - assertKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, VALUE); + assertKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, VALUE); } } @@ -179,7 +179,7 @@ public class TestFromClientSide extends FromClientSideBase { Table table = connection.getTableBuilder(name.getTableName(), null). setOperationTimeout(3 * 1000).build()) { Append append = new Append(ROW); - append.addColumn(HBaseTestingUtility.fam1, QUALIFIER, VALUE); + append.addColumn(HBaseTestingUtil.fam1, QUALIFIER, VALUE); // Batch append Object[] results = new Object[1]; @@ -188,13 +188,13 @@ public class TestFromClientSide extends FromClientSideBase { // Verify expected result Cell[] cells = ((Result) results[0]).rawCells(); assertEquals(1, cells.length); - assertKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, VALUE); + assertKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, VALUE); // Verify expected result again Result readResult = table.get(new Get(ROW)); cells = readResult.rawCells(); assertEquals(1, cells.length); - assertKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, VALUE); + assertKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, VALUE); } } @@ -340,9 +340,9 @@ public class TestFromClientSide extends FromClientSideBase { try (Table ht = TEST_UTIL.createTable(tableName, FAMILIES)) { String value = "this is the value"; String value2 = "this is some other value"; - String keyPrefix1 = HBaseTestingUtility.getRandomUUID().toString(); - String keyPrefix2 = HBaseTestingUtility.getRandomUUID().toString(); - String keyPrefix3 = HBaseTestingUtility.getRandomUUID().toString(); + String keyPrefix1 = HBaseTestingUtil.getRandomUUID().toString(); + String keyPrefix2 = HBaseTestingUtil.getRandomUUID().toString(); + String keyPrefix3 = HBaseTestingUtil.getRandomUUID().toString(); putRows(ht, 3, value, keyPrefix1); putRows(ht, 3, value, keyPrefix2); putRows(ht, 3, value, keyPrefix3); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java index 6b7a806de2f..ddfa3751579 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java @@ -42,7 +42,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.RegionMetrics; @@ -91,8 +91,8 @@ public class TestFromClientSide3 { HBaseClassTestRule.forClass(TestFromClientSide3.class); private static final Logger LOG = LoggerFactory.getLogger(TestFromClientSide3.class); - private final static HBaseTestingUtility TEST_UTIL - = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL + = new HBaseTestingUtil(); private static final int WAITTABLE_MILLIS = 10000; private static byte[] FAMILY = Bytes.toBytes("testFamily"); private static Random random = new Random(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java index c101599709b..6ce193969b3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java @@ -40,7 +40,7 @@ import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint; @@ -1241,7 +1241,7 @@ public class TestFromClientSide4 extends FromClientSideBase { } // stop the master - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); cluster.stopMaster(0, false); cluster.waitOnMaster(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideNoCodec.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideNoCodec.java index 74bb57de126..9990f876330 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideNoCodec.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideNoCodec.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.AbstractRpcClient; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -49,7 +49,7 @@ public class TestFromClientSideNoCodec { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFromClientSideNoCodec.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java index a4f79e79667..c4932415b7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.exceptions.ScannerResetException; @@ -66,7 +66,7 @@ public class TestFromClientSideScanExcpetion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFromClientSideScanExcpetion.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte[] FAMILY = Bytes.toBytes("testFamily"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetProcedureResult.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetProcedureResult.java index f2979e4c6c3..a6f3e2238de 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetProcedureResult.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetProcedureResult.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -56,7 +56,7 @@ public class TestGetProcedureResult { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestGetProcedureResult.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); public static final class DummyProcedure extends Procedure implements TableProcedureInterface { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanColumnsWithNewVersionBehavior.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanColumnsWithNewVersionBehavior.java index f256a87f1a3..cb4b260434a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanColumnsWithNewVersionBehavior.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanColumnsWithNewVersionBehavior.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertArrayEquals; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Cell; @@ -47,7 +47,7 @@ public class TestGetScanColumnsWithNewVersionBehavior { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestGetScanColumnsWithNewVersionBehavior.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE = TableName.valueOf("table"); private static final byte[] CF = { 'c', 'f' }; private static final byte[] ROW = { 'r', 'o', 'w' }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanPartialResult.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanPartialResult.java index 63976e0169a..222cd12ee50 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanPartialResult.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGetScanPartialResult.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -44,7 +44,7 @@ public class TestGetScanPartialResult { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestGetScanPartialResult.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE = TableName.valueOf("table"); private static final byte[] CF = { 'c', 'f' }; private static final byte[] ROW = { 'r', 'o', 'w' }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHbck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHbck.java index cc2c8f21c9a..4d3cd393ef0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHbck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHbck.java @@ -31,7 +31,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessor; @@ -79,7 +79,7 @@ public class TestHbck { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHbck.class); private static final Logger LOG = LoggerFactory.getLogger(TestHbck.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java index 1a9e5b5c57e..2ea88527472 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java @@ -28,7 +28,7 @@ import java.io.IOException; import java.lang.reflect.Field; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -54,7 +54,7 @@ public class TestIllegalTableDescriptor { // NOTE: Increment tests were moved to their own class, TestIncrementsFromClientSide. private static final Logger LOGGER; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] FAMILY = Bytes.toBytes("testFamily"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java index 3ffe5fc2d96..fdfe2df6f42 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -76,7 +76,7 @@ public class TestIncrementsFromClientSide { HBaseClassTestRule.forClass(TestIncrementsFromClientSide.class); final Logger LOG = LoggerFactory.getLogger(getClass()); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] ROW = Bytes.toBytes("testRow"); private static byte [] FAMILY = Bytes.toBytes("testFamily"); private static byte [] QUALIFIER = Bytes.toBytes("testQualifier"); @@ -127,18 +127,18 @@ public class TestIncrementsFromClientSide { Table table = connection.getTableBuilder(TableName.valueOf(name.getMethodName()), null) .setOperationTimeout(3 * 1000).build()) { Increment inc = new Increment(ROW); - inc.addColumn(HBaseTestingUtility.fam1, QUALIFIER, 1); + inc.addColumn(HBaseTestingUtil.fam1, QUALIFIER, 1); Result result = table.increment(inc); Cell[] cells = result.rawCells(); assertEquals(1, cells.length); - assertIncrementKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, 1); + assertIncrementKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, 1); // Verify expected result Result readResult = table.get(new Get(ROW)); cells = readResult.rawCells(); assertEquals(1, cells.length); - assertIncrementKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, 1); + assertIncrementKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, 1); } } @@ -167,7 +167,7 @@ public class TestIncrementsFromClientSide { Table table = connection.getTableBuilder(TableName.valueOf(name.getMethodName()), null) .setOperationTimeout(3 * 1000).build()) { Increment inc = new Increment(ROW); - inc.addColumn(HBaseTestingUtility.fam1, QUALIFIER, 1); + inc.addColumn(HBaseTestingUtil.fam1, QUALIFIER, 1); // Batch increment Object[] results = new Object[1]; @@ -175,13 +175,13 @@ public class TestIncrementsFromClientSide { Cell[] cells = ((Result) results[0]).rawCells(); assertEquals(1, cells.length); - assertIncrementKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, 1); + assertIncrementKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, 1); // Verify expected result Result readResult = table.get(new Get(ROW)); cells = readResult.rawCells(); assertEquals(1, cells.length); - assertIncrementKey(cells[0], ROW, HBaseTestingUtility.fam1, QUALIFIER, 1); + assertIncrementKey(cells[0], ROW, HBaseTestingUtil.fam1, QUALIFIER, 1); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java index 7cada26db1e..748d896d2f2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIntraRowPagination.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -43,7 +43,7 @@ public class TestIntraRowPagination { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestIntraRowPagination.class); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /** * Test from client side for scan with maxResultPerCF set @@ -62,7 +62,7 @@ public class TestIntraRowPagination { for (byte[] family : FAMILIES) { builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)); } - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), builder.build()); try { Put put; @@ -103,7 +103,7 @@ public class TestIntraRowPagination { TestScannersFromClientSide.verifyResult(result, kvListExp, toLog, "Testing scan with storeOffset and storeLimit"); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestInvalidMutationDurabilityException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestInvalidMutationDurabilityException.java index e22f6dca481..f5142cd6281 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestInvalidMutationDurabilityException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestInvalidMutationDurabilityException.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.InvalidMutationDurabilityException; @@ -39,7 +39,7 @@ public class TestInvalidMutationDurabilityException { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestInvalidMutationDurabilityException.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NOT_REPLICATE = TableName.valueOf("TableNotReplicate"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLimitedScanWithFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLimitedScanWithFilter.java index 9d871d2992b..cecd87fa365 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLimitedScanWithFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLimitedScanWithFilter.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -48,7 +48,7 @@ public class TestLimitedScanWithFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLimitedScanWithFilter.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("TestRegionScanner"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMalformedCellFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMalformedCellFromClient.java index c51041585ec..20ee1993872 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMalformedCellFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMalformedCellFromClient.java @@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.HBaseRpcController; @@ -68,7 +68,7 @@ public class TestMalformedCellFromClient { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMalformedCellFromClient.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY = Bytes.toBytes("testFamily"); private static final int CELL_SIZE = 100; private static final TableName TABLE_NAME = TableName.valueOf("TestMalformedCellFromClient"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java index 359ad61c4b7..e4bdff96f7a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java @@ -30,11 +30,11 @@ import java.util.List; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.master.HMaster; @@ -54,14 +54,14 @@ public class TestMasterRegistry { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterRegistry.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { - StartMiniClusterOption.Builder builder = StartMiniClusterOption.builder(); + StartTestingClusterOption.Builder builder = StartTestingClusterOption.builder(); builder.numMasters(3).numRegionServers(3); TEST_UTIL.startMiniCluster(builder.build()); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java index 4bfdcad029a..4ad2b2de8bc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java @@ -29,7 +29,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CallQueueTooBigException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MultiActionResultTooLarge; import org.apache.hadoop.hbase.NotServingRegionException; @@ -66,7 +66,7 @@ public class TestMetaCache { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaCache.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test_table"); private static final byte[] FAMILY = Bytes.toBytes("fam1"); private static final byte[] QUALIFIER = Bytes.toBytes("qual"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java index 24e88234048..2197a218fb2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java @@ -25,7 +25,7 @@ import java.util.Collections; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MultithreadedTestUtil; @@ -55,13 +55,13 @@ public class TestMetaRegionLocationCache { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaRegionLocationCache.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static ConnectionRegistry REGISTRY; @BeforeClass public static void setUp() throws Exception { TEST_UTIL.startMiniCluster(3); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); REGISTRY = ConnectionRegistryFactory.getRegistry(TEST_UTIL.getConfiguration()); RegionReplicaTestHelper.waitUntilAllMetaReplicasAreReady(TEST_UTIL, REGISTRY); TEST_UTIL.getAdmin().balancerSwitch(false, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaTableAccessorNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaTableAccessorNoCluster.java index e160fb313d2..e859e72ca83 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaTableAccessorNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaTableAccessorNoCluster.java @@ -27,7 +27,7 @@ import java.util.List; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -49,7 +49,7 @@ public class TestMetaTableAccessorNoCluster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaTableAccessorNoCluster.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Before public void before() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasShutdownHandling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasShutdownHandling.java index db08165a395..e7c872d57a0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasShutdownHandling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaWithReplicasShutdownHandling.java @@ -24,7 +24,7 @@ import java.util.Arrays; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; @@ -70,7 +70,7 @@ public class TestMetaWithReplicasShutdownHandling extends MetaWithReplicasTestBa shutdownMetaAndDoValidations(TEST_UTIL); } - public static void shutdownMetaAndDoValidations(HBaseTestingUtility util) throws Exception { + public static void shutdownMetaAndDoValidations(HBaseTestingUtil util) throws Exception { // This test creates a table, flushes the meta (with 3 replicas), kills the // server holding the primary meta replica. Then it does a put/get into/from // the test table. The put/get operations would use the replicas to locate the diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientCloneLinksAfterDelete.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientCloneLinksAfterDelete.java index 0195da59b9a..c2087a93519 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientCloneLinksAfterDelete.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientCloneLinksAfterDelete.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.InterruptedIOException; import java.util.Optional; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -121,7 +121,7 @@ public class TestMobCloneSnapshotFromClientCloneLinksAfterDelete delayFlush = false; int snapshot3Rows = -1; try (Table table = TEST_UTIL.getConnection().getTable(tableName)) { - snapshot3Rows = HBaseTestingUtility.countRows(table); + snapshot3Rows = HBaseTestingUtil.countRows(table); } admin.cloneSnapshot(snapshotName3, clonedTableName3); admin.deleteSnapshot(snapshotName3); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientNormal.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientNormal.java index 94b938e502a..96180d1c34f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientNormal.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobCloneSnapshotFromClientNormal.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.cleaner.TimeToLiveHFileCleaner; import org.apache.hadoop.hbase.mob.MobConstants; @@ -67,7 +67,7 @@ public class TestMobCloneSnapshotFromClientNormal extends CloneSnapshotFromClien } @Override - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterSplittingRegions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterSplittingRegions.java index 1135bd3e0a5..cf4330b26f5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterSplittingRegions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterSplittingRegions.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -55,7 +55,7 @@ public class TestMobRestoreSnapshotFromClientAfterSplittingRegions } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterTruncate.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterTruncate.java index 0abe83d8937..4c0c0a066d3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterTruncate.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterTruncate.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -55,7 +55,7 @@ public class TestMobRestoreSnapshotFromClientAfterTruncate } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientClone.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientClone.java index 475236f821a..3696eaa3c38 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientClone.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientClone.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -54,7 +54,7 @@ public class TestMobRestoreSnapshotFromClientClone extends RestoreSnapshotFromCl } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientGetCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientGetCompactionState.java index c4d6ec3ab29..b17dd03a9e8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientGetCompactionState.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientGetCompactionState.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -55,7 +55,7 @@ public class TestMobRestoreSnapshotFromClientGetCompactionState } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSchemaChange.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSchemaChange.java index 3e3233170ec..abd6a7ce8c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSchemaChange.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSchemaChange.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -55,7 +55,7 @@ public class TestMobRestoreSnapshotFromClientSchemaChange } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSimple.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSimple.java index c0e7379c001..f0ebc70ee83 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSimple.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSimple.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.mob.MobConstants; import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils; @@ -55,7 +55,7 @@ public class TestMobRestoreSnapshotFromClientSimple } @Override - protected void verifyRowCount(HBaseTestingUtility util, TableName tableName, long expectedRows) + protected void verifyRowCount(HBaseTestingUtil util, TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiActionMetricsFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiActionMetricsFromClient.java index 5775ac07792..ca73807e97b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiActionMetricsFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiActionMetricsFromClient.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -40,7 +40,7 @@ public class TestMultiActionMetricsFromClient { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMultiActionMetricsFromClient.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test_table"); private static final byte[] FAMILY = Bytes.toBytes("fam1"); private static final byte[] QUALIFIER = Bytes.toBytes("qual"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java index 487a84916f6..038635bd537 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -65,7 +65,7 @@ public class TestMultiParallel { private static final Logger LOG = LoggerFactory.getLogger(TestMultiParallel.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] VALUE = Bytes.toBytes("value"); private static final byte[] QUALIFIER = Bytes.toBytes("qual"); private static final String FAMILY = "family"; @@ -130,7 +130,7 @@ public class TestMultiParallel { } private static byte[][] makeKeys() { - byte [][] starterKeys = HBaseTestingUtility.KEYS; + byte [][] starterKeys = HBaseTestingUtil.KEYS; // Create a "non-uniform" test set with the following characteristics: // a) Unequal number of keys per region diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java index 4818b6d9b96..f9ac721f9a7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java @@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -59,7 +59,7 @@ public class TestMultiRespectsLimits { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMultiRespectsLimits.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final MetricsAssertHelper METRICS_ASSERT = CompatibilityFactory.getInstance(MetricsAssertHelper.class); private final static byte[] FAMILY = Bytes.toBytes("D"); @@ -108,7 +108,7 @@ public class TestMultiRespectsLimits { List gets = new ArrayList<>(MAX_SIZE); for (int i = 0; i < MAX_SIZE; i++) { - gets.add(new Get(HBaseTestingUtility.ROWS[i])); + gets.add(new Get(HBaseTestingUtil.ROWS[i])); } RpcServerInterface rpcServer = TEST_UTIL.getHBaseCluster().getRegionServer(0).getRpcServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java index bffe2ee5805..561b9d9cab0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -56,7 +56,7 @@ public class TestMultipleTimestamps { HBaseClassTestRule.forClass(TestMultipleTimestamps.class); private static final Logger LOG = LoggerFactory.getLogger(TestMultipleTimestamps.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMutationGetCellBuilder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMutationGetCellBuilder.java index 12defbe6a5a..4ca05affc0a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMutationGetCellBuilder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMutationGetCellBuilder.java @@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilder; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -45,7 +45,7 @@ public class TestMutationGetCellBuilder { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMutationGetCellBuilder.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMvccConsistentScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMvccConsistentScanner.java index 7fd3dda394e..97c0a13ceae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMvccConsistentScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMvccConsistentScanner.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -44,7 +44,7 @@ public class TestMvccConsistentScanner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMvccConsistentScanner.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Connection CONN; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPreadReversedScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPreadReversedScanner.java index 2a7fa69af31..e58b897178d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPreadReversedScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPreadReversedScanner.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Scan.ReadType; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -42,7 +42,7 @@ public class TestPreadReversedScanner { HBaseClassTestRule.forClass(TestPreadReversedScanner.class); public static final Logger LOG = LoggerFactory.getLogger(TestPreadReversedScanner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("testPreadSmall"); private static final byte[] COLUMN_FAMILY = Bytes.toBytes("columnFamily"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java index e1ef4725022..b6861568be7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutWithDelete.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -42,7 +42,7 @@ public class TestPutWithDelete { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestPutWithDelete.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTableLimitedScanWithFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTableLimitedScanWithFilter.java index 3ab9b144189..d63dacfc4d8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTableLimitedScanWithFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTableLimitedScanWithFilter.java @@ -26,7 +26,7 @@ import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -50,7 +50,7 @@ public class TestRawAsyncTableLimitedScanWithFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRawAsyncTableLimitedScanWithFilter.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("TestRegionScanner"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTablePartialScan.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTablePartialScan.java index 4d0cf7e478e..c74d0bf9b36 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTablePartialScan.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRawAsyncTablePartialScan.java @@ -24,7 +24,7 @@ import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -42,7 +42,7 @@ public class TestRawAsyncTablePartialScan { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRawAsyncTablePartialScan.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("async"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRegionLocationCaching.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRegionLocationCaching.java index 276023c9b2d..35e0a2d4d88 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRegionLocationCaching.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRegionLocationCaching.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -42,7 +42,7 @@ public class TestRegionLocationCaching { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionLocationCaching.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static int SLAVES = 1; private static TableName TABLE_NAME = TableName.valueOf("TestRegionLocationCaching"); private static byte[] FAMILY = Bytes.toBytes("testFamily"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java index 99180ec8bad..391eed35b06 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -71,10 +71,10 @@ public class TestReplicaWithCluster { private static final int NB_SERVERS = 3; private static final byte[] row = Bytes.toBytes(TestReplicaWithCluster.class.getName()); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); // second minicluster used in testing of replication - private static HBaseTestingUtility HTU2; + private static HBaseTestingUtil HTU2; private static final byte[] f = HConstants.CATALOG_FAMILY; private final static int REFRESH_PERIOD = 1000; @@ -261,7 +261,7 @@ public class TestReplicaWithCluster { HTU.startMiniCluster(NB_SERVERS); // Enable meta replica at server side - HBaseTestingUtility.setReplicas(HTU.getAdmin(), TableName.META_TABLE_NAME, 2); + HBaseTestingUtil.setReplicas(HTU.getAdmin(), TableName.META_TABLE_NAME, 2); HTU.getHBaseCluster().startMaster(); } @@ -380,18 +380,18 @@ public class TestReplicaWithCluster { builder.setCoprocessor(SlowMeCopro.class.getName()); TableDescriptor tableDescriptor = builder.build(); - HTU.getAdmin().createTable(tableDescriptor, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + HTU.getAdmin().createTable(tableDescriptor, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); Configuration conf2 = HBaseConfiguration.create(HTU.getConfiguration()); conf2.set(HConstants.HBASE_CLIENT_INSTANCE_ID, String.valueOf(-1)); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); MiniZooKeeperCluster miniZK = HTU.getZkCluster(); - HTU2 = new HBaseTestingUtility(conf2); + HTU2 = new HBaseTestingUtil(conf2); HTU2.setZkCluster(miniZK); HTU2.startMiniCluster(NB_SERVERS); LOG.info("Setup second Zk"); - HTU2.getAdmin().createTable(tableDescriptor, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + HTU2.getAdmin().createTable(tableDescriptor, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); try (Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Admin admin = connection.getAdmin()) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java index a64f2969e24..4828cea6c64 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicasClient.java @@ -30,11 +30,11 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.NotServingRegionException; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -85,7 +85,7 @@ public class TestReplicasClient { private static RegionInfo hriPrimary; private static RegionInfo hriSecondary; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; private final static int REFRESH_PERIOD = 1000; @@ -188,7 +188,7 @@ public class TestReplicasClient { StorefileRefresherChore.REGIONSERVER_STOREFILE_REFRESH_PERIOD, REFRESH_PERIOD); HTU.getConfiguration().setBoolean("hbase.client.log.scanner.activity", true); HTU.getConfiguration().setBoolean(MetricsConnection.CLIENT_SIDE_METRICS_ENABLED_KEY, true); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(1). + StartTestingClusterOption option = StartTestingClusterOption.builder().numRegionServers(1). numAlwaysStandByMasters(1).numMasters(1).build(); HTU.startMiniCluster(option); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRequestTooBigException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRequestTooBigException.java index 5f7f154daea..291f0e26012 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRequestTooBigException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRequestTooBigException.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.exceptions.RequestTooBigException; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -41,7 +41,7 @@ public class TestRequestTooBigException { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRequestTooBigException.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultFromCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultFromCoprocessor.java index bbc27210826..42520a94d87 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultFromCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultFromCoprocessor.java @@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -51,7 +51,7 @@ public class TestResultFromCoprocessor { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestResultFromCoprocessor.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW = Bytes.toBytes("normal_row"); private static final byte[] FAMILY = Bytes.toBytes("fm"); private static final byte[] QUAL = Bytes.toBytes("qual"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultSizeEstimation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultSizeEstimation.java index 621747191df..b16c7b6f4a1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultSizeEstimation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResultSizeEstimation.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -44,7 +44,7 @@ public class TestResultSizeEstimation { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestResultSizeEstimation.class); - final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); final static int TAG_DATA_SIZE = 2048; final static int SCANNER_DATA_LIMIT = TAG_DATA_SIZE + 256; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScanWithoutFetchingData.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScanWithoutFetchingData.java index 858fbb753bb..f5f16e4a16a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScanWithoutFetchingData.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScanWithoutFetchingData.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.BlockingRpcCallback; import org.apache.hadoop.hbase.ipc.HBaseRpcController; @@ -55,7 +55,7 @@ public class TestScanWithoutFetchingData { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScanWithoutFetchingData.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java index 4e855fe02e6..3ad91b4d57f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannerTimeout.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -48,8 +48,8 @@ public class TestScannerTimeout { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScannerTimeout.class); - private final static HBaseTestingUtility - TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil + TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestScannerTimeout.class); private final static byte[] SOME_BYTES = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java index d0b3d516b5b..ef522520153 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java @@ -39,13 +39,13 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.TableNotFoundException; @@ -87,7 +87,7 @@ public class TestScannersFromClientSide { private static final Logger LOG = LoggerFactory.getLogger(TestScannersFromClientSide.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static byte [] ROW = Bytes.toBytes("testRow"); private static byte [] FAMILY = Bytes.toBytes("testFamily"); private static byte [] QUALIFIER = Bytes.toBytes("testQualifier"); @@ -145,14 +145,14 @@ public class TestScannersFromClientSide { // We reached the end of a parameterized run, clean up the cluster. TEST_UTIL.shutdownMiniCluster(); } - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); Configuration conf = TEST_UTIL.getConfiguration(); conf.setLong(HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY, 10 * 1024 * 1024); conf.setClass(HConstants.CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY, registryImpl, ConnectionRegistry.class); Preconditions.checkArgument(numHedgedReqs > 0); conf.setInt(MasterRegistry.MASTER_REGISTRY_HEDGED_REQS_FANOUT_KEY, numHedgedReqs); - StartMiniClusterOption.Builder builder = StartMiniClusterOption.builder(); + StartTestingClusterOption.Builder builder = StartTestingClusterOption.builder(); // Multiple masters needed only when hedged reads for master registry are enabled. builder.numMasters(numHedgedReqs > 1 ? 3 : 1).numRegionServers(3); TEST_UTIL.startMiniCluster(builder.build()); @@ -693,7 +693,7 @@ public class TestScannersFromClientSide { loc = locator.getRegionLocation(ROW); } RegionInfo hri = loc.getRegion(); - MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); byte[] regionName = hri.getRegionName(); int i = cluster.getServerWith(regionName); HRegionServer rs = cluster.getRegionServer(i); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide2.java index d973051c05b..cdd421f678b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide2.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -52,7 +52,7 @@ public class TestScannersFromClientSide2 { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScannersFromClientSide2.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("scan"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java index 7fc95523455..24a9c51aa65 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java @@ -24,11 +24,11 @@ import static org.junit.Assert.assertTrue; import java.io.File; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.master.HMaster; @@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory; @Category({ ClientTests.class, MediumTests.class }) public class TestSeparateClientZKCluster { private static final Logger LOG = LoggerFactory.getLogger(TestSeparateClientZKCluster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final File clientZkDir = new File(TEST_UTIL.getDataTestDir("TestSeparateClientZKCluster").toString()); private static final int ZK_SESSION_TIMEOUT = 5000; @@ -88,8 +88,8 @@ public class TestSeparateClientZKCluster { // reduce zk session timeout to easier trigger session expiration TEST_UTIL.getConfiguration().setInt(HConstants.ZK_SESSION_TIMEOUT, ZK_SESSION_TIMEOUT); // Start a cluster with 2 masters and 3 regionservers. - StartMiniClusterOption option = - StartMiniClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); TEST_UTIL.startMiniCluster(option); } @@ -128,7 +128,7 @@ public class TestSeparateClientZKCluster { Connection conn = TEST_UTIL.getConnection(); try (Admin admin = conn.getAdmin()) { LOG.debug("Tables: " + admin.listTableDescriptors()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); // switch active master HMaster master = cluster.getMaster(); master.stopMaster(); @@ -156,7 +156,7 @@ public class TestSeparateClientZKCluster { try (Admin admin = conn.getAdmin(); Table table = conn.getTable(tn); RegionLocator locator = conn.getRegionLocator(tn)) { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); ColumnFamilyDescriptorBuilder cfDescBuilder = ColumnFamilyDescriptorBuilder.newBuilder(family); TableDescriptorBuilder tableDescBuilder = @@ -221,7 +221,7 @@ public class TestSeparateClientZKCluster { clientZkCluster.shutdown(); // stop current meta server and confirm the server shutdown process // is not affected by client ZK crash - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); int metaServerId = cluster.getServerWithMeta(); HRegionServer metaServer = cluster.getRegionServer(metaServerId); metaServer.stop("Stop current RS holding meta region"); @@ -270,11 +270,11 @@ public class TestSeparateClientZKCluster { try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TableName.META_TABLE_NAME)) { assertEquals(1, locator.getAllRegionLocations().size()); - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, 3); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 3); - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 2); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, 2); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 2); - HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 1); + HBaseTestingUtil.setReplicas(admin, TableName.META_TABLE_NAME, 1); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 1); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerBusyException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerBusyException.java index 9e6f7026449..d14f20e46bc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerBusyException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerBusyException.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor; @@ -57,7 +57,7 @@ public class TestServerBusyException { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestServerBusyException.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAM_NAM = Bytes.toBytes("f"); private static final byte[] ROW = Bytes.toBytes("bbb"); private static final int RPC_RETRY = 5; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java index abf20dd0fdb..22e1b5c6215 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestServerLoadDurability.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.NettyRpcServer; import org.apache.hadoop.hbase.ipc.RpcServerFactory; @@ -84,7 +84,7 @@ public class TestServerLoadDurability { return conf; } - protected HBaseTestingUtility utility; + protected HBaseTestingUtil utility; protected Connection conn; protected Admin admin; @@ -94,7 +94,7 @@ public class TestServerLoadDurability { @Before public void setUp() throws Exception { - utility = new HBaseTestingUtility(conf); + utility = new HBaseTestingUtil(conf); utility.startMiniCluster(2); conn = ConnectionFactory.createConnection(utility.getConfiguration()); admin = conn.getAdmin(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java index 7e83b762568..3d23b9b9936 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSizeFailures.java @@ -24,7 +24,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Scan.ReadType; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -47,7 +47,7 @@ public class TestSizeFailures { HBaseClassTestRule.forClass(TestSizeFailures.class); private static final Logger LOG = LoggerFactory.getLogger(TestSizeFailures.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] FAMILY = Bytes.toBytes("testFamily"); protected static int SLAVES = 1; private static TableName TABLENAME; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java index 5b1b416f531..0e89db0c13c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotCloneIndependence.java @@ -23,7 +23,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -62,7 +62,7 @@ public class TestSnapshotCloneIndependence { @Rule public TestName testName = new TestName(); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final int NUM_RS = 2; private static final String TEST_FAM_STR = "fam"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java index 63bf72f1c7a..08e33ac78d0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -73,7 +73,7 @@ public class TestSnapshotFromClient { private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotFromClient.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final int NUM_RS = 2; protected static final String STRING_TABLE_NAME = "test"; protected static final byte[] TEST_FAM = Bytes.toBytes("fam"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java index 59054194cad..1b8bb2dab7a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotMetadata.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; @@ -61,7 +61,7 @@ public class TestSnapshotMetadata { private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotMetadata.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final int NUM_RS = 2; private static final String STRING_TABLE_NAME = "TestSnapshotMetadata"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java index 617ee30025a..21277460044 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java @@ -35,7 +35,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -91,7 +91,7 @@ public class TestSnapshotTemporaryDirectory { Paths.get("").toAbsolutePath().toString() + Path.SEPARATOR + UUID.randomUUID().toString(); protected static Admin admin; - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final String STRING_TABLE_NAME = "test"; protected static final byte[] TEST_FAM = Bytes.toBytes("fam"); protected static final TableName TABLE_NAME = TableName.valueOf(STRING_TABLE_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeAtTableLevel.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeAtTableLevel.java index 1efdcbc17dd..fc7b41bad83 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeAtTableLevel.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeAtTableLevel.java @@ -26,7 +26,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -48,7 +48,7 @@ public class TestSplitOrMergeAtTableLevel { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSplitOrMergeAtTableLevel.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte[] FAMILY = Bytes.toBytes("testFamily"); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java index 5b3d18d01bf..ce7e0392152 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.assignment.AssignmentTestingUtil; @@ -60,7 +60,7 @@ public class TestSplitOrMergeStatus { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSplitOrMergeStatus.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] FAMILY = Bytes.toBytes("testFamily"); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableFavoredNodes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableFavoredNodes.java index e1696294633..3ad1676278f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableFavoredNodes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableFavoredNodes.java @@ -33,7 +33,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.NamespaceDescriptor; @@ -75,7 +75,7 @@ public class TestTableFavoredNodes { private static final Logger LOG = LoggerFactory.getLogger(TestTableFavoredNodes.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static int WAIT_TIMEOUT = 60000; private final static int SLAVES = 8; private FavoredNodesManager fnm; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableOperationException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableOperationException.java index 2bb948e528d..c98782c0148 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableOperationException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableOperationException.java @@ -24,7 +24,7 @@ import java.util.Optional; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -48,7 +48,7 @@ public class TestTableOperationException { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestTableOperationException.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_DONOT_RETRY = TableName.valueOf("TableDoNotRetry"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java index 21d069f7fad..87f7b735bd8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java @@ -29,8 +29,8 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.cleaner.TimeToLiveHFileCleaner; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; @@ -65,7 +65,7 @@ public class TestTableSnapshotScanner { HBaseClassTestRule.forClass(TestTableSnapshotScanner.class); private static final Logger LOG = LoggerFactory.getLogger(TestTableSnapshotScanner.class); - private final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final int NUM_REGION_SERVERS = 2; private static final byte[][] FAMILIES = {Bytes.toBytes("f1"), Bytes.toBytes("f2")}; public static byte[] bbb = Bytes.toBytes("bbb"); @@ -77,7 +77,7 @@ public class TestTableSnapshotScanner { @Rule public TestName name = new TestName(); - public static void blockUntilSplitFinished(HBaseTestingUtility util, TableName tableName, + public static void blockUntilSplitFinished(HBaseTestingUtil util, TableName tableName, int expectedRegionSize) throws Exception { for (int i = 0; i < 100; i++) { List hRegionInfoList = util.getAdmin().getRegions(tableName); @@ -90,7 +90,7 @@ public class TestTableSnapshotScanner { public void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(NUM_REGION_SERVERS).numDataNodes(NUM_REGION_SERVERS) .createRootDir(true).build(); UTIL.startMiniCluster(option); @@ -111,7 +111,7 @@ public class TestTableSnapshotScanner { public void tearDown() throws Exception { } - public static void createTableAndSnapshot(HBaseTestingUtility util, TableName tableName, + public static void createTableAndSnapshot(HBaseTestingUtil util, TableName tableName, String snapshotName, int numRegions) throws Exception { try { @@ -289,7 +289,7 @@ public class TestTableSnapshotScanner { } } - private void testScanner(HBaseTestingUtility util, String snapshotName, int numRegions, + private void testScanner(HBaseTestingUtil util, String snapshotName, int numRegions, boolean shutdownCluster) throws Exception { setupCluster(); TableName tableName = TableName.valueOf("testScanner"); @@ -320,8 +320,8 @@ public class TestTableSnapshotScanner { private void verifyScanner(ResultScanner scanner, byte[] startRow, byte[] stopRow) throws IOException, InterruptedException { - HBaseTestingUtility.SeenRowTracker rowTracker = - new HBaseTestingUtility.SeenRowTracker(startRow, stopRow); + HBaseTestingUtil.SeenRowTracker rowTracker = + new HBaseTestingUtil.SeenRowTracker(startRow, stopRow); while (true) { Result result = scanner.next(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java index 2183ddaf6d1..06c2de4b4f0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java @@ -27,7 +27,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.TimestampsFilter; @@ -59,7 +59,7 @@ public class TestTimestampsFilter { HBaseClassTestRule.forClass(TestTimestampsFilter.class); private static final Logger LOG = LoggerFactory.getLogger(TestTimestampsFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestUpdateConfiguration.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestUpdateConfiguration.java index e8036fc4e9a..5703ae28b3a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestUpdateConfiguration.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestUpdateConfiguration.java @@ -22,9 +22,9 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -43,12 +43,12 @@ public class TestUpdateConfiguration extends AbstractTestUpdateConfiguration { HBaseClassTestRule.forClass(TestUpdateConfiguration.class); private static final Logger LOG = LoggerFactory.getLogger(TestUpdateConfiguration.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setup() throws Exception { setUpConfigurationFiles(TEST_UTIL); - StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(2).build(); TEST_UTIL.startMiniCluster(option); addResourceToRegionServerConfiguration(TEST_UTIL); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java index 82cf0f9bbc9..4894c52d158 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java @@ -30,7 +30,7 @@ import java.util.concurrent.ExecutionException; import java.util.stream.IntStream; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.RegionLocations; @@ -57,14 +57,14 @@ public class TestZKConnectionRegistry { HBaseClassTestRule.forClass(TestZKConnectionRegistry.class); static final Logger LOG = LoggerFactory.getLogger(TestZKConnectionRegistry.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static ZKConnectionRegistry REGISTRY; @BeforeClass public static void setUp() throws Exception { TEST_UTIL.startMiniCluster(3); - HBaseTestingUtility.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); + HBaseTestingUtil.setReplicas(TEST_UTIL.getAdmin(), TableName.META_TABLE_NAME, 3); REGISTRY = new ZKConnectionRegistry(TEST_UTIL.getConfiguration()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminForSyncReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminForSyncReplication.java index 58c3e7a6a92..572e3545682 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminForSyncReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminForSyncReplication.java @@ -27,7 +27,7 @@ import java.util.Map; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -54,8 +54,8 @@ public class TestReplicationAdminForSyncReplication { private static final Logger LOG = LoggerFactory.getLogger(TestReplicationAdminForSyncReplication.class); - private final static HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private static Admin hbaseAdmin; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java index 182dda5cdb9..4ff21d0843b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -53,7 +53,7 @@ public class TestConstraint { private static final Logger LOG = LoggerFactory.getLogger(TestConstraint.class); - private static HBaseTestingUtility util; + private static HBaseTestingUtil util; private static final TableName tableName = TableName.valueOf("test"); private static final byte[] dummy = Bytes.toBytes("dummy"); private static final byte[] row1 = Bytes.toBytes("r1"); @@ -61,7 +61,7 @@ public class TestConstraint { @BeforeClass public static void setUpBeforeClass() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); util.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); util.startMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAppendTimeRange.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAppendTimeRange.java index 8dfc774300a..2e40de3112c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAppendTimeRange.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestAppendTimeRange.java @@ -29,7 +29,7 @@ import java.util.NavigableMap; import java.util.Optional; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Append; import org.apache.hadoop.hbase.client.Get; @@ -62,7 +62,7 @@ public class TestAppendTimeRange { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility util = new HBaseTestingUtility(); + private static final HBaseTestingUtil util = new HBaseTestingUtil(); private static final ManualEnvironmentEdge mee = new ManualEnvironmentEdge(); private static final byte[] TEST_FAMILY = Bytes.toBytes("f1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java index a4cff74ab72..b1cc9975235 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.hbase.coprocessor; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam2; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam3; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam2; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam3; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.TableName; @@ -79,7 +79,7 @@ public class TestCoprocessorInterface { HBaseClassTestRule.forClass(TestCoprocessorInterface.class); @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static final Path DIR = TEST_UTIL.getDataTestDir(); private static class CustomScanner implements RegionScanner { @@ -342,7 +342,7 @@ public class TestCoprocessorInterface { // hence the old entry was indeed removed by the GC and new one has been created Object o3 = ((CoprocessorII)c2).getSharedData().get("test2"); assertFalse(o3 == o2); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -367,7 +367,7 @@ public class TestCoprocessorInterface { // this would throw an exception before HBASE-4197 scanner.next(new ArrayList<>()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); Coprocessor c = region.getCoprocessorHost().findCoprocessor(CoprocessorImpl.class); assertTrue("Coprocessor not started", ((CoprocessorImpl)c).wasStarted()); @@ -420,7 +420,7 @@ public class TestCoprocessorInterface { .setSplit(false) .build(); Path path = new Path(DIR + callingMethod); - HRegion r = HBaseTestingUtility.createRegionAndWAL(info, path, conf, builder.build()); + HRegion r = HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build()); // this following piece is a hack. RegionCoprocessorHost host = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java index 396d6ef450e..60aef8d539c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorMetrics.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -93,7 +93,7 @@ public class TestCoprocessorMetrics { HBaseClassTestRule.forClass(TestCoprocessorMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestCoprocessorMetrics.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] foo = Bytes.toBytes("foo"); private static final byte[] bar = Bytes.toBytes("bar"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorSharedConnection.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorSharedConnection.java index 40a3d65bbce..88c6e4df81c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorSharedConnection.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorSharedConnection.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.SharedConnection; import org.apache.hadoop.hbase.testclassification.CoprocessorTests; @@ -49,7 +49,7 @@ public class TestCoprocessorSharedConnection { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); /** * Start up a mini cluster with my three CPs loaded. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorStop.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorStop.java index 4517b254aaf..7cf3a38b727 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorStop.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorStop.java @@ -25,8 +25,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.testclassification.CoprocessorTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -50,7 +50,7 @@ public class TestCoprocessorStop { HBaseClassTestRule.forClass(TestCoprocessorStop.class); private static final Logger LOG = LoggerFactory.getLogger(TestCoprocessorStop.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String MASTER_FILE = "master" + EnvironmentEdgeManager.currentTime(); private static final String REGIONSERVER_FILE = "regionserver" + EnvironmentEdgeManager.currentTime(); @@ -113,7 +113,7 @@ public class TestCoprocessorStop { @Test public void testStopped() throws Exception { //shutdown hbase only. then check flag file. - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreMasterCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreMasterCoprocessor.java index e0975fac6a2..f274e397114 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreMasterCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreMasterCoprocessor.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.master.MasterCoprocessorHost; import org.apache.hadoop.hbase.master.MasterServices; import org.apache.hadoop.hbase.master.assignment.MockMasterServices; @@ -48,7 +48,7 @@ public class TestCoreMasterCoprocessor { HBaseClassTestRule.forClass(TestCoreMasterCoprocessor.class); @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private MasterServices ms; private MasterCoprocessorHost mch; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionCoprocessor.java index 6165e46223e..e467e8de272 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionCoprocessor.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MockRegionServerServices; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -58,7 +58,7 @@ public class TestCoreRegionCoprocessor { HBaseClassTestRule.forClass(TestCoreRegionCoprocessor.class); @Rule public TestName name = new TestName(); - HBaseTestingUtility HTU = new HBaseTestingUtility(); + HBaseTestingUtil HTU = new HBaseTestingUtil(); private HRegion region = null; private RegionServerServices rss; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionServerCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionServerCoprocessor.java index b530423297d..0f2dd1e4cb7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionServerCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoreRegionServerCoprocessor.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MockRegionServerServices; import org.apache.hadoop.hbase.regionserver.RegionServerCoprocessorHost; import org.apache.hadoop.hbase.regionserver.RegionServerServices; @@ -49,7 +49,7 @@ public class TestCoreRegionServerCoprocessor { HBaseClassTestRule.forClass(TestCoreRegionServerCoprocessor.class); @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private RegionServerServices rss; private RegionServerCoprocessorHost rsch; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementAndAppendWithNullResult.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementAndAppendWithNullResult.java index 239190ec80c..fa61cbe33e9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementAndAppendWithNullResult.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementAndAppendWithNullResult.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Append; @@ -54,7 +54,7 @@ public class TestIncrementAndAppendWithNullResult { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestIncrementAndAppendWithNullResult.class); - private static final HBaseTestingUtility util = new HBaseTestingUtility(); + private static final HBaseTestingUtil util = new HBaseTestingUtil(); private static final TableName TEST_TABLE = TableName.valueOf("test"); private static final byte[] TEST_FAMILY = Bytes.toBytes("f1"); private static final byte[] ROW_A = Bytes.toBytes("aaa"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementTimeRange.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementTimeRange.java index 1e822e4d216..99bf3fa0548 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementTimeRange.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementTimeRange.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.NavigableMap; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Increment; @@ -64,7 +64,7 @@ public class TestIncrementTimeRange { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestIncrementTimeRange.class); - private static final HBaseTestingUtility util = new HBaseTestingUtility(); + private static final HBaseTestingUtil util = new HBaseTestingUtil(); private static ManualEnvironmentEdge mee = new ManualEnvironmentEdge(); private static final TableName TEST_TABLE = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java index 2a4cf61c800..f2fdf932d76 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithAbort.java @@ -28,9 +28,9 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -79,8 +79,8 @@ public class TestMasterCoprocessorExceptionWithAbort { } public static class CreateTableThread extends Thread { - HBaseTestingUtility UTIL; - public CreateTableThread(HBaseTestingUtility UTIL) { + HBaseTestingUtil UTIL; + public CreateTableThread(HBaseTestingUtil UTIL) { this.UTIL = UTIL; } @@ -147,7 +147,7 @@ public class TestMasterCoprocessorExceptionWithAbort { } } - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static byte[] TEST_TABLE = Bytes.toBytes("observed_table"); private static byte[] TEST_FAMILY = Bytes.toBytes("fam1"); @@ -169,7 +169,7 @@ public class TestMasterCoprocessorExceptionWithAbort { @Test public void testExceptionFromCoprocessorWhenCreatingTable() throws IOException { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java index 5379bb397e9..42f129db018 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java @@ -27,8 +27,8 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -124,7 +124,7 @@ public class TestMasterCoprocessorExceptionWithRemove { } } - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static byte[] TEST_TABLE1 = Bytes.toBytes("observed_table1"); private static byte[] TEST_FAMILY1 = Bytes.toBytes("fam1"); @@ -149,7 +149,7 @@ public class TestMasterCoprocessorExceptionWithRemove { @Test public void testExceptionFromCoprocessorWhenCreatingTable() throws IOException { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java index d0188fe226b..c60c55f84ab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java @@ -31,11 +31,11 @@ import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -1272,7 +1272,7 @@ public class TestMasterObserver { } - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String TEST_SNAPSHOT = "observed_snapshot"; private static TableName TEST_CLONE = TableName.valueOf("observed_clone"); private static byte[] TEST_FAMILY = Bytes.toBytes("fam1"); @@ -1295,7 +1295,7 @@ public class TestMasterObserver { @Test public void testStarted() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); assertTrue("Master should be active", master.isActiveMaster()); @@ -1314,7 +1314,7 @@ public class TestMasterObserver { @Test public void testTableOperations() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); final TableName tableName = TableName.valueOf(name.getMethodName()); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1328,8 +1328,8 @@ public class TestMasterObserver { try(Connection connection = ConnectionFactory.createConnection(UTIL.getConfiguration()); Admin admin = connection.getAdmin()) { tableCreationLatch = new CountDownLatch(1); - admin.createTable(tableDescriptor, Arrays.copyOfRange(HBaseTestingUtility.KEYS, - 1, HBaseTestingUtility.KEYS.length)); + admin.createTable(tableDescriptor, Arrays.copyOfRange(HBaseTestingUtil.KEYS, + 1, HBaseTestingUtil.KEYS.length)); assertTrue("Test table should be created", cp.wasCreateTableCalled()); tableCreationLatch.await(); @@ -1446,7 +1446,7 @@ public class TestMasterObserver { @Test public void testSnapshotOperations() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); CPMasterObserver cp = host.findCoprocessor(CPMasterObserver.class); @@ -1506,7 +1506,7 @@ public class TestMasterObserver { @Test public void testNamespaceOperations() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); String testNamespace = "observed_ns"; HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1545,7 +1545,7 @@ public class TestMasterObserver { @Test public void testRegionTransitionOperations() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1633,7 +1633,7 @@ public class TestMasterObserver { @Test public void testTableDescriptorsEnumeration() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1650,7 +1650,7 @@ public class TestMasterObserver { @Test public void testTableNamesEnumeration() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1665,7 +1665,7 @@ public class TestMasterObserver { @Test public void testAbortProcedureOperation() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1680,7 +1680,7 @@ public class TestMasterObserver { @Test public void testGetProceduresOperation() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); @@ -1695,7 +1695,7 @@ public class TestMasterObserver { @Test public void testGetLocksOperation() throws Exception { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); MasterCoprocessorHost host = master.getMasterCoprocessorHost(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserverToModifyTableSchema.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserverToModifyTableSchema.java index d23a4a8cd50..49283786b52 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserverToModifyTableSchema.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserverToModifyTableSchema.java @@ -24,7 +24,7 @@ import java.util.Optional; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -49,7 +49,7 @@ public class TestMasterObserverToModifyTableSchema { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterObserverToModifyTableSchema.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLENAME = TableName.valueOf("TestTable"); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java index 33f1599cacf..8391d80fff8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java @@ -43,7 +43,7 @@ import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.JMXListener; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -74,7 +74,7 @@ public class TestMetaTableMetrics { HBaseClassTestRule.forClass(TestMetaTableMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestMetaTableMetrics.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME1 = TableName.valueOf("TestExampleMetaTableMetricsOne"); private static final byte[] FAMILY = Bytes.toBytes("f"); private static final byte[] QUALIFIER = Bytes.toBytes("q"); @@ -104,7 +104,7 @@ public class TestMetaTableMetrics { do { int sign = i % 2 == 0 ? 1 : -1; connectorPort += sign * rand.nextInt(100); - } while (!HBaseTestingUtility.available(connectorPort)); + } while (!HBaseTestingUtil.available(connectorPort)); try { conf.setInt("regionserver.rmi.registry.port", connectorPort); UTIL.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestNegativeMemStoreSizeWithSlowCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestNegativeMemStoreSizeWithSlowCoprocessor.java index eb7c5fb3a10..11da101d706 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestNegativeMemStoreSizeWithSlowCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestNegativeMemStoreSizeWithSlowCoprocessor.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.coprocessor; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; @@ -54,7 +54,7 @@ public class TestNegativeMemStoreSizeWithSlowCoprocessor { static final Logger LOG = LoggerFactory.getLogger(TestNegativeMemStoreSizeWithSlowCoprocessor.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] tableName = Bytes.toBytes("test_table"); private static final byte[] family = Bytes.toBytes("f"); private static final byte[] qualifier = Bytes.toBytes("q"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java index 85b852ed60e..89c38d2a75c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java @@ -28,7 +28,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -131,7 +131,7 @@ public class TestOpenTableInCoprocessor { } } - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupCluster() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java index 69b9132d642..8a446cb34ba 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPassCustomCellViaRegionObserver.java @@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.TableName; @@ -75,7 +75,7 @@ public class TestPassCustomCellViaRegionObserver { private TableName tableName; private Table table = null; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] ROW = Bytes.toBytes("ROW"); private static final byte[] FAMILY = Bytes.toBytes("FAMILY"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java index f1e206b09b2..2975d711d32 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java @@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Tag; @@ -86,7 +86,7 @@ public class TestPostIncrementAndAppendBeforeWAL { private static final Logger LOG = LoggerFactory.getLogger(TestFromClientSide.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Connection connection; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java index 714dfc4f2e5..fd1caed4e4b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverBypass.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Delete; @@ -59,7 +59,7 @@ public class TestRegionObserverBypass { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionObserverBypass.class); - private static HBaseTestingUtility util; + private static HBaseTestingUtil util; private static final TableName tableName = TableName.valueOf("test"); private static final byte[] dummy = Bytes.toBytes("dummy"); private static final byte[] row1 = Bytes.toBytes("r1"); @@ -75,7 +75,7 @@ public class TestRegionObserverBypass { new String [] {TestCoprocessor.class.getName(), TestCoprocessor2.class.getName(), TestCoprocessor3.class.getName()}); - util = new HBaseTestingUtility(conf); + util = new HBaseTestingUtil(conf); util.startMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverForAddingMutationsFromCoprocessors.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverForAddingMutationsFromCoprocessors.java index 15954f87279..3bc6f97bb55 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverForAddingMutationsFromCoprocessors.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverForAddingMutationsFromCoprocessors.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Delete; @@ -69,7 +69,7 @@ public class TestRegionObserverForAddingMutationsFromCoprocessors { private static final Logger LOG = LoggerFactory.getLogger(TestRegionObserverForAddingMutationsFromCoprocessors.class); - private static HBaseTestingUtility util; + private static HBaseTestingUtil util; private static final byte[] dummy = Bytes.toBytes("dummy"); private static final byte[] row1 = Bytes.toBytes("r1"); private static final byte[] row2 = Bytes.toBytes("r2"); @@ -84,7 +84,7 @@ public class TestRegionObserverForAddingMutationsFromCoprocessors { public static void setUpBeforeClass() throws Exception { Configuration conf = HBaseConfiguration.create(); conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, TestWALObserver.class.getName()); - util = new HBaseTestingUtility(conf); + util = new HBaseTestingUtil(conf); util.startMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java index 91da8a25354..27eee9f3c65 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java @@ -36,10 +36,10 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Append; @@ -117,8 +117,8 @@ public class TestRegionObserverInterface { public final static byte[] C = Bytes.toBytes("c"); public final static byte[] ROW = Bytes.toBytes("testrow"); - private static HBaseTestingUtility util = new HBaseTestingUtility(); - private static MiniHBaseCluster cluster = null; + private static HBaseTestingUtil util = new HBaseTestingUtil(); + private static SingleProcessHBaseCluster cluster = null; @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java index 5b335578ed2..a9d6576e8ff 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverScannerOpenHook.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -83,7 +83,7 @@ public class TestRegionObserverScannerOpenHook { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionObserverScannerOpenHook.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); static final Path DIR = UTIL.getDataTestDir(); @Rule @@ -196,7 +196,7 @@ public class TestRegionObserverScannerOpenHook { 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); Path path = new Path(DIR + callingMethod); - WAL wal = HBaseTestingUtility.createWal(conf, path, info); + WAL wal = HBaseTestingUtil.createWal(conf, path, info); HRegion r = HRegion.createHRegion(info, path, conf, tableDescriptor, wal); // this following piece is a hack. currently a coprocessorHost // is secretly loaded at OpenRegionHandler. we don't really @@ -215,7 +215,7 @@ public class TestRegionObserverScannerOpenHook { byte[][] FAMILIES = new byte[][] { A }; // Use new HTU to not overlap with the DFS cluster started in #CompactionStacking - Configuration conf = new HBaseTestingUtility().getConfiguration(); + Configuration conf = new HBaseTestingUtil().getConfiguration(); HRegion region = initHRegion(TABLE, getClass().getName(), conf, FAMILIES); RegionCoprocessorHost h = region.getCoprocessorHost(); h.load(NoDataFromScan.class, Coprocessor.PRIORITY_HIGHEST, conf); @@ -230,7 +230,7 @@ public class TestRegionObserverScannerOpenHook { assertNull( "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: " + r, r.listCells()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -241,7 +241,7 @@ public class TestRegionObserverScannerOpenHook { byte[][] FAMILIES = new byte[][] { A }; // Use new HTU to not overlap with the DFS cluster started in #CompactionStacking - Configuration conf = new HBaseTestingUtility().getConfiguration(); + Configuration conf = new HBaseTestingUtil().getConfiguration(); HRegion region = initHRegion(TABLE, getClass().getName(), conf, FAMILIES); RegionCoprocessorHost h = region.getCoprocessorHost(); h.load(NoDataFromFlush.class, Coprocessor.PRIORITY_HIGHEST, conf); @@ -257,7 +257,7 @@ public class TestRegionObserverScannerOpenHook { assertNull( "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: " + r, r.listCells()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /* diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java index 4938e7d4938..732c52b9003 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Durability; @@ -54,8 +54,8 @@ public class TestRegionObserverStacking extends TestCase { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionObserverStacking.class); - private static HBaseTestingUtility TEST_UTIL - = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL + = new HBaseTestingUtil(); static final Path DIR = TEST_UTIL.getDataTestDir(); public static class ObserverA implements RegionCoprocessor, RegionObserver { @@ -133,7 +133,7 @@ public class TestRegionObserverStacking extends TestCase { 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); Path path = new Path(DIR + callingMethod); - HRegion r = HBaseTestingUtility.createRegionAndWAL(info, path, conf, tableDescriptor); + HRegion r = HBaseTestingUtil.createRegionAndWAL(info, path, conf, tableDescriptor); // this following piece is a hack. currently a coprocessorHost // is secretly loaded at OpenRegionHandler. we don't really // start a region server here, so just manually create cphost @@ -171,6 +171,6 @@ public class TestRegionObserverStacking extends TestCase { assertTrue(idA < idB); assertTrue(idB < idC); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java index 8309f471570..292c4d31be2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java @@ -23,9 +23,9 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; import org.apache.hadoop.hbase.client.Durability; @@ -58,7 +58,7 @@ public class TestRegionServerCoprocessorExceptionWithAbort { private static final Logger LOG = LoggerFactory.getLogger( TestRegionServerCoprocessorExceptionWithAbort.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("observed_table"); @Test @@ -69,7 +69,7 @@ public class TestRegionServerCoprocessorExceptionWithAbort { conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); TEST_UTIL.startMiniCluster(2); try { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); // Trigger one regionserver to fail as if it came up with a coprocessor // that fails during initialization final HRegionServer regionServer = cluster.getRegionServer(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java index 2d564b67136..8c3e4ab8aaf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java @@ -24,7 +24,7 @@ import static org.junit.Assert.fail; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -70,7 +70,7 @@ public class TestRegionServerCoprocessorExceptionWithRemove { } } - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java index 4ab00ad7515..d1a7937d66b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -89,7 +89,7 @@ public class TestWALObserver { HBaseClassTestRule.forClass(TestWALObserver.class); private static final Logger LOG = LoggerFactory.getLogger(TestWALObserver.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte[] TEST_TABLE = Bytes.toBytes("observedTable"); private static byte[][] TEST_FAMILY = { Bytes.toBytes("fam1"), @@ -342,7 +342,7 @@ public class TestWALObserver { // sync to fs. wal.sync(); - User user = HBaseTestingUtility.getDifferentUser(newConf, + User user = HBaseTestingUtil.getDifferentUser(newConf, ".replay.wal.secondtime"); user.runAs(new PrivilegedExceptionAction() { @Override diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java index 88ecb196525..c9bd4e4845f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/FilterTestingCluster.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.TableName; @@ -51,7 +51,7 @@ import org.junit.experimental.categories.Category; */ @Category({FilterTests.class, MediumTests.class}) public class FilterTestingCluster { - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Admin admin = null; private static List createdTables = new ArrayList<>(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java index fd7de4c8b03..f2f6e2e9f18 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnPrefixFilter.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.TableName; @@ -59,8 +59,8 @@ public class TestColumnPrefixFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestColumnPrefixFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new - HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new + HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -78,7 +78,7 @@ public class TestColumnPrefixFilter { tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor); TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); try { List rows = generateRandomWords(100, "row"); @@ -128,10 +128,10 @@ public class TestColumnPrefixFilter { assertEquals(prefixMap.get(s).size(), results.size()); } } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -147,7 +147,7 @@ public class TestColumnPrefixFilter { tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor); TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); try { List rows = generateRandomWords(100, "row"); @@ -200,10 +200,10 @@ public class TestColumnPrefixFilter { assertEquals(prefixMap.get(s).size(), results.size()); } } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } List generateRandomWords(int numberOfWords, String suffix) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java index 1041969089a..23b9bd6e1d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java @@ -30,7 +30,7 @@ import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.TableName; @@ -152,7 +152,7 @@ public class TestColumnRangeFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestColumnRangeFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestColumnRangeFilter.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java index 0dbe6d28ee6..4c97a1143a5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java @@ -29,7 +29,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -77,7 +77,7 @@ public class TestDependentColumnFilter { Bytes.toBytes("bad1"), Bytes.toBytes("bad2"), Bytes.toBytes("bad3") }; private static final byte[] MATCH_VAL = Bytes.toBytes("match"); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); List testVals; private HRegion region; @@ -94,14 +94,14 @@ public class TestDependentColumnFilter { ColumnFamilyDescriptorBuilder.newBuilder(FAMILIES[1]).setMaxVersions(3).build()) .build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - this.region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + this.region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); addData(); } @After public void tearDown() throws Exception { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } private void addData() throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java index 816524cef8b..b4d9577ee1a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -77,7 +77,7 @@ public class TestFilter { private final static Logger LOG = LoggerFactory.getLogger(TestFilter.class); private HRegion region; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -161,7 +161,7 @@ public class TestFilter { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(NEW_FAMILIES[0])) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(NEW_FAMILIES[1])).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - this.region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + this.region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); // Insert first half @@ -236,7 +236,7 @@ public class TestFilter { @After public void tearDown() throws Exception { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -1516,7 +1516,7 @@ public class TestFilter { TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName())) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion testRegion = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + HRegion testRegion = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); for(int i=0; i<5; i++) { @@ -2287,7 +2287,7 @@ public class TestFilter { TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName())) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILIES[0])).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion testRegion = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + HRegion testRegion = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); for(int i=0; i<10; i++) { Put p = new Put(Bytes.toBytes("row" + i)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterFromRegionSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterFromRegionSide.java index ac06289a668..75c3e591604 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterFromRegionSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterFromRegionSide.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -57,7 +57,7 @@ public class TestFilterFromRegionSide { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFilterFromRegionSide.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static HRegion REGION; private static TableName TABLE_NAME = TableName.valueOf("TestFilterFromRegionSide"); @@ -91,7 +91,7 @@ public class TestFilterFromRegionSide { } TableDescriptor tableDescriptor = builder.build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - REGION = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + REGION = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); for (Put put : createPuts(ROWS, FAMILIES, QUALIFIERS, VALUE)) { REGION.put(put); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOnMini.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOnMini.java index 6b6428c3f38..5677d44f8ab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOnMini.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOnMini.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.filter; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; @@ -53,7 +53,7 @@ public class TestFilterListOnMini { HBaseClassTestRule.forClass(TestFilterListOnMini.class); private static final Logger LOG = LoggerFactory.getLogger(TestFilterListOnMini.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOrOperatorWithBlkCnt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOrOperatorWithBlkCnt.java index 72edac66dc9..5fdc5027607 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOrOperatorWithBlkCnt.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterListOrOperatorWithBlkCnt.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -57,7 +57,7 @@ public class TestFilterListOrOperatorWithBlkCnt { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFilterListOrOperatorWithBlkCnt.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestFilterListOrOperatorWithBlkCnt.class); private byte[] family = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java index bd9e83c35c9..db753c04ee6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.TableName; @@ -71,7 +71,7 @@ public class TestFilterWrapper { private static final Logger LOG = LoggerFactory.getLogger(TestFilterWrapper.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = null; private static Admin admin = null; private static TableName name = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFiltersWithBinaryComponentComparator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFiltersWithBinaryComponentComparator.java index 91b7daec42b..5dec5961fc8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFiltersWithBinaryComponentComparator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFiltersWithBinaryComponentComparator.java @@ -29,7 +29,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; @@ -60,7 +60,7 @@ public class TestFiltersWithBinaryComponentComparator { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFiltersWithBinaryComponentComparator.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestFiltersWithBinaryComponentComparator.class); private byte[] family = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java index 0fa94436b9f..8560b09b3d1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowAndColumnRangeFilter.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -62,7 +62,7 @@ public class TestFuzzyRowAndColumnRangeFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFuzzyRowAndColumnRangeFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestFuzzyRowAndColumnRangeFilter.class); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilterEndToEnd.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilterEndToEnd.java index 3548487fd25..da7dd8b3c16 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilterEndToEnd.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFuzzyRowFilterEndToEnd.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; @@ -67,7 +67,7 @@ public class TestFuzzyRowFilterEndToEnd { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFuzzyRowFilterEndToEnd.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte fuzzyValue = (byte) 63; private static final Logger LOG = LoggerFactory.getLogger(TestFuzzyRowFilterEndToEnd.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestInvocationRecordFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestInvocationRecordFilter.java index 1a4296ceb6f..f91332cdd16 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestInvocationRecordFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestInvocationRecordFilter.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -64,7 +64,7 @@ public class TestInvocationRecordFilter { private static final String QUALIFIER_PREFIX = "qualifier"; private static final String VALUE_PREFIX = "value"; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private HRegion region; @Before @@ -72,7 +72,7 @@ public class TestInvocationRecordFilter { TableDescriptor htd = TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE_NAME_BYTES)) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY_NAME_BYTES)).build(); RegionInfo info = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); - this.region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), + this.region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), htd); Put put = new Put(ROW_BYTES); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultiRowRangeFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultiRowRangeFilter.java index 6f915fcf105..f765437feb1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultiRowRangeFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultiRowRangeFilter.java @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.TableName; @@ -55,7 +55,7 @@ public class TestMultiRowRangeFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMultiRowRangeFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestMultiRowRangeFilter.class); private byte[] family = Bytes.toBytes("family"); private byte[] qf = Bytes.toBytes("qf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java index 7bf50628332..b5567e49a5c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestMultipleColumnPrefixFilter.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.TableName; @@ -59,8 +59,8 @@ public class TestMultipleColumnPrefixFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMultipleColumnPrefixFilter.class); - private final static HBaseTestingUtility TEST_UTIL = new - HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new + HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -79,7 +79,7 @@ public class TestMultipleColumnPrefixFilter { TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); // HRegionInfo info = new HRegionInfo(htd, null, null, false); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL. + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL. getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); List rows = generateRandomWords(100, "row"); @@ -130,7 +130,7 @@ public class TestMultipleColumnPrefixFilter { ; assertEquals(prefixMap.get("p").size() + prefixMap.get("q").size(), results.size()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -152,7 +152,7 @@ public class TestMultipleColumnPrefixFilter { tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor); TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL. + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL. getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); List rows = generateRandomWords(100, "row"); @@ -208,7 +208,7 @@ public class TestMultipleColumnPrefixFilter { ; assertEquals(prefixMap.get("p").size() + prefixMap.get("q").size(), results.size()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -221,7 +221,7 @@ public class TestMultipleColumnPrefixFilter { tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor); TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL. + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL. getDataTestDir(), TEST_UTIL.getConfiguration(), tableDescriptor); List rows = generateRandomWords(100, "row"); @@ -269,7 +269,7 @@ public class TestMultipleColumnPrefixFilter { assertEquals(results1.size(), results2.size()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } List generateRandomWords(int numberOfWords, String suffix) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestQualifierFilterWithEmptyQualifier.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestQualifierFilterWithEmptyQualifier.java index c1a3da6f357..9afc91f3f6f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestQualifierFilterWithEmptyQualifier.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestQualifierFilterWithEmptyQualifier.java @@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -64,7 +64,7 @@ public class TestQualifierFilterWithEmptyQualifier { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestQualifierFilterWithEmptyQualifier.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private HRegion region; @Rule @@ -85,7 +85,7 @@ public class TestQualifierFilterWithEmptyQualifier { .newBuilder(TableName.valueOf("TestQualifierFilter")) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(FAMILY).build()).build(); RegionInfo info = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); - this.region = HBaseTestingUtility + this.region = HBaseTestingUtil .createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), TEST_UTIL.getConfiguration(), htd); // Insert data @@ -104,7 +104,7 @@ public class TestQualifierFilterWithEmptyQualifier { @After public void tearDown() throws Exception { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java index 58c901161a9..8095da17818 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -69,7 +69,7 @@ public class TestBlockReorder { private Configuration conf; private MiniDFSCluster cluster; - private HBaseTestingUtility htu; + private HBaseTestingUtil htu; private DistributedFileSystem dfs; private static final String host1 = "host1"; private static final String host2 = "host2"; @@ -80,7 +80,7 @@ public class TestBlockReorder { @Before public void setUp() throws Exception { - htu = new HBaseTestingUtility(); + htu = new HBaseTestingUtil(); htu.getConfiguration().setInt("dfs.blocksize", 1024);// For the test with multiple blocks htu.getConfiguration().setInt("dfs.replication", 3); htu.startMiniDFSCluster(3, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderBlockLocation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderBlockLocation.java index ead8dcb7ab9..c38b9970591 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderBlockLocation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderBlockLocation.java @@ -23,9 +23,9 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -61,7 +61,7 @@ public class TestBlockReorderBlockLocation { private Configuration conf; private MiniDFSCluster cluster; - private HBaseTestingUtility htu; + private HBaseTestingUtil htu; private DistributedFileSystem dfs; private static final String host1 = "host1"; private static final String host2 = "host2"; @@ -72,7 +72,7 @@ public class TestBlockReorderBlockLocation { @Before public void setUp() throws Exception { - htu = new HBaseTestingUtility(); + htu = new HBaseTestingUtil(); htu.getConfiguration().setInt("dfs.blocksize", 1024);// For the test with multiple blocks htu.getConfiguration().setInt("dfs.replication", 3); htu.startMiniDFSCluster(3, @@ -102,7 +102,7 @@ public class TestBlockReorderBlockLocation { public void testBlockLocation() throws Exception { // We need to start HBase to get HConstants.HBASE_DIR set in conf htu.startMiniZKCluster(); - MiniHBaseCluster hbm = htu.startMiniHBaseCluster(); + SingleProcessHBaseCluster hbm = htu.startMiniHBaseCluster(); conf = hbm.getConfiguration(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderMultiBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderMultiBlocks.java index a6ff853f63e..3ff71352b0f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderMultiBlocks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderMultiBlocks.java @@ -28,9 +28,9 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -81,7 +81,7 @@ public class TestBlockReorderMultiBlocks { private Configuration conf; private MiniDFSCluster cluster; - private HBaseTestingUtility htu; + private HBaseTestingUtil htu; private DistributedFileSystem dfs; private static final String host1 = "host1"; private static final String host2 = "host2"; @@ -92,7 +92,7 @@ public class TestBlockReorderMultiBlocks { @Before public void setUp() throws Exception { - htu = new HBaseTestingUtility(); + htu = new HBaseTestingUtil(); htu.getConfiguration().setInt("dfs.blocksize", 1024);// For the test with multiple blocks htu.getConfiguration().setInt("dfs.replication", 3); htu.startMiniDFSCluster(3, @@ -116,7 +116,7 @@ public class TestBlockReorderMultiBlocks { byte[] sb = Bytes.toBytes("sb"); htu.startMiniZKCluster(); - MiniHBaseCluster hbm = htu.startMiniHBaseCluster(); + SingleProcessHBaseCluster hbm = htu.startMiniHBaseCluster(); hbm.waitForActiveAndReadyMaster(); HRegionServer targetRs = hbm.getRegionServer(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestInfoServersACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestInfoServersACL.java index 4016e7bd47c..07b2e64f3a4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestInfoServersACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestInfoServersACL.java @@ -30,7 +30,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.TableName; @@ -82,7 +82,7 @@ public class TestInfoServersACL { HBaseClassTestRule.forClass(TestInfoServersACL.class); private static final Logger LOG = LoggerFactory.getLogger(TestInfoServersACL.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Configuration conf; protected static String USERNAME; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java index 879606807c8..1836960d0ea 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.IOTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.FSUtils; @@ -94,7 +94,7 @@ public class TestFileLink { */ @Test public void testHDFSLinkReadDuringRename() throws Exception { - HBaseTestingUtility testUtil = new HBaseTestingUtility(); + HBaseTestingUtil testUtil = new HBaseTestingUtil(); Configuration conf = testUtil.getConfiguration(); conf.setInt("dfs.blocksize", 1024 * 1024); conf.setInt("dfs.client.read.prefetch.size", 2 * 1024 * 1024); @@ -126,7 +126,7 @@ public class TestFileLink { } @Test(expected = FileNotFoundException.class) public void testLinkReadWithMissingFile() throws Exception { - HBaseTestingUtility testUtil = new HBaseTestingUtility(); + HBaseTestingUtil testUtil = new HBaseTestingUtil(); FileSystem fs = new MyDistributedFileSystem(); Path originalPath = new Path(testUtil.getDefaultRootDirPath(), "test.file"); @@ -146,7 +146,7 @@ public class TestFileLink { */ @Test public void testLocalLinkReadDuringRename() throws IOException { - HBaseTestingUtility testUtil = new HBaseTestingUtility(); + HBaseTestingUtil testUtil = new HBaseTestingUtil(); FileSystem fs = testUtil.getTestFileSystem(); assertEquals("file", fs.getUri().getScheme()); testLinkReadDuringRename(fs, testUtil.getDataTestDir()); @@ -218,7 +218,7 @@ public class TestFileLink { */ @Test public void testHDFSLinkReadDuringDelete() throws Exception { - HBaseTestingUtility testUtil = new HBaseTestingUtility(); + HBaseTestingUtil testUtil = new HBaseTestingUtil(); Configuration conf = testUtil.getConfiguration(); conf.setInt("dfs.blocksize", 1024 * 1024); conf.setInt("dfs.client.read.prefetch.size", 2 * 1024 * 1024); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java index cc781b822ce..e27e2bf7ff6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.io.hfile.CacheConfig; @@ -59,11 +59,11 @@ public class TestHalfStoreFileReader { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHalfStoreFileReader.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java index d929472feaa..1b1014fb6c6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestChangingEncoding.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -73,7 +73,7 @@ public class TestChangingEncoding { private static final int NUM_ROWS_PER_BATCH = 100; private static final int NUM_COLS_PER_ROW = 20; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Configuration conf = TEST_UTIL.getConfiguration(); private static final int TIMEOUT_MS = 600000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java index 3f21f0c2fda..4cb48696ed3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; @@ -91,7 +91,7 @@ public class TestDataBlockEncoders { @Parameters public static Collection parameters() { - return HBaseTestingUtility.memStoreTSTagsAndOffheapCombination(); + return HBaseTestingUtil.memStoreTSTagsAndOffheapCombination(); } public TestDataBlockEncoders(boolean includesMemstoreTS, boolean includesTag, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestEncodedSeekers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestEncodedSeekers.java index 0c403431d3b..59616959d1e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestEncodedSeekers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestEncodedSeekers.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -79,7 +79,7 @@ public class TestEncodedSeekers { private static final int NUM_HFILES = 4; private static final int NUM_ROWS_PER_FLUSH = NUM_ROWS / NUM_HFILES; - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private final DataBlockEncoding encoding; private final boolean includeTags; private final boolean compressTags; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekBeforeWithReverseScan.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekBeforeWithReverseScan.java index 0e7218f9ed1..fd4f5142666 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekBeforeWithReverseScan.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekBeforeWithReverseScan.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -54,7 +54,7 @@ public class TestSeekBeforeWithReverseScan { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSeekBeforeWithReverseScan.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private HRegion region; @@ -69,13 +69,13 @@ public class TestSeekBeforeWithReverseScan { .newBuilder(cfName).setDataBlockEncoding(DataBlockEncoding.FAST_DIFF).build()).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableName).build(); Path path = testUtil.getDataTestDir(getClass().getSimpleName()); - region = HBaseTestingUtility.createRegionAndWAL(info, path, testUtil.getConfiguration(), + region = HBaseTestingUtil.createRegionAndWAL(info, path, testUtil.getConfiguration(), tableDescriptor); } @After public void tearDown() throws Exception { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); testUtil.cleanupTestDir(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekToBlockWithEncoders.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekToBlockWithEncoders.java index d9f22bc245e..44dfc35e235 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekToBlockWithEncoders.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestSeekToBlockWithEncoders.java @@ -26,7 +26,7 @@ import java.util.Collection; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -57,7 +57,7 @@ public class TestSeekToBlockWithEncoders { @Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } public TestSeekToBlockWithEncoders(boolean useOffheapData) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockIOUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockIOUtils.java index a386f49cc78..538dc488db2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockIOUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestBlockIOUtils.java @@ -34,7 +34,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.io.util.BlockIOUtils; import org.apache.hadoop.hbase.nio.ByteBuff; import org.apache.hadoop.hbase.nio.MultiByteBuff; @@ -58,7 +58,7 @@ public class TestBlockIOUtils { @Rule public ExpectedException exception = ExpectedException.none(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Test public void testIsByteBufferReadable() throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheConfig.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheConfig.java index ca39dfe88fd..65fc3afd9e6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheConfig.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheConfig.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -278,7 +278,7 @@ public class TestCacheConfig { @Test public void testFileBucketCacheConfig() throws IOException { - HBaseTestingUtility htu = new HBaseTestingUtility(this.conf); + HBaseTestingUtil htu = new HBaseTestingUtil(this.conf); try { Path p = new Path(htu.getDataTestDir(), "bc.txt"); FileSystem fs = FileSystem.get(this.conf); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java index 8839bcaf830..9d376d5e3a4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java @@ -38,8 +38,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -90,7 +90,7 @@ public class TestCacheOnWrite { private static final Logger LOG = LoggerFactory.getLogger(TestCacheOnWrite.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf; private CacheConfig cacheConf; private FileSystem fs; @@ -206,7 +206,7 @@ public class TestCacheOnWrite { List params = new ArrayList<>(); for (BlockCache blockCache : getBlockCaches()) { for (CacheOnWriteType cowType : CacheOnWriteType.values()) { - for (Compression.Algorithm compress : HBaseCommonTestingUtility.COMPRESSION_ALGORITHMS) { + for (Compression.Algorithm compress : HBaseCommonTestingUtil.COMPRESSION_ALGORITHMS) { for (boolean cacheCompressedData : new boolean[] { false, true }) { params.add(new Object[] { cowType, compress, cacheCompressedData, blockCache }); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java index 85f74c90614..9df4149a80f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.ByteBuffAllocator; @@ -69,8 +69,8 @@ public class TestChecksum { static final int[] BYTES_PER_CHECKSUM = { 50, 500, 688, 16*1024, (16*1024+980), 64 * 1024}; - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private FileSystem fs; private HFileSystem hfs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCombinedBlockCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCombinedBlockCache.java index a086a3bda2e..639c906413e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCombinedBlockCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCombinedBlockCache.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.io.hfile.CombinedBlockCache.CombinedCacheStats; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Assert; @@ -38,7 +38,7 @@ public class TestCombinedBlockCache { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCombinedBlockCache.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Test public void testCombinedCacheStats() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java index 6382a0d7470..4a385c143af 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java @@ -37,7 +37,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.MetaCellComparator; import org.apache.hadoop.hbase.shaded.protobuf.generated.HFileProtos; @@ -73,7 +73,7 @@ public class TestFixedFileTrailer { */ private static final int[] NUM_FIELDS_BY_VERSION = new int[] { 14, 15 }; - private HBaseTestingUtility util = new HBaseTestingUtility(); + private HBaseTestingUtil util = new HBaseTestingUtil(); private FileSystem fs; private ByteArrayOutputStream baos = new ByteArrayOutputStream(); private int version; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java index 6023991ae9d..5074bbaa081 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collection; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Get; @@ -61,7 +61,7 @@ public class TestForceCacheImportantBlocks { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestForceCacheImportantBlocks.class); - private final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String TABLE = "myTable"; private static final String CF = "myCF"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java index e58f08c76e8..9728fb4d5c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java @@ -55,9 +55,9 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; @@ -104,7 +104,7 @@ public class TestHFile { private static final Logger LOG = LoggerFactory.getLogger(TestHFile.class); private static final int NUM_VALID_KEY_TYPES = KeyValue.Type.values().length - 2; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static String ROOT_DIR = TEST_UTIL.getDataTestDir("TestHFile").toString(); private final int minBlockSize = 512; @@ -633,7 +633,7 @@ public class TestHFile { @Test public void testNullMetaBlocks() throws Exception { for (Compression.Algorithm compressAlgo : - HBaseCommonTestingUtility.COMPRESSION_ALGORITHMS) { + HBaseCommonTestingUtil.COMPRESSION_ALGORITHMS) { Path mFile = new Path(ROOT_DIR, "nometa_" + compressAlgo + ".hfile"); FSDataOutputStream fout = createFSOutput(mFile); HFileContext meta = new HFileContextBuilder().withCompression(compressAlgo) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java index d7294bf0d81..3bbe17d51fd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java @@ -52,7 +52,7 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -110,7 +110,7 @@ public class TestHFileBlock { private static int FIELD_LENGTH = 10; private static float CHANCE_TO_REPEAT = 0.6f; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private FileSystem fs; private final boolean includesMemstoreTS; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java index 6caad7331d6..a66b1a3b49a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockIndex.java @@ -42,8 +42,8 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -82,7 +82,7 @@ public class TestHFileBlockIndex { @Parameters public static Collection compressionAlgorithms() { - return HBaseCommonTestingUtility.COMPRESSION_ALGORITHMS_PARAMETERIZED; + return HBaseCommonTestingUtil.COMPRESSION_ALGORITHMS_PARAMETERIZED; } public TestHFileBlockIndex(Compression.Algorithm compr) { @@ -92,8 +92,8 @@ public class TestHFileBlockIndex { private static final Logger LOG = LoggerFactory.getLogger(TestHFileBlockIndex.class); private static final int NUM_DATA_BLOCKS = 1000; - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private static final int SMALL_BLOCK_SIZE = 4096; private static final int NUM_KV = 10000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileEncryption.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileEncryption.java index 0ca808b6a67..77dd1d2173d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileEncryption.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileEncryption.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -65,7 +65,7 @@ public class TestHFileEncryption { HBaseClassTestRule.forClass(TestHFileEncryption.class); private static final Logger LOG = LoggerFactory.getLogger(TestHFileEncryption.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final SecureRandom RNG = new SecureRandom(); private static FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileInlineToRootChunkConversion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileInlineToRootChunkConversion.java index 315f36fb17a..4f9416fd84d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileInlineToRootChunkConversion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileInlineToRootChunkConversion.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.testclassification.IOTests; @@ -53,7 +53,7 @@ public class TestHFileInlineToRootChunkConversion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHFileInlineToRootChunkConversion.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private final Configuration conf = testUtil.getConfiguration(); @Test diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFilePrettyPrinter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFilePrettyPrinter.java index c7ac97aa94f..7b5b7e21766 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFilePrettyPrinter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFilePrettyPrinter.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.regionserver.TestHRegionServerBulkLoad; import org.apache.hadoop.hbase.testclassification.IOTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -50,7 +50,7 @@ public class TestHFilePrettyPrinter { private static final Logger LOG = LoggerFactory.getLogger(TestHFilePrettyPrinter.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static FileSystem fs; private static Configuration conf; private static byte [] cf = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileReaderImpl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileReaderImpl.java index 8c3a6329fad..f245fc8c57a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileReaderImpl.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileReaderImpl.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache; import org.apache.hadoop.hbase.testclassification.IOTests; @@ -47,7 +47,7 @@ public class TestHFileReaderImpl { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHFileReaderImpl.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); static KeyValue toKV(String row) { return new KeyValue(Bytes.toBytes(row), Bytes.toBytes("family"), Bytes.toBytes("qualifier"), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileScannerImplReferenceCount.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileScannerImplReferenceCount.java index cd33aac0ee9..4fd52fd3316 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileScannerImplReferenceCount.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileScannerImplReferenceCount.java @@ -38,7 +38,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.ByteBuffAllocator; @@ -89,7 +89,7 @@ public class TestHFileScannerImplReferenceCount { private static final Logger LOG = LoggerFactory.getLogger(TestHFileScannerImplReferenceCount.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY = Bytes.toBytes("f"); private static final byte[] QUALIFIER = Bytes.toBytes("q"); private static final byte[] SUFFIX = randLongBytes(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileSeek.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileSeek.java index aa67ed17500..34109a320a5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileSeek.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileSeek.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RawLocalFileSystem; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.hfile.HFile.Reader; import org.apache.hadoop.hbase.io.hfile.HFile.Writer; @@ -263,7 +263,7 @@ public class TestHFileSeek extends TestCase { int minWordLen = 5; int maxWordLen = 20; - private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); String rootDir = TEST_UTIL.getDataTestDir("TestTFileSeek").toString(); String file = "TestTFileSeek"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3.java index e6906bedbdd..53d4fe6281f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3.java @@ -37,8 +37,8 @@ import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -77,8 +77,8 @@ public class TestHFileWriterV3 { private static final Logger LOG = LoggerFactory.getLogger(TestHFileWriterV3.class); - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private Configuration conf; private FileSystem fs; @@ -88,7 +88,7 @@ public class TestHFileWriterV3 { } @Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } @Before diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3WithDataEncoders.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3WithDataEncoders.java index e5f970379a6..710e92df2fb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3WithDataEncoders.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileWriterV3WithDataEncoders.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -74,8 +74,8 @@ public class TestHFileWriterV3WithDataEncoders { private static final Logger LOG = LoggerFactory.getLogger(TestHFileWriterV3WithDataEncoders.class); - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private Configuration conf; private FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLazyDataBlockDecompression.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLazyDataBlockDecompression.java index 64d44c8bbce..bfb40bc6672 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLazyDataBlockDecompression.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLazyDataBlockDecompression.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper; @@ -65,7 +65,7 @@ public class TestLazyDataBlockDecompression { HBaseClassTestRule.forClass(TestLazyDataBlockDecompression.class); private static final Logger LOG = LoggerFactory.getLogger(TestLazyDataBlockDecompression.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java index d738a0e2c1a..51109535499 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -50,7 +50,7 @@ public class TestPrefetch { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestPrefetch.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int NUM_VALID_KEY_TYPES = KeyValue.Type.values().length - 2; private static final int DATA_BLOCK_SIZE = 2048; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestReseekTo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestReseekTo.java index de68578cd4f..46db1b27d3a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestReseekTo.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestReseekTo.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; @@ -47,7 +47,7 @@ public class TestReseekTo { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestReseekTo.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Test public void testReseekTo() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestRowIndexV1DataEncoder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestRowIndexV1DataEncoder.java index 8e172436b57..a28ad3cabbf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestRowIndexV1DataEncoder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestRowIndexV1DataEncoder.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.testclassification.IOTests; @@ -44,7 +44,7 @@ public class TestRowIndexV1DataEncoder { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRowIndexV1DataEncoder.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf; private FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerFromBucketCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerFromBucketCache.java index e111ddd414a..4d46cc48416 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerFromBucketCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerFromBucketCache.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ByteBufferKeyValue; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -67,7 +67,7 @@ public class TestScannerFromBucketCache { public TestName name = new TestName(); HRegion region = null; - private HBaseTestingUtility test_util; + private HBaseTestingUtil test_util; private Configuration conf; private final int MAX_VERSIONS = 2; byte[] val = new byte[512 * 1024]; @@ -76,7 +76,7 @@ public class TestScannerFromBucketCache { private TableName tableName; private void setUp(boolean useBucketCache) throws IOException { - test_util = new HBaseTestingUtility(); + test_util = new HBaseTestingUtil(); conf = test_util.getConfiguration(); if (useBucketCache) { conf.setInt("hbase.bucketcache.size", 400); @@ -132,7 +132,7 @@ public class TestScannerFromBucketCache { } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -173,7 +173,7 @@ public class TestScannerFromBucketCache { } catch (InterruptedException e) { } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -223,7 +223,7 @@ public class TestScannerFromBucketCache { } catch (InterruptedException e) { } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -294,12 +294,12 @@ public class TestScannerFromBucketCache { } private static HRegion initHRegion(TableName tableName, String callingMethod, Configuration conf, - HBaseTestingUtility test_util, byte[]... families) throws IOException { + HBaseTestingUtil test_util, byte[]... families) throws IOException { return initHRegion(tableName, null, null, callingMethod, conf, test_util, false, families); } private static HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, - String callingMethod, Configuration conf, HBaseTestingUtility testUtil, boolean isReadOnly, + String callingMethod, Configuration conf, HBaseTestingUtil testUtil, boolean isReadOnly, byte[]... families) throws IOException { RegionInfo regionInfo = RegionInfoBuilder.newBuilder(tableName).setStartKey(startKey).setEndKey(stopKey).build(); @@ -310,7 +310,7 @@ public class TestScannerFromBucketCache { ColumnFamilyDescriptorBuilder.newBuilder(family).setMaxVersions(Integer.MAX_VALUE) .build()); } - return HBaseTestingUtility + return HBaseTestingUtil .createRegionAndWAL(regionInfo, testUtil.getDataTestDir(callingMethod), conf, builder.build(), BlockCacheFactory.createBlockCache(conf)); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java index e9f6192becc..7ea1503a533 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingKeyRange.java @@ -29,7 +29,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -63,7 +63,7 @@ public class TestScannerSelectionUsingKeyRange { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScannerSelectionUsingKeyRange.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE = TableName.valueOf("myTable"); private static String FAMILY = "myCF"; private static byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY); @@ -109,7 +109,7 @@ public class TestScannerSelectionUsingKeyRange { .build(); RegionInfo info = RegionInfoBuilder.newBuilder(TABLE).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), conf, + HRegion region = HBaseTestingUtil.createRegionAndWAL(info, TEST_UTIL.getDataTestDir(), conf, tableDescriptor); for (int iFile = 0; iFile < NUM_FILES; ++iFile) { @@ -136,6 +136,6 @@ public class TestScannerSelectionUsingKeyRange { Set accessedFiles = ((LruBlockCache)cache).getCachedFileNamesForTest(); assertEquals(expectedCount, accessedFiles.size()); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java index cfd75045158..0954a4eee77 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java @@ -27,7 +27,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -67,7 +67,7 @@ public class TestScannerSelectionUsingTTL { private static final Logger LOG = LoggerFactory.getLogger(TestScannerSelectionUsingTTL.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE = TableName.valueOf("myTable"); private static String FAMILY = "myCF"; private static byte[] FAMILY_BYTES = Bytes.toBytes(FAMILY); @@ -105,7 +105,7 @@ public class TestScannerSelectionUsingTTL { ColumnFamilyDescriptorBuilder.newBuilder(FAMILY_BYTES).setMaxVersions(Integer.MAX_VALUE) .setTimeToLive(TTL_SECONDS).build()).build(); RegionInfo info = RegionInfoBuilder.newBuilder(TABLE).build(); - HRegion region = HBaseTestingUtility + HRegion region = HBaseTestingUtil .createRegionAndWAL(info, TEST_UTIL.getDataTestDir(info.getEncodedName()), conf, td, cache); long ts = EnvironmentEdgeManager.currentTime(); @@ -146,6 +146,6 @@ public class TestScannerSelectionUsingTTL { region.compact(false); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekBeforeWithInlineBlocks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekBeforeWithInlineBlocks.java index 645134434b9..ef807d2b117 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekBeforeWithInlineBlocks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekBeforeWithInlineBlocks.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.fs.HFileSystem; @@ -54,8 +54,8 @@ public class TestSeekBeforeWithInlineBlocks { private static final Logger LOG = LoggerFactory.getLogger(TestSeekBeforeWithInlineBlocks.class); - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private static final int NUM_KV = 10000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekTo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekTo.java index e45383a7a13..08479c3cc5b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekTo.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekTo.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.ByteBufferKeyValue; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -62,7 +62,7 @@ public class TestSeekTo { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSeekTo.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final DataBlockEncoding encoding; @Parameters public static Collection parameters() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java index 60b1ab7bb43..fbb40d6c0bd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java @@ -38,7 +38,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.ByteBuffAllocator; import org.apache.hadoop.hbase.io.hfile.BlockCacheKey; @@ -112,7 +112,7 @@ public class TestBucketCache { final int writerQLen = BucketCache.DEFAULT_WRITER_QUEUE_ITEMS; private String ioEngineName = "offheap"; - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); private static class MockedBucketCache extends BucketCache { @@ -349,7 +349,7 @@ public class TestBucketCache { @Test public void testRetrieveFromMultipleFiles() throws Exception { final Path testDirInitial = createAndGetTestDir(); - final Path newTestDir = new HBaseTestingUtility().getDataTestDir(); + final Path newTestDir = new HBaseTestingUtil().getDataTestDir(); HBASE_TESTING_UTILITY.getTestFileSystem().mkdirs(newTestDir); String ioEngineName = new StringBuilder("files:").append(testDirInitial) .append("/bucket1.cache").append(FileIOEngine.FILE_DELIMITER).append(newTestDir) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestVerifyBucketCacheFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestVerifyBucketCacheFile.java index e2578167f9b..8c95dd3e840 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestVerifyBucketCacheFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestVerifyBucketCacheFile.java @@ -31,7 +31,7 @@ import java.time.Instant; import java.util.Arrays; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.io.hfile.BlockCacheKey; import org.apache.hadoop.hbase.io.hfile.CacheTestUtils; import org.apache.hadoop.hbase.io.hfile.Cacheable; @@ -84,7 +84,7 @@ public class TestVerifyBucketCacheFile { */ @Test public void testRetrieveFromFile() throws Exception { - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); Path testDir = TEST_UTIL.getDataTestDir(); TEST_UTIL.getTestFileSystem().mkdirs(testDir); @@ -153,7 +153,7 @@ public class TestVerifyBucketCacheFile { */ @Test public void testModifiedBucketCacheFileData() throws Exception { - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); Path testDir = TEST_UTIL.getDataTestDir(); TEST_UTIL.getTestFileSystem().mkdirs(testDir); @@ -200,7 +200,7 @@ public class TestVerifyBucketCacheFile { */ @Test public void testModifiedBucketCacheFileTime() throws Exception { - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); Path testDir = TEST_UTIL.getDataTestDir(); TEST_UTIL.getTestFileSystem().mkdirs(testDir); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMasterFifoRpcScheduler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMasterFifoRpcScheduler.java index 13d09cf70e8..9822294a993 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMasterFifoRpcScheduler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestMasterFifoRpcScheduler.java @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterRpcServices; @@ -59,7 +59,7 @@ public class TestMasterFifoRpcScheduler { private static final String REGION_SERVER_REPORT = "RegionServerReport"; private static final String OTHER = "Other"; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java index b45dd5b2863..85e3ab29226 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; @@ -51,7 +51,7 @@ public class TestNettyRpcServer { @Rule public TestName name = new TestName(); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static TableName TABLE; private static byte[] FAMILY = Bytes.toBytes("f1"); @@ -65,7 +65,7 @@ public class TestNettyRpcServer { @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.getConfiguration().set( RpcServerFactory.CUSTOM_RPC_SERVER_IMPL_CONF_KEY, NettyRpcServer.class.getName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java index 2881eb736e5..b70ae407bba 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcClientLeaks.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.ipc; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -28,7 +28,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -95,7 +95,7 @@ public class TestRpcClientLeaks { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setup() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java index dd27c79c069..230b5cd7b28 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestDLS.java @@ -38,13 +38,13 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.SplitLogCounters; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Put; @@ -86,7 +86,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; public abstract class AbstractTestDLS { private static final Logger LOG = LoggerFactory.getLogger(TestSplitLogManager.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Start a cluster with 2 masters and 5 regionservers private static final int NUM_MASTERS = 2; @@ -97,7 +97,7 @@ public abstract class AbstractTestDLS { public TestName testName = new TestName(); private TableName tableName; - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; private HMaster master; private Configuration conf; @@ -131,7 +131,7 @@ public abstract class AbstractTestDLS { conf.setInt(HBASE_SPLIT_WAL_MAX_SPLITTER, 3); conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); conf.set("hbase.wal.provider", getWalProvider()); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(numRS).build(); TEST_UTIL.startMiniHBaseCluster(option); cluster = TEST_UTIL.getHBaseCluster(); @@ -192,19 +192,19 @@ public abstract class AbstractTestDLS { }); Thread.sleep(2000); - LOG.info("Current Open Regions:" + HBaseTestingUtility.getAllOnlineRegions(cluster).size()); + LOG.info("Current Open Regions:" + HBaseTestingUtil.getAllOnlineRegions(cluster).size()); // wait for abort completes TEST_UTIL.waitFor(120000, 200, new Waiter.Predicate() { @Override public boolean evaluate() throws Exception { - return (HBaseTestingUtility.getAllOnlineRegions(cluster) + return (HBaseTestingUtil.getAllOnlineRegions(cluster) .size() >= (numRegionsToCreate + 1)); } }); LOG.info("Current Open Regions After Master Node Starts Up:" + - HBaseTestingUtility.getAllOnlineRegions(cluster).size()); + HBaseTestingUtil.getAllOnlineRegions(cluster).size()); assertEquals(numLogLines, TEST_UTIL.countRows(ht)); } @@ -348,7 +348,7 @@ public abstract class AbstractTestDLS { TEST_UTIL.getAdmin().disableTable(tableName); LOG.debug("Waiting for no more RIT\n"); blockUntilNoRIT(); - NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + NavigableSet regions = HBaseTestingUtil.getAllOnlineRegions(cluster); LOG.debug("Verifying only catalog region is assigned\n"); if (regions.size() != 1) { for (String oregion : regions) { @@ -361,7 +361,7 @@ public abstract class AbstractTestDLS { LOG.debug("Waiting for no more RIT\n"); blockUntilNoRIT(); LOG.debug("Verifying there are " + numRegions + " assigned on cluster\n"); - regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + regions = HBaseTestingUtil.getAllOnlineRegions(cluster); assertEquals(numRegions + 1 + existingRegions, regions.size()); return table; } @@ -526,7 +526,7 @@ public abstract class AbstractTestDLS { fail(); } - private void abortMaster(MiniHBaseCluster cluster) throws InterruptedException { + private void abortMaster(SingleProcessHBaseCluster cluster) throws InterruptedException { for (MasterThread mt : cluster.getLiveMasterThreads()) { if (mt.getMaster().isActiveMaster()) { mt.getMaster().abort("Aborting for tests", new Exception("Trace info")); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestRestartCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestRestartCluster.java index 4c20e90bbf4..07a87fa7dc1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestRestartCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/AbstractTestRestartCluster.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.master; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.util.Bytes; @@ -30,7 +30,7 @@ public abstract class AbstractTestRestartCluster { private static final Logger LOG = LoggerFactory.getLogger(AbstractTestRestartCluster.class); - protected HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final TableName[] TABLES = { TableName.valueOf("restartTableOne"), TableName.valueOf("restartTableTwo"), TableName.valueOf("restartTableThree") }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java index 9eab2c1eb39..8ba6f10e084 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java @@ -30,7 +30,7 @@ import java.util.concurrent.Semaphore; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.monitoring.MonitoredTask; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -64,7 +64,7 @@ public class TestActiveMasterManager { HBaseClassTestRule.forClass(TestActiveMasterManager.class); private final static Logger LOG = LoggerFactory.getLogger(TestActiveMasterManager.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAlwaysStandByHMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAlwaysStandByHMaster.java index 2e6af154113..2ed4687f186 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAlwaysStandByHMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAlwaysStandByHMaster.java @@ -22,9 +22,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MiniClusterRule; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.ClassRule; @@ -38,7 +38,7 @@ public class TestAlwaysStandByHMaster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAlwaysStandByHMaster.class); - private static final StartMiniClusterOption OPTION = StartMiniClusterOption.builder() + private static final StartTestingClusterOption OPTION = StartTestingClusterOption.builder() .numAlwaysStandByMasters(1) .numMasters(1) .numRegionServers(1) @@ -54,7 +54,7 @@ public class TestAlwaysStandByHMaster { * master exists. */ @Test public void testAlwaysStandBy() throws Exception { - HBaseTestingUtility testUtil = miniClusterRule.getTestingUtility(); + HBaseTestingUtil testUtil = miniClusterRule.getTestingUtility(); // Make sure there is an active master. assertNotNull(testUtil.getMiniHBaseCluster().getMaster()); assertEquals(2, testUtil.getMiniHBaseCluster().getMasterThreads().size()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java index c1e16bec9af..fa99663d326 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerMetrics.java @@ -23,9 +23,9 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.CoprocessorDescriptorBuilder; @@ -61,9 +61,9 @@ public class TestAssignmentManagerMetrics { private static final MetricsAssertHelper METRICS_HELPER = CompatibilityFactory .getInstance(MetricsAssertHelper.class); - private static MiniHBaseCluster CLUSTER; + private static SingleProcessHBaseCluster CLUSTER; private static HMaster MASTER; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int MSG_INTERVAL = 1000; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestBalancer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestBalancer.java index 8d3b6dbadcb..7fef729e91a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestBalancer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestBalancer.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Map; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -51,7 +51,7 @@ public class TestBalancer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBalancer.class); - private final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClientMetaServiceRPCs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClientMetaServiceRPCs.java index 428aee2a142..d17ecf8d7ba 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClientMetaServiceRPCs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClientMetaServiceRPCs.java @@ -28,10 +28,10 @@ import java.util.List; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.ipc.HBaseRpcController; import org.apache.hadoop.hbase.ipc.RpcClient; import org.apache.hadoop.hbase.ipc.RpcClientFactory; @@ -63,7 +63,7 @@ public class TestClientMetaServiceRPCs { // Total number of masters (active + stand by) for the purpose of this test. private static final int MASTER_COUNT = 3; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; private static int rpcTimeout; private static RpcClient rpcClient; @@ -71,7 +71,7 @@ public class TestClientMetaServiceRPCs { @BeforeClass public static void setUp() throws Exception { // Start the mini cluster with stand-by masters. - StartMiniClusterOption.Builder builder = StartMiniClusterOption.builder(); + StartTestingClusterOption.Builder builder = StartTestingClusterOption.builder(); builder.numMasters(MASTER_COUNT).numRegionServers(3); TEST_UTIL.startMiniCluster(builder.build()); conf = TEST_UTIL.getConfiguration(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCloseAnOpeningRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCloseAnOpeningRegion.java index 492222464f9..a79e8f3670a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCloseAnOpeningRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCloseAnOpeningRegion.java @@ -22,10 +22,10 @@ import java.io.UncheckedIOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionInfo; @@ -52,7 +52,7 @@ public class TestCloseAnOpeningRegion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCloseAnOpeningRegion.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("race"); @@ -94,8 +94,8 @@ public class TestCloseAnOpeningRegion { @BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY, 60000); - UTIL.startMiniCluster( - StartMiniClusterOption.builder().numRegionServers(2).masterClass(MockHMaster.class).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().numRegionServers(2) + .masterClass(MockHMaster.class).build()); UTIL.createTable(TABLE_NAME, CF); UTIL.getAdmin().balancerSwitch(false, true); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClusterRestartFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClusterRestartFailover.java index f5603133809..f9300ed0f72 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClusterRestartFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClusterRestartFailover.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.Table; @@ -99,7 +99,7 @@ public class TestClusterRestartFailover extends AbstractTestRestartCluster { UTIL.getHBaseCluster().killAll(); UTIL.getHBaseCluster().waitUntilShutDown(); LOG.info("Restarting cluster"); - UTIL.restartHBaseCluster(StartMiniClusterOption.builder().masterClass(HMasterForTest.class) + UTIL.restartHBaseCluster(StartTestingClusterOption.builder().masterClass(HMasterForTest.class) .numMasters(1).numRegionServers(3).rsPorts(ports).build()); LOG.info("Started cluster"); UTIL.waitFor(60000, () -> UTIL.getHBaseCluster().getMaster().isInitialized()); @@ -138,7 +138,7 @@ public class TestClusterRestartFailover extends AbstractTestRestartCluster { private void setupCluster() throws Exception { LOG.info("Setup cluster"); UTIL.startMiniCluster( - StartMiniClusterOption.builder().masterClass(HMasterForTest.class).numMasters(1) + StartTestingClusterOption.builder().masterClass(HMasterForTest.class).numMasters(1) .numRegionServers(3).build()); LOG.info("Cluster is up"); UTIL.waitFor(60000, () -> UTIL.getMiniHBaseCluster().getMaster().isInitialized()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java index b0d6cb63ea7..2a072cc9518 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.List; import java.util.Set; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; @@ -50,7 +50,7 @@ public class TestDeadServer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDeadServer.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); final ServerName hostname123 = ServerName.valueOf("127.0.0.1", 123, 3L); final ServerName hostname123_2 = ServerName.valueOf("127.0.0.1", 123, 4L); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetInfoPort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetInfoPort.java index 5b27bf57812..c70efc94a01 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetInfoPort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetInfoPort.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -40,7 +40,7 @@ public class TestGetInfoPort { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestGetInfoPort.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); @Before public void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java index 387ccf84d55..b3af4145158 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetLastFlushedSequenceId.java @@ -24,10 +24,10 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -55,7 +55,7 @@ public class TestGetLastFlushedSequenceId { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestGetLastFlushedSequenceId.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private final TableName tableName = TableName.valueOf(getClass().getSimpleName(), "test"); @@ -81,7 +81,7 @@ public class TestGetLastFlushedSequenceId { Table table = testUtil.createTable(tableName, families); table.put(new Put(Bytes.toBytes("k")) .addColumn(family, Bytes.toBytes("q"), Bytes.toBytes("v"))); - MiniHBaseCluster cluster = testUtil.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = testUtil.getMiniHBaseCluster(); List rsts = cluster.getRegionServerThreads(); Region region = null; for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetReplicationLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetReplicationLoad.java index ac9ae397267..a1a1d7de626 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetReplicationLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestGetReplicationLoad.java @@ -18,10 +18,10 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.replication.ReplicationLoadSource; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -48,9 +48,9 @@ public class TestGetReplicationLoad { private static final Logger LOG = LoggerFactory.getLogger(TestGetReplicationLoad.class); - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static HMaster master; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; public static class MyMaster extends HMaster { public MyMaster(Configuration conf) throws IOException, KeeperException, InterruptedException { @@ -66,9 +66,9 @@ public class TestGetReplicationLoad { @BeforeClass public static void startCluster() throws Exception { LOG.info("Starting cluster"); - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); // Set master class and use default values for other options. - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .masterClass(TestMasterMetrics.MyMaster.class).build(); TEST_UTIL.startMiniCluster(option); cluster = TEST_UTIL.getHBaseCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterCommandLine.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterCommandLine.java index 771edfa6be6..f1f4ad9864a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterCommandLine.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterCommandLine.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import static org.junit.Assert.*; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -34,7 +34,7 @@ public class TestHMasterCommandLine { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHMasterCommandLine.class); - private static final HBaseTestingUtility TESTING_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TESTING_UTIL = new HBaseTestingUtil(); @Test public void testRun() throws Exception { HMasterCommandLine masterCommandLine = new HMasterCommandLine(HMaster.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java index 71cc49ec927..cfeba2534bc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.ipc.RpcClient; @@ -58,7 +58,7 @@ public class TestHMasterRPCException { private static final Logger LOG = LoggerFactory.getLogger(TestHMasterRPCException.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private HMaster master; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestLoadProcedureError.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestLoadProcedureError.java index 9dbc5876f6c..d2b9eb3125d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestLoadProcedureError.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestLoadProcedureError.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertFalse; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.master.procedure.TableProcedureInterface; @@ -50,7 +50,7 @@ public class TestLoadProcedureError { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLoadProcedureError.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Load"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java index 53bebec6834..0f091729c95 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java @@ -33,12 +33,12 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.ClientMetaTableAccessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.client.Admin; @@ -77,7 +77,7 @@ public class TestMaster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMaster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestMaster.class); private static final TableName TABLENAME = TableName.valueOf("TestMaster"); private static final byte[] FAMILYNAME = Bytes.toBytes("fam"); @@ -132,7 +132,7 @@ public class TestMaster { @Test @SuppressWarnings("deprecation") public void testMasterOpsWhileSplitting() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); try (Table ht = TEST_UTIL.createTable(TABLENAME, FAMILYNAME)) { @@ -173,7 +173,7 @@ public class TestMaster { @Test public void testMoveRegionWhenNotInitialized() { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); try { m.setInitialized(false); // fake it, set back later diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterAbortAndRSGotKilled.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterAbortAndRSGotKilled.java index 3df49290f6c..8b364c4d903 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterAbortAndRSGotKilled.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterAbortAndRSGotKilled.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -55,7 +55,7 @@ public class TestMasterAbortAndRSGotKilled { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterAbortAndRSGotKilled.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterBalanceThrottling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterBalanceThrottling.java index 93cd4f44291..7bc8e5b56ea 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterBalanceThrottling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterBalanceThrottling.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -46,7 +46,7 @@ public class TestMasterBalanceThrottling { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterBalanceThrottling.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAMILYNAME = Bytes.toBytes("fam"); @Before diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterChoreScheduled.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterChoreScheduled.java index 87a7e680ff8..45b57b40c10 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterChoreScheduled.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterChoreScheduled.java @@ -20,9 +20,9 @@ package org.apache.hadoop.hbase.master; import java.lang.reflect.Field; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ScheduledChore; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.master.balancer.BalancerChore; import org.apache.hadoop.hbase.master.balancer.ClusterStatusChore; import org.apache.hadoop.hbase.master.cleaner.HFileCleaner; @@ -50,11 +50,11 @@ public class TestMasterChoreScheduled { private static HMaster hMaster; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { - UTIL.startMiniCluster(StartMiniClusterOption.builder().numRegionServers(1).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().numRegionServers(1).build()); hMaster = UTIL.getMiniHBaseCluster().getMaster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java index 2be53a6d26b..9e0333b5103 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java @@ -24,10 +24,10 @@ import java.util.List; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.master.RegionState.State; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.testclassification.FlakeyTests; @@ -65,12 +65,12 @@ public class TestMasterFailover { final int NUM_RS = 3; // Start the cluster - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); try { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(NUM_RS).numDataNodes(NUM_RS).build(); TEST_UTIL.startMiniCluster(option); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); // get all the master threads List masterThreads = cluster.getMasterThreads(); @@ -175,10 +175,10 @@ public class TestMasterFailover { @Test public void testMetaInTransitionWhenMasterFailover() throws Exception { // Start the cluster - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniCluster(); try { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); LOG.info("Cluster started"); HMaster activeMaster = cluster.getMaster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java index 337cdfaa06f..56f2d52e12d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java @@ -24,10 +24,10 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.util.JVMClusterUtil; @@ -51,12 +51,12 @@ public class TestMasterFailoverBalancerPersistence { @Test public void testMasterFailoverBalancerPersistence() throws Exception { // Start the cluster - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(3).build(); TEST_UTIL.startMiniCluster(option); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); assertTrue(cluster.waitForActiveAndReadyMaster()); HMaster active = cluster.getMaster(); @@ -92,7 +92,7 @@ public class TestMasterFailoverBalancerPersistence { * @throws InterruptedException * @throws java.io.IOException */ - private HMaster killActiveAndWaitForNewActive(MiniHBaseCluster cluster) + private HMaster killActiveAndWaitForNewActive(SingleProcessHBaseCluster cluster) throws InterruptedException, IOException { int activeIndex = getActiveMasterIndex(cluster); HMaster active = cluster.getMaster(); @@ -111,7 +111,8 @@ public class TestMasterFailoverBalancerPersistence { * @throws org.apache.hadoop.hbase.MasterNotRunningException * if no active master found */ - private int getActiveMasterIndex(MiniHBaseCluster cluster) throws MasterNotRunningException { + private int getActiveMasterIndex(SingleProcessHBaseCluster cluster) + throws MasterNotRunningException { // get all the master threads List masterThreads = cluster.getMasterThreads(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystem.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystem.java index 63d303dc710..60e46052a03 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystem.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystem.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.regionserver.HRegion; @@ -59,7 +59,7 @@ public class TestMasterFileSystem { private static final Logger LOG = LoggerFactory.getLogger(TestMasterFileSystem.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupTest() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystemWithWALDir.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystemWithWALDir.java index 262b782f15c..51cedf65188 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystemWithWALDir.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFileSystemWithWALDir.java @@ -21,8 +21,8 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.CommonFSUtils; @@ -42,12 +42,12 @@ public class TestMasterFileSystemWithWALDir { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterFileSystemWithWALDir.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupTest() throws Exception { // Set createWALDir to true and use default values for other options. - UTIL.startMiniCluster(StartMiniClusterOption.builder().createWALDir(true).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().createWALDir(true).build()); } @AfterClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java index e41054e98b4..f4fcd9deb6e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterHandlerFullWhenTransitRegion.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.Optional; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -49,7 +49,7 @@ public class TestMasterHandlerFullWhenTransitRegion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterHandlerFullWhenTransitRegion.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String TABLENAME = "table"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java index a1b0a69582b..705943bc72c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java @@ -23,11 +23,11 @@ import java.util.HashMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerMetricsBuilder; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.YouAreDeadException; import org.apache.hadoop.hbase.regionserver.RSRpcServices; import org.apache.hadoop.hbase.test.MetricsAssertHelper; @@ -63,9 +63,9 @@ public class TestMasterMetrics { private static final MetricsAssertHelper metricsHelper = CompatibilityFactory.getInstance(MetricsAssertHelper.class); - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static HMaster master; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); public static class MyMaster extends HMaster { @@ -107,7 +107,8 @@ public class TestMasterMetrics { } } - public static class MyRegionServer extends MiniHBaseCluster.MiniHBaseClusterRegionServer { + public static class MyRegionServer + extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer { public MyRegionServer(Configuration conf) throws IOException, InterruptedException { super(conf); @@ -123,8 +124,8 @@ public class TestMasterMetrics { public static void startCluster() throws Exception { LOG.info("Starting cluster"); // Set master class and use default values for other options. - StartMiniClusterOption option = StartMiniClusterOption.builder().masterClass(MyMaster.class) - .rsClass(MyRegionServer.class).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder() + .masterClass(MyMaster.class).rsClass(MyRegionServer.class).build(); TEST_UTIL.startMiniCluster(option); cluster = TEST_UTIL.getHBaseCluster(); LOG.info("Waiting for active/ready master"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java index 4bcf7329112..960522c2463 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java @@ -23,7 +23,7 @@ import static org.junit.Assert.fail; import java.util.AbstractMap.SimpleImmutableEntry; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.RegionInfo; @@ -56,7 +56,7 @@ public class TestMasterMetricsWrapper { private static final Logger LOG = LoggerFactory.getLogger(TestMasterMetricsWrapper.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int NUM_RS = 4; @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java index 1f322119786..bc2bce90118 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.ZooKeeperConnectionException; @@ -64,7 +64,7 @@ public class TestMasterNoCluster { private static final Logger LOG = LoggerFactory.getLogger(TestMasterNoCluster.class); - private static final HBaseTestingUtility TESTUTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TESTUTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNotCarryTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNotCarryTable.java index 63a55f3f7c5..c39a58e898f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNotCarryTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNotCarryTable.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertFalse; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.CommonFSUtils; @@ -42,7 +42,7 @@ public class TestMasterNotCarryTable { private static final Logger LOG = LoggerFactory.getLogger(TestMasterNotCarryTable.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static HMaster master; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterOperationsForRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterOperationsForRegionReplicas.java index ad08e3fa556..54416cdd944 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterOperationsForRegionReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterOperationsForRegionReplicas.java @@ -38,13 +38,13 @@ import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.ClientMetaTableAccessor; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -81,11 +81,11 @@ public class TestMasterOperationsForRegionReplicas { HBaseClassTestRule.forClass(TestMasterOperationsForRegionReplicas.class); private static final Logger LOG = LoggerFactory.getLogger(TestRegionPlacement.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Connection CONNECTION = null; private static Admin ADMIN; private static int numSlaves = 2; - private final static StartMiniClusterOption option = StartMiniClusterOption.builder(). + private final static StartTestingClusterOption option = StartTestingClusterOption.builder(). numRegionServers(numSlaves).numMasters(1).numAlwaysStandByMasters(1).build(); private static Configuration conf; @@ -201,8 +201,8 @@ public class TestMasterOperationsForRegionReplicas { rsports.add(rst.getRegionServer().getRpcServer().getListenerAddress().getPort()); } TEST_UTIL.shutdownMiniHBaseCluster(); - StartMiniClusterOption option = - StartMiniClusterOption.builder().numRegionServers(numSlaves).rsPorts(rsports).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(numSlaves).rsPorts(rsports).build(); TEST_UTIL.startMiniHBaseCluster(option); TEST_UTIL.waitUntilAllRegionsAssigned(tableName); TEST_UTIL.waitUntilNoRegionsInTransition(); @@ -350,7 +350,7 @@ public class TestMasterOperationsForRegionReplicas { assertEquals(numRegions, count.get()); } - private void validateFromSnapshotFromMeta(HBaseTestingUtility util, TableName table, + private void validateFromSnapshotFromMeta(HBaseTestingUtil util, TableName table, int numRegions, int numReplica, Connection connection) throws IOException { SnapshotOfRegionAssignmentFromMeta snapshot = new SnapshotOfRegionAssignmentFromMeta(connection); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRepairMode.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRepairMode.java index 8301e0abe71..910692d93c3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRepairMode.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRepairMode.java @@ -27,9 +27,9 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.AsyncTable; import org.apache.hadoop.hbase.client.Connection; @@ -65,11 +65,11 @@ public class TestMasterRepairMode { private static final byte[] FAMILYNAME = Bytes.toBytes("fam"); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; @Before public void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); } @After @@ -88,7 +88,7 @@ public class TestMasterRepairMode { enableMaintenanceMode(); TEST_UTIL.startMiniCluster( - StartMiniClusterOption.builder().numRegionServers(0).numDataNodes(3).build()); + StartTestingClusterOption.builder().numRegionServers(0).numDataNodes(3).build()); Connection conn = TEST_UTIL.getConnection(); assertTrue(conn.getAdmin().isMasterInMaintenanceMode()); @@ -115,7 +115,7 @@ public class TestMasterRepairMode { enableMaintenanceMode(); TEST_UTIL.startMiniHBaseCluster( - StartMiniClusterOption.builder().numRegionServers(0).createRootDir(false).build()); + StartTestingClusterOption.builder().numRegionServers(0).createRootDir(false).build()); Connection conn = TEST_UTIL.getConnection(); assertTrue(conn.getAdmin().isMasterInMaintenanceMode()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java index fca2866e380..aeba846c52c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java @@ -25,9 +25,9 @@ import java.util.NavigableSet; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.RegionLocator; @@ -67,11 +67,11 @@ public class TestMasterRestartAfterDisablingTable { // Start the cluster log("Starting cluster"); Configuration conf = HBaseConfiguration.create(); - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(conf); - StartMiniClusterOption option = StartMiniClusterOption.builder() + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(conf); + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).build(); TEST_UTIL.startMiniCluster(option); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); log("Waiting for active/ready master"); cluster.waitForActiveAndReadyMaster(); @@ -90,7 +90,7 @@ public class TestMasterRestartAfterDisablingTable { log("Disabling table\n"); TEST_UTIL.getAdmin().disableTable(tableName); - NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + NavigableSet regions = HBaseTestingUtil.getAllOnlineRegions(cluster); assertEquals("The number of regions for the table tableRestart should be 0 and only" + "the catalog table should be present.", 1, regions.size()); @@ -118,7 +118,7 @@ public class TestMasterRestartAfterDisablingTable { log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); log("Verifying there are " + numRegions + " assigned on cluster\n"); - regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + regions = HBaseTestingUtil.getAllOnlineRegions(cluster); assertEquals("The assigned regions were not onlined after master" + " switch except for the catalog table.", 5, regions.size()); assertTrue("The table should be in enabled state", cluster.getMaster().getTableStateManager() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java index cd8c4d2a16c..41ad2cde783 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterShutdown.java @@ -27,10 +27,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.LocalHBaseCluster; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.client.RetriesExhaustedException; import org.apache.hadoop.hbase.exceptions.ConnectionClosedException; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -53,7 +53,7 @@ public class TestMasterShutdown { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterShutdown.class); - private HBaseTestingUtility htu; + private HBaseTestingUtil htu; @Before public void shutdownCluster() throws IOException { @@ -78,13 +78,13 @@ public class TestMasterShutdown { // Start the cluster try { - htu = new HBaseTestingUtility(conf); - StartMiniClusterOption option = StartMiniClusterOption.builder() + htu = new HBaseTestingUtil(conf); + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(3) .numRegionServers(1) .numDataNodes(1) .build(); - final MiniHBaseCluster cluster = htu.startMiniCluster(option); + final SingleProcessHBaseCluster cluster = htu.startMiniCluster(option); // wait for all master thread to spawn and start their run loop. final long thirtySeconds = TimeUnit.SECONDS.toMillis(30); @@ -128,16 +128,16 @@ public class TestMasterShutdown { public void testMasterShutdownBeforeStartingAnyRegionServer() throws Exception { LocalHBaseCluster hbaseCluster = null; try { - htu = new HBaseTestingUtility( + htu = new HBaseTestingUtil( createMasterShutdownBeforeStartingAnyRegionServerConfiguration()); // configure a cluster with - final StartMiniClusterOption options = StartMiniClusterOption.builder() + final StartTestingClusterOption options = StartTestingClusterOption.builder() .numDataNodes(1) .numMasters(1) .numRegionServers(0) .masterClass(HMaster.class) - .rsClass(MiniHBaseCluster.MiniHBaseClusterRegionServer.class) + .rsClass(SingleProcessHBaseCluster.MiniHBaseClusterRegionServer.class) .createRootDir(true) .build(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java index d13b36b90fd..372224e56c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterTransitions.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import java.io.IOException; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; @@ -57,7 +57,7 @@ public class TestMasterTransitions { HBaseClassTestRule.forClass(TestMasterTransitions.class); private static final Logger LOG = LoggerFactory.getLogger(TestMasterTransitions.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLENAME = TableName.valueOf("master_transitions"); private static final byte [][] FAMILIES = new byte [][] {Bytes.toBytes("a"), Bytes.toBytes("b"), Bytes.toBytes("c")}; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMergeTableRegionsWhileRSCrash.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMergeTableRegionsWhileRSCrash.java index 5229f909e59..257a8f87545 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMergeTableRegionsWhileRSCrash.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMergeTableRegionsWhileRSCrash.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Put; @@ -57,7 +57,7 @@ public class TestMergeTableRegionsWhileRSCrash { private static final Logger LOG = LoggerFactory .getLogger(TestMergeTableRegionsWhileRSCrash.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); private static Admin admin; private static byte[] CF = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaAssignmentWithStopMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaAssignmentWithStopMaster.java index 3c690a952d0..6ad4f080605 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaAssignmentWithStopMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaAssignmentWithStopMaster.java @@ -21,9 +21,9 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -48,13 +48,13 @@ public class TestMetaAssignmentWithStopMaster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaAssignmentWithStopMaster.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final long WAIT_TIMEOUT = 120000; @BeforeClass public static void setUpBeforeClass() throws Exception { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(2).numRegionServers(3).numDataNodes(3).build(); UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java index d4c19335dd6..cf35ae24bf9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMetaShutdownHandler.java @@ -24,11 +24,11 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.MiniHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.RegionInfoBuilder; import org.apache.hadoop.hbase.master.assignment.RegionStates; @@ -57,12 +57,12 @@ public class TestMetaShutdownHandler { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMetaShutdownHandler.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); final static Configuration conf = TEST_UTIL.getConfiguration(); @BeforeClass public static void setUpBeforeClass() throws Exception { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(3).rsClass(MyRegionServer.class).numDataNodes(3).build(); TEST_UTIL.startMiniCluster(option); } @@ -84,7 +84,7 @@ public class TestMetaShutdownHandler { */ @Test public void testExpireMetaRegionServer() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); RegionStates regionStates = master.getAssignmentManager().getRegionStates(); ServerName metaServerName = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMigrateNamespaceTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMigrateNamespaceTable.java index b4d378f84f5..c687abdf414 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMigrateNamespaceTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMigrateNamespaceTable.java @@ -22,9 +22,9 @@ import static org.junit.Assert.assertFalse; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -52,11 +52,11 @@ public class TestMigrateNamespaceTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMigrateNamespaceTable.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { - StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(1). + StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(1). numAlwaysStandByMasters(1).numRegionServers(1).build(); UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestNewStartedRegionServerVersion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestNewStartedRegionServerVersion.java index 6e867772f37..2d9269a337a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestNewStartedRegionServerVersion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestNewStartedRegionServerVersion.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotEquals; import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -45,7 +45,7 @@ public class TestNewStartedRegionServerVersion { private static final Logger LOG = LoggerFactory.getLogger(TestNewStartedRegionServerVersion.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java index ce8b4c7b63e..0a71e01d205 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java @@ -37,13 +37,13 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.ClientMetaTableAccessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -83,7 +83,7 @@ public class TestRegionPlacement { HBaseClassTestRule.forClass(TestRegionPlacement.class); private static final Logger LOG = LoggerFactory.getLogger(TestRegionPlacement.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static int SLAVES = 10; private static Connection CONNECTION; private static Admin admin; @@ -376,7 +376,7 @@ public class TestRegionPlacement { */ private void verifyRegionMovementNum(int expected) throws InterruptedException, IOException { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); int lastRegionOpenedCount = m.getAssignmentManager().getNumRegionsOpened(); // get the assignments start to execute @@ -423,7 +423,7 @@ public class TestRegionPlacement { */ private void verifyRegionServerUpdated(FavoredNodesPlan plan) throws IOException { // Verify all region servers contain the correct favored nodes information - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); for (int i = 0; i < SLAVES; i++) { HRegionServer rs = cluster.getRegionServer(i); for (Region region: rs.getRegions(TableName.valueOf("testRegionAssignment"))) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement2.java index ab58eec8203..320770787c4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement2.java @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -55,7 +55,7 @@ public class TestRegionPlacement2 { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionPlacement2.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static int SLAVES = 7; private final static int PRIMARY = Position.PRIMARY.ordinal(); private final static int SECONDARY = Position.SECONDARY.ordinal(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlansWithThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlansWithThrottle.java index 508406402bb..96b419b3637 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlansWithThrottle.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlansWithThrottle.java @@ -21,8 +21,8 @@ package org.apache.hadoop.hbase.master; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -49,11 +49,11 @@ public class TestRegionPlansWithThrottle { private static HMaster hMaster; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { - UTIL.startMiniCluster(StartMiniClusterOption.builder().numRegionServers(2).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().numRegionServers(2).build()); hMaster = UTIL.getMiniHBaseCluster().getMaster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryChore.java index 3d5cfacf130..4b70206489f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryChore.java @@ -29,7 +29,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.RegionMetrics; import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; @@ -67,7 +67,7 @@ public class TestRegionsRecoveryChore { private static final Logger LOG = LoggerFactory.getLogger(TestRegionsRecoveryChore.class); - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); private static final String UTF_8_CHARSET = StandardCharsets.UTF_8.name(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryConfigManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryConfigManager.java index 6819e5d2b11..4bcc97feacc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryConfigManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionsRecoveryConfigManager.java @@ -24,9 +24,9 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.After; @@ -45,9 +45,9 @@ public class TestRegionsRecoveryConfigManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionsRecoveryConfigManager.class); - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; private HMaster hMaster; @@ -60,8 +60,8 @@ public class TestRegionsRecoveryConfigManager { conf = HBASE_TESTING_UTILITY.getConfiguration(); conf.unset("hbase.regions.recovery.store.file.ref.count"); conf.unset("hbase.master.regions.recovery.check.interval"); - StartMiniClusterOption option = StartMiniClusterOption.builder().masterClass(TestHMaster.class) - .numRegionServers(1).numDataNodes(1).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder() + .masterClass(TestHMaster.class).numRegionServers(1).numDataNodes(1).build(); HBASE_TESTING_UTILITY.startMiniCluster(option); cluster = HBASE_TESTING_UTILITY.getMiniHBaseCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRetainAssignmentOnRestart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRetainAssignmentOnRestart.java index 4a5491ed8f8..db648d3a845 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRetainAssignmentOnRestart.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRetainAssignmentOnRestart.java @@ -28,9 +28,9 @@ import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure; @@ -93,7 +93,7 @@ public class TestRetainAssignmentOnRestart extends AbstractTestRestartCluster { public void testRetainAssignmentOnClusterRestart() throws Exception { setupCluster(); HMaster master = UTIL.getMiniHBaseCluster().getMaster(); - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); List threads = cluster.getLiveRegionServerThreads(); assertEquals(NUM_OF_RS, threads.size()); int[] rsPorts = new int[NUM_OF_RS]; @@ -160,7 +160,7 @@ public class TestRetainAssignmentOnRestart extends AbstractTestRestartCluster { public void testRetainAssignmentOnSingleRSRestart() throws Exception { setupCluster(); HMaster master = UTIL.getMiniHBaseCluster().getMaster(); - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); List threads = cluster.getLiveRegionServerThreads(); assertEquals(NUM_OF_RS, threads.size()); int[] rsPorts = new int[NUM_OF_RS]; @@ -234,7 +234,7 @@ public class TestRetainAssignmentOnRestart extends AbstractTestRestartCluster { HConstants.ZK_CONNECTION_REGISTRY_CLASS); // Enable retain assignment during ServerCrashProcedure UTIL.getConfiguration().setBoolean(ServerCrashProcedure.MASTER_SCP_RETAIN_ASSIGNMENT, true); - UTIL.startMiniCluster(StartMiniClusterOption.builder().masterClass(HMasterForTest.class) + UTIL.startMiniCluster(StartTestingClusterOption.builder().masterClass(HMasterForTest.class) .numRegionServers(NUM_OF_RS).build()); // Turn off balancer diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java index 7255c01f1e6..e4984de470a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java @@ -29,11 +29,11 @@ import java.util.TreeSet; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionLocator; @@ -69,7 +69,7 @@ public class TestRollingRestart { private static final Logger LOG = LoggerFactory.getLogger(TestRollingRestart.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; @Rule public TestName name = new TestName(); @@ -91,11 +91,11 @@ public class TestRollingRestart { Configuration conf = HBaseConfiguration.create(); conf.setBoolean(HConstants.HBASE_SPLIT_WAL_COORDINATED_BY_ZK, splitWALCoordinatedByZK); - TEST_UTIL = new HBaseTestingUtility(conf); - StartMiniClusterOption option = StartMiniClusterOption.builder() + TEST_UTIL = new HBaseTestingUtil(conf); + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(NUM_RS).numDataNodes(NUM_RS).build(); TEST_UTIL.startMiniCluster(option); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); log("Waiting for active/ready master"); cluster.waitForActiveAndReadyMaster(); @@ -116,7 +116,7 @@ public class TestRollingRestart { TEST_UTIL.getAdmin().disableTable(tableName); log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); - NavigableSet regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + NavigableSet regions = HBaseTestingUtil.getAllOnlineRegions(cluster); log("Verifying only catalog region is assigned\n"); if (regions.size() != 1) { for (String oregion : regions) { @@ -129,7 +129,7 @@ public class TestRollingRestart { log("Waiting for no more RIT\n"); TEST_UTIL.waitUntilNoRegionsInTransition(60000); log("Verifying there are " + numRegions + " assigned on cluster\n"); - regions = HBaseTestingUtility.getAllOnlineRegions(cluster); + regions = HBaseTestingUtil.getAllOnlineRegions(cluster); assertRegionsAssigned(cluster, regions); assertEquals(expectedNumRS, cluster.getRegionServerThreads().size()); @@ -256,7 +256,7 @@ public class TestRollingRestart { LOG.debug("\n\nTRR: " + msg + "\n"); } - private int getNumberOfOnlineRegions(MiniHBaseCluster cluster) { + private int getNumberOfOnlineRegions(SingleProcessHBaseCluster cluster) { int numFound = 0; for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) { numFound += rst.getRegionServer().getNumberOfOnlineRegions(); @@ -267,14 +267,14 @@ public class TestRollingRestart { return numFound; } - private void assertRegionsAssigned(MiniHBaseCluster cluster, + private void assertRegionsAssigned(SingleProcessHBaseCluster cluster, Set expectedRegions) throws IOException { int numFound = getNumberOfOnlineRegions(cluster); if (expectedRegions.size() > numFound) { log("Expected to find " + expectedRegions.size() + " but only found" + " " + numFound); NavigableSet foundRegions = - HBaseTestingUtility.getAllOnlineRegions(cluster); + HBaseTestingUtil.getAllOnlineRegions(cluster); for (String region : expectedRegions) { if (!foundRegions.contains(region)) { log("Missing region: " + region); @@ -296,7 +296,7 @@ public class TestRollingRestart { } private NavigableSet getDoubleAssignedRegions( - MiniHBaseCluster cluster) throws IOException { + SingleProcessHBaseCluster cluster) throws IOException { NavigableSet online = new TreeSet<>(); NavigableSet doubled = new TreeSet<>(); for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRoundRobinAssignmentOnRestart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRoundRobinAssignmentOnRestart.java index 4acb7891154..2b63e13e7de 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRoundRobinAssignmentOnRestart.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRoundRobinAssignmentOnRestart.java @@ -25,8 +25,8 @@ import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -74,7 +74,7 @@ public class TestRoundRobinAssignmentOnRestart extends AbstractTestRestartCluste } UTIL.waitUntilNoRegionsInTransition(60000); - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); List threads = cluster.getLiveRegionServerThreads(); assertEquals(2, threads.size()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureCarryingMetaStuck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureCarryingMetaStuck.java index 7301c750f17..ed50c883a76 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureCarryingMetaStuck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureCarryingMetaStuck.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.AsyncAdmin; import org.apache.hadoop.hbase.client.AsyncConnection; @@ -47,7 +47,7 @@ public class TestServerCrashProcedureCarryingMetaStuck { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestServerCrashProcedureCarryingMetaStuck.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureStuck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureStuck.java index 5fb2f73f9fe..79bb53ec6e4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureStuck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestServerCrashProcedureStuck.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.AsyncAdmin; import org.apache.hadoop.hbase.client.AsyncConnection; @@ -50,7 +50,7 @@ public class TestServerCrashProcedureStuck { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestServerCrashProcedureStuck.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownBackupMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownBackupMaster.java index a42a4046d54..c776cb268e8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownBackupMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownBackupMaster.java @@ -23,10 +23,10 @@ import java.io.IOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; @@ -47,7 +47,7 @@ public class TestShutdownBackupMaster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestShutdownBackupMaster.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static volatile CountDownLatch ARRIVE; @@ -72,7 +72,7 @@ public class TestShutdownBackupMaster { @BeforeClass public static void setUpBeforeClass() throws Exception { UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, MockHMaster.class, HMaster.class); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(2).numRegionServers(2).numDataNodes(2).build(); UTIL.startMiniCluster(option); UTIL.waitUntilAllSystemRegionsAssigned(); @@ -86,7 +86,7 @@ public class TestShutdownBackupMaster { @Test public void testShutdownWhileBecomingActive() throws InterruptedException { - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); HMaster activeMaster = null; HMaster backupMaster = null; for (MasterThread t : cluster.getMasterThreads()) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownWithNoRegionServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownWithNoRegionServer.java index 16847a7e0df..f3a4cfff4e3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownWithNoRegionServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestShutdownWithNoRegionServer.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.master; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; @@ -38,7 +38,7 @@ public class TestShutdownWithNoRegionServer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestShutdownWithNoRegionServer.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java index 7804784eb67..e4d5b88d49d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java @@ -41,7 +41,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.SplitLogCounters; @@ -88,7 +88,7 @@ public class TestSplitLogManager { private Configuration conf; private int to; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; class DummyMasterServices extends MockNoopMasterServices { private ZKWatcher zkw; @@ -118,7 +118,7 @@ public class TestSplitLogManager { @Before public void setup() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniZKCluster(); conf = TEST_UTIL.getConfiguration(); // Use a different ZK wrapper instance for each tests. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitRegionWhileRSCrash.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitRegionWhileRSCrash.java index a55deb03317..611951565ea 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitRegionWhileRSCrash.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitRegionWhileRSCrash.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Put; @@ -55,7 +55,7 @@ public class TestSplitRegionWhileRSCrash { private static final Logger LOG = LoggerFactory .getLogger(TestSplitRegionWhileRSCrash.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); private static Admin admin; private static byte[] CF = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java index e1f318869ba..0ea0c9782a9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java @@ -27,7 +27,7 @@ import java.util.concurrent.CountDownLatch; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -67,7 +67,7 @@ public class TestSplitWALManager { HBaseClassTestRule.forClass(TestSplitWALManager.class); private static final Logger LOG = LoggerFactory.getLogger(TestSplitWALManager.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private HMaster master; private SplitWALManager splitWALManager; private TableName TABLE_NAME; @@ -75,7 +75,7 @@ public class TestSplitWALManager { @Before public void setup() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.getConfiguration().setBoolean(HBASE_SPLIT_WAL_COORDINATED_BY_ZK, false); TEST_UTIL.getConfiguration().setInt(HBASE_SPLIT_WAL_MAX_SPLITTER, 1); TEST_UTIL.startMiniCluster(3); @@ -212,7 +212,7 @@ public class TestSplitWALManager { Assert.assertEquals(0, metaWals.size()); } - private void splitLogsTestHelper(HBaseTestingUtility testUtil) throws Exception { + private void splitLogsTestHelper(HBaseTestingUtil testUtil) throws Exception { HMaster hmaster = testUtil.getHBaseCluster().getMaster(); SplitWALManager splitWALManager = hmaster.getSplitWALManager(); LOG.info("The Master FS is pointing to: " + hmaster.getMasterFileSystem() @@ -247,7 +247,7 @@ public class TestSplitWALManager { @Test public void testSplitLogsWithDifferentWalAndRootFS() throws Exception{ - HBaseTestingUtility testUtil2 = new HBaseTestingUtility(); + HBaseTestingUtil testUtil2 = new HBaseTestingUtil(); testUtil2.getConfiguration().setBoolean(HBASE_SPLIT_WAL_COORDINATED_BY_ZK, false); testUtil2.getConfiguration().setInt(HBASE_SPLIT_WAL_MAX_SPLITTER, 1); Path dir = TEST_UTIL.getDataTestDirOnTestFS("testWalDir"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java index 03564bb45ea..1f17480dce6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestWarmupRegion.java @@ -23,8 +23,8 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.CompactionState; @@ -63,7 +63,7 @@ public class TestWarmupRegion { private static final Logger LOG = LoggerFactory.getLogger(TestWarmupRegion.class); protected TableName TABLENAME = TableName.valueOf("testPurgeFutureDeletes"); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte [] ROW = Bytes.toBytes("testRow"); private static byte [] FAMILY = Bytes.toBytes("testFamily"); private static byte [] QUALIFIER = Bytes.toBytes("testQualifier"); @@ -71,7 +71,7 @@ public class TestWarmupRegion { private static byte[] COLUMN = Bytes.toBytes("column"); private static int numRows = 10000; protected static int SLAVES = 3; - private static MiniHBaseCluster myCluster; + private static SingleProcessHBaseCluster myCluster; private static Table table; /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/AssignmentTestingUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/AssignmentTestingUtil.java index 97fa2c006f8..cd13905855c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/AssignmentTestingUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/AssignmentTestingUtil.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotNull; import java.io.IOException; import java.util.Set; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -47,14 +47,14 @@ public final class AssignmentTestingUtil { private AssignmentTestingUtil() {} - public static void waitForRegionToBeInTransition(final HBaseTestingUtility util, + public static void waitForRegionToBeInTransition(final HBaseTestingUtil util, final RegionInfo hri) throws Exception { while (!getMaster(util).getAssignmentManager().getRegionStates().isRegionInTransition(hri)) { Threads.sleep(10); } } - public static void waitForRsToBeDead(final HBaseTestingUtility util, + public static void waitForRsToBeDead(final HBaseTestingUtil util, final ServerName serverName) throws Exception { util.waitFor(60000, new ExplainingPredicate() { @Override @@ -69,21 +69,21 @@ public final class AssignmentTestingUtil { }); } - public static void stopRs(final HBaseTestingUtility util, final ServerName serverName) + public static void stopRs(final HBaseTestingUtil util, final ServerName serverName) throws Exception { LOG.info("STOP REGION SERVER " + serverName); util.getMiniHBaseCluster().stopRegionServer(serverName); waitForRsToBeDead(util, serverName); } - public static void killRs(final HBaseTestingUtility util, final ServerName serverName) + public static void killRs(final HBaseTestingUtil util, final ServerName serverName) throws Exception { LOG.info("KILL REGION SERVER " + serverName); util.getMiniHBaseCluster().killRegionServer(serverName); waitForRsToBeDead(util, serverName); } - public static void crashRs(final HBaseTestingUtility util, final ServerName serverName, + public static void crashRs(final HBaseTestingUtil util, final ServerName serverName, final boolean kill) throws Exception { if (kill) { killRs(util, serverName); @@ -92,14 +92,14 @@ public final class AssignmentTestingUtil { } } - public static ServerName crashRsWithRegion(final HBaseTestingUtility util, + public static ServerName crashRsWithRegion(final HBaseTestingUtil util, final RegionInfo hri, final boolean kill) throws Exception { ServerName serverName = getServerHoldingRegion(util, hri); crashRs(util, serverName, kill); return serverName; } - public static ServerName getServerHoldingRegion(final HBaseTestingUtility util, + public static ServerName getServerHoldingRegion(final HBaseTestingUtil util, final RegionInfo hri) throws Exception { ServerName serverName = util.getMiniHBaseCluster().getServerHoldingRegion( hri.getTable(), hri.getRegionName()); @@ -113,7 +113,7 @@ public final class AssignmentTestingUtil { return serverName; } - public static boolean isServerHoldingMeta(final HBaseTestingUtility util, + public static boolean isServerHoldingMeta(final HBaseTestingUtil util, final ServerName serverName) throws Exception { for (RegionInfo hri: getMetaRegions(util)) { if (serverName.equals(getServerHoldingRegion(util, hri))) { @@ -123,11 +123,11 @@ public final class AssignmentTestingUtil { return false; } - public static Set getMetaRegions(final HBaseTestingUtility util) { + public static Set getMetaRegions(final HBaseTestingUtil util) { return getMaster(util).getAssignmentManager().getMetaRegionSet(); } - private static HMaster getMaster(final HBaseTestingUtility util) { + private static HMaster getMaster(final HBaseTestingUtil util) { return util.getMiniHBaseCluster().getMaster(); } @@ -157,7 +157,7 @@ public final class AssignmentTestingUtil { return true; } - public static void insertData(final HBaseTestingUtility UTIL, final TableName tableName, + public static void insertData(final HBaseTestingUtil UTIL, final TableName tableName, int rowCount, int startRowNum, String... cfs) throws IOException { Table t = UTIL.getConnection().getTable(tableName); Put p; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignRegionToUninitializedRegionServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignRegionToUninitializedRegionServer.java index 289016f7a33..38f11391fd2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignRegionToUninitializedRegionServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignRegionToUninitializedRegionServer.java @@ -28,7 +28,7 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.HRegionServer; @@ -106,7 +106,7 @@ public class TestAssignRegionToUninitializedRegionServer { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java index a631fe62679..be3bb24d2df 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java @@ -25,7 +25,7 @@ import java.util.Collections; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -229,7 +229,7 @@ public class TestAssignmentManager extends TestAssignmentManagerBase { public void testAssignMetaAndCrashBeforeResponse() throws Exception { tearDown(); // See setUp(), start HBase until set up meta - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); this.executor = Executors.newSingleThreadScheduledExecutor(); setupConfiguration(util.getConfiguration()); master = new MockMasterServices(util.getConfiguration(), this.regionsToRegionServers); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerBase.java index 85255d29dcf..02e8600ae4e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerBase.java @@ -39,7 +39,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CallQueueTooBigException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.ServerMetricsBuilder; import org.apache.hadoop.hbase.ServerName; @@ -103,7 +103,7 @@ public abstract class TestAssignmentManagerBase { protected static final int NREGIONS = 1 * 1000; protected static final int NSERVERS = Math.max(1, NREGIONS / 100); - protected HBaseTestingUtility util; + protected HBaseTestingUtil util; protected MockRSProcedureDispatcher rsDispatcher; protected MockMasterServices master; protected AssignmentManager am; @@ -153,7 +153,7 @@ public abstract class TestAssignmentManagerBase { @Before public void setUp() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); this.executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder() .setUncaughtExceptionHandler((t, e) -> LOG.warn("Uncaught: ", e)).build()); setupConfiguration(util.getConfiguration()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerLoadMetaRegionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerLoadMetaRegionState.java index 959738b4758..5bb9f855751 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerLoadMetaRegionState.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerLoadMetaRegionState.java @@ -25,7 +25,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -44,7 +44,7 @@ public class TestAssignmentManagerLoadMetaRegionState { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAssignmentManagerLoadMetaRegionState.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerUtil.java index e407faf46b6..f5216d45d3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManagerUtil.java @@ -28,7 +28,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseIOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.RegionInfo; @@ -52,7 +52,7 @@ public class TestAssignmentManagerUtil { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestAssignmentManagerUtil.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("AM"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentOnRSCrash.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentOnRSCrash.java index 5673ed86676..9ec5110df91 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentOnRSCrash.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentOnRSCrash.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; @@ -58,7 +58,7 @@ public class TestAssignmentOnRSCrash { private static final byte[] FAMILY = Bytes.toBytes(FAMILY_STR); private static final int NUM_RS = 3; - private HBaseTestingUtility UTIL; + private HBaseTestingUtil UTIL; private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); @@ -67,7 +67,7 @@ public class TestAssignmentOnRSCrash { @Before public void setup() throws Exception { - UTIL = new HBaseTestingUtility(); + UTIL = new HBaseTestingUtil(); setupConf(UTIL.getConfiguration()); UTIL.startMiniCluster(NUM_RS); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestCloseRegionWhileRSCrash.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestCloseRegionWhileRSCrash.java index 75f73e5087b..f159926e06f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestCloseRegionWhileRSCrash.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestCloseRegionWhileRSCrash.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.assignment; import java.io.IOException; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ProcedureTestUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -61,7 +61,7 @@ public class TestCloseRegionWhileRSCrash { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCloseRegionWhileRSCrash.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("Backoff"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestDeadServerMetricRegionChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestDeadServerMetricRegionChore.java index 2fbd30373f9..3034d8b778e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestDeadServerMetricRegionChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestDeadServerMetricRegionChore.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.master.assignment; import static org.junit.Assert.fail; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.After; @@ -38,11 +38,11 @@ public class TestDeadServerMetricRegionChore { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDeadServerMetricRegionChore.class); - protected HBaseTestingUtility util; + protected HBaseTestingUtil util; @Before public void setUp() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); // Disable DeadServerMetricRegionChore util.getConfiguration() .setInt(AssignmentManager.DEAD_REGION_METRIC_CHORE_INTERVAL_MSEC_CONF_KEY, -1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInAssignRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInAssignRegion.java index 24b6dfab79f..ad9c50ea72c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInAssignRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInAssignRegion.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.assignment; import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -49,7 +49,7 @@ public class TestExceptionInAssignRegion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestExceptionInAssignRegion.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInUnassignedRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInUnassignedRegion.java index bdaff5aef7c..c7aab794570 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInUnassignedRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestExceptionInUnassignedRegion.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.master.assignment; import java.util.Optional; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; @@ -48,7 +48,7 @@ public class TestExceptionInUnassignedRegion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestExceptionInUnassignedRegion.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMasterAbortWhileMergingTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMasterAbortWhileMergingTable.java index c60c86aa930..c119ba8e66a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMasterAbortWhileMergingTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMasterAbortWhileMergingTable.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Mutation; @@ -54,7 +54,7 @@ public class TestMasterAbortWhileMergingTable { private static final Logger LOG = LoggerFactory .getLogger(TestMasterAbortWhileMergingTable.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); private static Admin admin; private static byte[] CF = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMergeTableRegionsProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMergeTableRegionsProcedure.java index f0912537fcd..471f0def9b4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMergeTableRegionsProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestMergeTableRegionsProcedure.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -70,7 +70,7 @@ public class TestMergeTableRegionsProcedure { @Rule public final TestName name = new TestName(); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final int initialRegionCount = 4; private final static byte[] FAMILY = Bytes.toBytes("FAMILY"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestModifyTableWhileMerging.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestModifyTableWhileMerging.java index 814ba27ee3d..29964464e11 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestModifyTableWhileMerging.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestModifyTableWhileMerging.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.assignment; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.RegionInfo; @@ -55,7 +55,7 @@ public class TestModifyTableWhileMerging { private static final Logger LOG = LoggerFactory .getLogger(TestModifyTableWhileMerging.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); private static Admin admin; private static Table client; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureBackoff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureBackoff.java index 4112da713c1..12ea4266fce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureBackoff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureBackoff.java @@ -23,7 +23,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ProcedureTestUtil; import org.apache.hadoop.hbase.TableName; @@ -80,7 +80,7 @@ public class TestOpenRegionProcedureBackoff { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Open"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureHang.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureHang.java index a25368f4e42..6fd4fb288d1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureHang.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestOpenRegionProcedureHang.java @@ -22,10 +22,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -130,7 +130,7 @@ public class TestOpenRegionProcedureHang { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Open"); @@ -144,8 +144,8 @@ public class TestOpenRegionProcedureHang { // make sure we do not timeout when caling reportRegionStateTransition conf.setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 10 * 60 * 1000); conf.setInt(HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY, 10 * 60 * 1000); - UTIL - .startMiniCluster(StartMiniClusterOption.builder().numMasters(2).numRegionServers(3).build()); + UTIL.startMiniCluster( + StartTestingClusterOption.builder().numMasters(2).numRegionServers(3).build()); UTIL.createTable(NAME, CF); UTIL.waitTableAvailable(NAME); UTIL.getAdmin().balancerSwitch(false, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java index a268af9c6d6..cca566381b5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndDTP.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -57,7 +57,7 @@ public class TestRaceBetweenSCPAndDTP { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRaceBetweenSCPAndDTP.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Race"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java index a1b25e05455..788df3f23e3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java @@ -23,7 +23,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -53,7 +53,7 @@ public class TestRaceBetweenSCPAndTRSP { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRaceBetweenSCPAndTRSP.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Race"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionAssignedToMultipleRegionServers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionAssignedToMultipleRegionServers.java index 700523c8455..da632d01dfc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionAssignedToMultipleRegionServers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionAssignedToMultipleRegionServers.java @@ -26,11 +26,11 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -125,7 +125,7 @@ public class TestRegionAssignedToMultipleRegionServers { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Assign"); @@ -134,8 +134,8 @@ public class TestRegionAssignedToMultipleRegionServers { @BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, HMasterForTest.class, HMaster.class); - UTIL - .startMiniCluster(StartMiniClusterOption.builder().numMasters(2).numRegionServers(2).build()); + UTIL.startMiniCluster( + StartTestingClusterOption.builder().numMasters(2).numRegionServers(2).build()); UTIL.createTable(NAME, CF); UTIL.waitTableAvailable(NAME); UTIL.getAdmin().balancerSwitch(false, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionBypass.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionBypass.java index 8f1599708ae..a1465593d16 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionBypass.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionBypass.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -66,7 +66,7 @@ public class TestRegionBypass { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private TableName tableName; @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionMoveAndAbandon.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionMoveAndAbandon.java index cc8335aa25a..46e91da943b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionMoveAndAbandon.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionMoveAndAbandon.java @@ -19,9 +19,9 @@ package org.apache.hadoop.hbase.master.assignment; import static org.junit.Assert.assertEquals; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Get; @@ -57,8 +57,8 @@ public class TestRegionMoveAndAbandon { @Rule public TestName name = new TestName(); - private HBaseTestingUtility UTIL; - private MiniHBaseCluster cluster; + private HBaseTestingUtil UTIL; + private SingleProcessHBaseCluster cluster; private MiniZooKeeperCluster zkCluster; private HRegionServer rs1; private HRegionServer rs2; @@ -67,9 +67,10 @@ public class TestRegionMoveAndAbandon { @Before public void setup() throws Exception { - UTIL = new HBaseTestingUtility(); + UTIL = new HBaseTestingUtil(); zkCluster = UTIL.startMiniZKCluster(); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(2).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(2).build(); cluster = UTIL.startMiniHBaseCluster(option); rs1 = cluster.getRegionServer(0); rs2 = cluster.getRegionServer(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionReplicaSplit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionReplicaSplit.java index 484e81c8521..f308a71299d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionReplicaSplit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionReplicaSplit.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -62,7 +62,7 @@ public class TestRegionReplicaSplit { private static final int NB_SERVERS = 4; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; @BeforeClass @@ -153,7 +153,7 @@ public class TestRegionReplicaSplit { // To test AssignProcedure can defend this case. HTU.getMiniHBaseCluster().getMaster().getAssignmentManager().assign(fakeHri); // Wait until all assigns are done. - HBaseTestingUtility.await(50, () -> { + HBaseTestingUtil.await(50, () -> { return HTU.getMiniHBaseCluster().getMaster().getMasterProcedureExecutor().getActiveProcIds() .isEmpty(); }); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplit.java index a64795aaa3f..62f966a4334 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplit.java @@ -24,9 +24,9 @@ import java.util.List; import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -60,7 +60,7 @@ public class TestRegionSplit { private static final Logger LOG = LoggerFactory.getLogger(TestRegionSplit.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String columnFamilyName = "cf"; @@ -76,8 +76,8 @@ public class TestRegionSplit { @BeforeClass public static void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); - StartMiniClusterOption option = - StartMiniClusterOption.builder().numMasters(1).numRegionServers(3).numDataNodes(3).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numMasters(1).numRegionServers(3).numDataNodes(3).build(); UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplitAndSeparateChildren.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplitAndSeparateChildren.java index 18aa2f84b3f..317782fcc00 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplitAndSeparateChildren.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionSplitAndSeparateChildren.java @@ -21,10 +21,10 @@ import java.util.List; import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -63,7 +63,7 @@ public class TestRegionSplitAndSeparateChildren { private static final Logger LOG = LoggerFactory.getLogger( TestRegionSplitAndSeparateChildren.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String columnFamilyName = "cf"; @@ -81,8 +81,8 @@ public class TestRegionSplitAndSeparateChildren { @BeforeClass public static void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); - StartMiniClusterOption option = - StartMiniClusterOption.builder().numMasters(1).numRegionServers(3).numDataNodes(3).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numMasters(1).numRegionServers(3).numDataNodes(3).build(); UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStateStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStateStore.java index 7258cc1cdfa..83e5431a818 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStateStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStateStore.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.ServerName; @@ -72,7 +72,7 @@ public class TestRegionStateStore { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionStateStore.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public final TableNameTestRule name = new TableNameTestRule(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStates.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStates.java index c887e3ae4c5..75bd310138a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStates.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRegionStates.java @@ -26,7 +26,7 @@ import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -56,7 +56,7 @@ public class TestRegionStates { private static final Logger LOG = LoggerFactory.getLogger(TestRegionStates.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static ThreadPoolExecutor threadPool; private static ExecutorCompletionService executorService; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportOnlineRegionsRace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportOnlineRegionsRace.java index 4dede898864..b25b83db2dd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportOnlineRegionsRace.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportOnlineRegionsRace.java @@ -26,7 +26,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; @@ -115,7 +115,7 @@ public class TestReportOnlineRegionsRace { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Race"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java index 1de806fe0ff..68d1e3584c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionFromDeadServer.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeoutException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseIOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; @@ -132,7 +132,7 @@ public class TestReportRegionStateTransitionFromDeadServer { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Report"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionRetry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionRetry.java index 71c4693cfa6..f4938924375 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionRetry.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestReportRegionStateTransitionRetry.java @@ -25,7 +25,7 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.TableName; @@ -93,7 +93,7 @@ public class TestReportRegionStateTransitionRetry { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Retry"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java index 932941c279a..ead36a1ff3d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java @@ -25,9 +25,9 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.YouAreDeadException; import org.apache.hadoop.hbase.client.Admin; @@ -83,10 +83,10 @@ public class TestRogueRSAssignment { private static final int initialRegionCount = 3; private final static byte[] FAMILY = Bytes.toBytes("FAMILY"); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration conf = UTIL.getConfiguration(); private static Admin admin; - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static HMaster master; private static void setupConf(Configuration conf) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSCPGetRegionsRace.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSCPGetRegionsRace.java index d676af92939..8b85c2d9141 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSCPGetRegionsRace.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSCPGetRegionsRace.java @@ -27,10 +27,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -145,7 +145,7 @@ public class TestSCPGetRegionsRace { } } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Assign"); @@ -153,7 +153,7 @@ public class TestSCPGetRegionsRace { @BeforeClass public static void setUp() throws Exception { - UTIL.startMiniCluster(StartMiniClusterOption.builder().masterClass(HMasterForTest.class) + UTIL.startMiniCluster(StartTestingClusterOption.builder().masterClass(HMasterForTest.class) .numMasters(1).numRegionServers(3).build()); UTIL.createTable(NAME, CF); UTIL.waitTableAvailable(NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSplitTableRegionProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSplitTableRegionProcedure.java index 4e07b9a8808..bbcce85c426 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSplitTableRegionProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestSplitTableRegionProcedure.java @@ -29,7 +29,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -71,7 +71,7 @@ public class TestSplitTableRegionProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestSplitTableRegionProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String columnFamilyName1 = "cf1"; private static String columnFamilyName2 = "cf2"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java index 477069092fd..0da36a4a98a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -54,7 +54,7 @@ public class TestTransitRegionStateProcedure { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestTransitRegionStateProcedure.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static byte[] CF = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestWakeUpUnexpectedProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestWakeUpUnexpectedProcedure.java index 62e31615def..2a19b0a2875 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestWakeUpUnexpectedProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestWakeUpUnexpectedProcedure.java @@ -26,11 +26,11 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -75,7 +75,7 @@ public class TestWakeUpUnexpectedProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestWakeUpUnexpectedProcedure.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Assign"); @@ -215,7 +215,7 @@ public class TestWakeUpUnexpectedProcedure { @BeforeClass public static void setUp() throws Exception { - UTIL.startMiniCluster(StartMiniClusterOption.builder().numMasters(1) + UTIL.startMiniCluster(StartTestingClusterOption.builder().numMasters(1) .masterClass(HMasterForTest.class).numRegionServers(3).rsClass(RSForTest.class).build()); UTIL.createTable(NAME, CF); // Here the test region must not be hosted on the same rs with meta region. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBalancerStatusTagInJMXMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBalancerStatusTagInJMXMetrics.java index d23436d3b4c..2ff1153cdcd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBalancerStatusTagInJMXMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBalancerStatusTagInJMXMetrics.java @@ -22,8 +22,8 @@ import static org.junit.Assert.assertEquals; import java.util.Random; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.metrics2.MetricsSource; @@ -45,10 +45,10 @@ public class TestBalancerStatusTagInJMXMetrics extends BalancerTestBase { HBaseClassTestRule.forClass(TestBalancerStatusTagInJMXMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestBalancerStatusTagInJMXMetrics.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static int connectorPort = 61120; private static HMaster master; - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static Configuration conf = null; /** @@ -62,7 +62,7 @@ public class TestBalancerStatusTagInJMXMetrics extends BalancerTestBase { do { int sign = i % 2 == 0 ? 1 : -1; connectorPort += sign * rand.nextInt(100); - } while (!HBaseTestingUtility.available(connectorPort)); + } while (!HBaseTestingUtil.available(connectorPort)); try { conf.setInt("regionserver.rmi.registry.port", connectorPort); cluster = UTIL.startMiniCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredNodeTableImport.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredNodeTableImport.java index 40345e88653..4489c421d6f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredNodeTableImport.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredNodeTableImport.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -64,7 +64,7 @@ public class TestFavoredNodeTableImport { private static final int SLAVES = 3; private static final int REGION_NUM = 20; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration conf = UTIL.getConfiguration(); @After diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticBalancerPickers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticBalancerPickers.java index 7c695219b06..1a447d2a98f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticBalancerPickers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticBalancerPickers.java @@ -31,10 +31,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -78,13 +78,13 @@ public class TestFavoredStochasticBalancerPickers extends BalancerTestBase { private static final Logger LOG = LoggerFactory.getLogger(TestFavoredStochasticBalancerPickers.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int SLAVES = 6; private static final int REGIONS = SLAVES * 3; private static Configuration conf; private Admin admin; - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java index d3e1e83316e..02a3e65c631 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestFavoredStochasticLoadBalancer.java @@ -34,10 +34,10 @@ import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -82,13 +82,13 @@ public class TestFavoredStochasticLoadBalancer extends BalancerTestBase { private static final Logger LOG = LoggerFactory.getLogger(TestFavoredStochasticLoadBalancer.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int SLAVES = 8; private static final int REGION_NUM = SLAVES * 3; private Admin admin; private HMaster master; - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticBalancerJmxMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticBalancerJmxMetrics.java index 99fbceef898..aec763cb8ef 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticBalancerJmxMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticBalancerJmxMetrics.java @@ -36,7 +36,7 @@ import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.JMXListener; import org.apache.hadoop.hbase.ServerName; @@ -68,7 +68,7 @@ public class TestStochasticBalancerJmxMetrics extends BalancerTestBase { HBaseClassTestRule.forClass(TestStochasticBalancerJmxMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestStochasticBalancerJmxMetrics.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static int connectorPort = 61120; private static StochasticLoadBalancer loadBalancer; /** @@ -102,7 +102,7 @@ public class TestStochasticBalancerJmxMetrics extends BalancerTestBase { do { int sign = i % 2 == 0 ? 1 : -1; connectorPort += sign * rand.nextInt(100); - } while (!HBaseTestingUtility.available(connectorPort)); + } while (!HBaseTestingUtil.available(connectorPort)); try { conf.setInt("regionserver.rmi.registry.port", connectorPort); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS.java index 7d52f5afed0..b0e8cf3ab79 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS.java @@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hdfs.DistributedFileSystem; @@ -45,7 +45,7 @@ public class TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS HBaseClassTestRule.forClass(TestStochasticLoadBalancerHeterogeneousCostRulesLoadFromHDFS.class); private HeterogeneousRegionCountCostFunction costFunction; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @Before public void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestCleanerChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestCleanerChore.java index 90c814682fc..0f75030cf83 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestCleanerChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestCleanerChore.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FilterFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -56,7 +56,7 @@ public class TestCleanerChore { HBaseClassTestRule.forClass(TestCleanerChore.class); private static final Logger LOG = LoggerFactory.getLogger(TestCleanerChore.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static DirScanPool POOL; @BeforeClass @@ -313,7 +313,7 @@ public class TestCleanerChore { Stoppable stop = new StoppableImplementation(); // need to use a localutil to not break the rest of the test that runs on the local FS, which // gets hosed when we start to use a minicluster. - HBaseTestingUtility localUtil = new HBaseTestingUtility(); + HBaseTestingUtil localUtil = new HBaseTestingUtil(); Configuration conf = localUtil.getConfiguration(); final Path testDir = UTIL.getDataTestDir(); final FileSystem fs = UTIL.getTestFileSystem(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java index 7e882cd5a78..6d08a5045bd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableName; @@ -63,7 +63,7 @@ public class TestHFileCleaner { private static final Logger LOG = LoggerFactory.getLogger(TestHFileCleaner.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static DirScanPool POOL; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java index f3e7f34d7e0..5f92e34462c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -58,7 +58,7 @@ public class TestHFileLinkCleaner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHFileLinkCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static DirScanPool POOL; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java index b465e9bcbaa..d00aec849d8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java @@ -42,7 +42,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.Waiter; @@ -78,7 +78,7 @@ public class TestLogsCleaner { HBaseClassTestRule.forClass(TestLogsCleaner.class); private static final Logger LOG = LoggerFactory.getLogger(TestLogsCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Path OLD_WALS_DIR = new Path(TEST_UTIL.getDataTestDir(), HConstants.HREGION_OLDLOGDIR_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationBarrierCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationBarrierCleaner.java index 144a6f92b0b..9acba4c4a98 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationBarrierCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationBarrierCleaner.java @@ -33,7 +33,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; @@ -77,7 +77,7 @@ public class TestReplicationBarrierCleaner { private static final Logger LOG = LoggerFactory.getLogger(TestHFileCleaner.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public final TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationHFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationHFileCleaner.java index f21ae926052..f44ff284c6d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationHFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestReplicationHFileCleaner.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ZooKeeperConnectionException; @@ -77,7 +77,7 @@ public class TestReplicationHFileCleaner { HBaseClassTestRule.forClass(TestReplicationHFileCleaner.class); private static final Logger LOG = LoggerFactory.getLogger(TestReplicationHFileCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Server server; private static ReplicationQueueStorage rq; private static ReplicationPeers rp; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java index 1a28950915a..56e62b6d1e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotCleanerChore.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; import org.apache.hadoop.hbase.testclassification.MasterTests; @@ -52,7 +52,7 @@ public class TestSnapshotCleanerChore { private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotCleanerChore.class); - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); private SnapshotManager snapshotManager; @@ -130,7 +130,7 @@ public class TestSnapshotCleanerChore { public void testSnapshotCleanerWithReadIOE() throws IOException { snapshotManager = Mockito.mock(SnapshotManager.class); Stoppable stopper = new StoppableImplementation(); - Configuration conf = new HBaseTestingUtility().getConfiguration(); + Configuration conf = new HBaseTestingUtil().getConfiguration(); SnapshotCleanerChore snapshotCleanerChore = new SnapshotCleanerChore(stopper, conf, snapshotManager); Mockito.when(snapshotManager.getCompletedSnapshots()).thenThrow(IOException.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java index c0e3be74338..08a7b5ce9ec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -100,7 +100,7 @@ public class TestSnapshotFromMaster { HBaseClassTestRule.forClass(TestSnapshotFromMaster.class); private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotFromMaster.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final int NUM_RS = 2; private static Path rootDir; private static FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java index 83436f9a6ea..bc1dea93736 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java @@ -39,7 +39,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaMockingUtil; import org.apache.hadoop.hbase.ServerName; @@ -86,7 +86,7 @@ public class TestCatalogJanitor { private static final Logger LOG = LoggerFactory.getLogger(TestCatalogJanitor.class); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @Rule public final TestName name = new TestName(); @@ -603,7 +603,7 @@ public class TestCatalogJanitor { return storeFiles; } - private String setRootDirAndCleanIt(final HBaseTestingUtility htu, final String subdir) + private String setRootDirAndCleanIt(final HBaseTestingUtil htu, final String subdir) throws IOException { Path testdir = htu.getDataTestDir(subdir); FileSystem fs = FileSystem.get(htu.getConfiguration()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorCluster.java index 7ff39c035aa..f1ef9377a6b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorCluster.java @@ -28,7 +28,7 @@ import java.util.LinkedList; import java.util.List; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -62,7 +62,7 @@ public class TestCatalogJanitorCluster { @Rule public final TestName name = new TestName(); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName T1 = TableName.valueOf("t1"); private static final TableName T2 = TableName.valueOf("t2"); private static final TableName T3 = TableName.valueOf("t3"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorInMemoryStates.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorInMemoryStates.java index 5ac20fc274e..623bf9d8e7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorInMemoryStates.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitorInMemoryStates.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.concurrent.ExecutionException; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaMockingUtil; import org.apache.hadoop.hbase.MetaTableAccessor; @@ -73,7 +73,7 @@ public class TestCatalogJanitorInMemoryStates { private static final Logger LOG = LoggerFactory.getLogger(TestCatalogJanitorInMemoryStates.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte[] FAMILY = Bytes.toBytes("testFamily"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestMetaFixer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestMetaFixer.java index 063a39ec9dd..6a0740d7c75 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestMetaFixer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestMetaFixer.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -72,7 +72,7 @@ public class TestMetaFixer { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { @@ -121,7 +121,7 @@ public class TestMetaFixer { // wait for RITs to settle -- those are the fixed regions being assigned -- or until the // watchdog TestRule terminates the test. - HBaseTestingUtility.await(50, + HBaseTestingUtil.await(50, () -> services.getMasterProcedureExecutor().getActiveProcIds().size() == 0); ris = MetaTableAccessor.getTableRegions(TEST_UTIL.getConnection(), tn); @@ -212,7 +212,7 @@ public class TestMetaFixer { MetaFixer fixer = new MetaFixer(services); fixer.fixOverlaps(report); - HBaseTestingUtility. await(10, () -> { + HBaseTestingUtil. await(10, () -> { try { if (cj.scan() > 0) { // It submits GC once, then it will immediately kick off another GC to test if @@ -236,7 +236,7 @@ public class TestMetaFixer { }); // Wait until all GCs settled down - HBaseTestingUtility.await(10, () -> { + HBaseTestingUtil.await(10, () -> { return services.getMasterProcedureExecutor().getActiveProcIds().isEmpty(); }); @@ -314,7 +314,7 @@ public class TestMetaFixer { fixer.fixOverlaps(report); AssignmentManager am = services.getAssignmentManager(); - HBaseTestingUtility.await(200, () -> { + HBaseTestingUtil.await(200, () -> { try { cj.scan(); final Report postReport = cj.getLastReport(); @@ -345,7 +345,7 @@ public class TestMetaFixer { report = cj.getLastReport(); fixer.fixOverlaps(report); - HBaseTestingUtility.await(20, () -> { + HBaseTestingUtil.await(20, () -> { try { // Make sure it GC only once. return (cj.scan() > 0); @@ -413,7 +413,7 @@ public class TestMetaFixer { fixer.fixOverlaps(report); // Wait until all procedures settled down - HBaseTestingUtility.await(200, () -> { + HBaseTestingUtil.await(200, () -> { return services.getMasterProcedureExecutor().getActiveProcIds().isEmpty(); }); @@ -425,7 +425,7 @@ public class TestMetaFixer { fixer.fixOverlaps(report); // Wait until all procedures settled down - HBaseTestingUtility.await(200, () -> { + HBaseTestingUtil.await(200, () -> { return services.getMasterProcedureExecutor().getActiveProcIds().isEmpty(); }); @@ -468,7 +468,7 @@ public class TestMetaFixer { assertEquals(1, MetaFixer.calculateMerges(10, report.getOverlaps()).size()); MetaFixer fixer = new MetaFixer(services); fixer.fixOverlaps(report); - HBaseTestingUtility.await(10, () -> { + HBaseTestingUtil.await(10, () -> { try { services.getCatalogJanitor().scan(); final Report postReport = services.getCatalogJanitor().getLastReport(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockManager.java index 6860b7ad435..5b6082ee3e9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockManager.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -62,7 +62,7 @@ public class TestLockManager { private static final int LOCAL_LOCKS_TIMEOUT = 1000; private static final Logger LOG = LoggerFactory.getLogger(TestLockManager.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static MasterServices masterServices; private static String namespace = "namespace"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockProcedure.java index 049e0606b33..822ae9bcd4c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockProcedure.java @@ -28,7 +28,7 @@ import java.util.concurrent.TimeoutException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -82,7 +82,7 @@ public class TestLockProcedure { private static final int LOCAL_LOCKS_TIMEOUT = 4000; private static final Logger LOG = LoggerFactory.getLogger(TestLockProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static MasterRpcServices masterRpcService; private static ProcedureExecutor procExec; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerManagerConfigurationObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerManagerConfigurationObserver.java index cfbd6bd4225..3e96f4b3ea9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerManagerConfigurationObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerManagerConfigurationObserver.java @@ -24,7 +24,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.conf.ConfigurationManager; import org.apache.hadoop.hbase.master.MasterServices; @@ -49,7 +49,7 @@ public class TestRegionNormalizerManagerConfigurationObserver { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionNormalizerManagerConfigurationObserver.class); - private static final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private static final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private static final Pattern rateLimitPattern = Pattern.compile("RateLimiter\\[stableRate=(?.+)qps]"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorker.java index ad743e13dad..53f10b73b30 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorker.java @@ -38,7 +38,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.Waiter; @@ -93,7 +93,7 @@ public class TestRegionNormalizerWorker { @Mock private RegionNormalizer regionNormalizer; - private HBaseCommonTestingUtility testingUtility; + private HBaseCommonTestingUtil testingUtility; private RegionNormalizerWorkQueue queue; private ExecutorService workerPool; @@ -103,7 +103,7 @@ public class TestRegionNormalizerWorker { public void before() throws Exception { MockitoAnnotations.initMocks(this); when(masterServices.skipRegionManagementAction(any())).thenReturn(false); - testingUtility = new HBaseCommonTestingUtility(); + testingUtility = new HBaseCommonTestingUtil(); queue = new RegionNormalizerWorkQueue<>(); workerThreadThrowable.set(null); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java index 3cc9168b434..4abafe4a525 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java @@ -32,7 +32,7 @@ import java.util.Comparator; import java.util.List; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MatcherPredicate; import org.apache.hadoop.hbase.NamespaceDescriptor; @@ -86,7 +86,7 @@ public class TestSimpleRegionNormalizerOnCluster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSimpleRegionNormalizerOnCluster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY_NAME = Bytes.toBytes("fam"); private static AsyncAdmin admin; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java index 7ea6a107c3b..c26d199cf3d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.Random; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.lang3.ArrayUtils; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -42,7 +42,7 @@ import org.apache.hbase.thirdparty.org.apache.commons.cli.Option; * Number of tables, regions and operations can be set using cli args. */ public class MasterProcedureSchedulerPerformanceEvaluation extends AbstractHBaseTool { - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // Command line options and defaults. public static final int DEFAULT_NUM_TABLES = 5; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.java index 96693e7ccc7..a3206432b81 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureTestingUtility.java @@ -32,12 +32,12 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.ClientMetaTableAccessor; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.BufferedMutator; @@ -130,9 +130,9 @@ public class MasterProcedureTestingUtility { // ========================================================================== // Master failover utils // ========================================================================== - public static void masterFailover(final HBaseTestingUtility testUtil) + public static void masterFailover(final HBaseTestingUtil testUtil) throws Exception { - MiniHBaseCluster cluster = testUtil.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = testUtil.getMiniHBaseCluster(); // Kill the master HMaster oldMaster = cluster.getMaster(); @@ -142,9 +142,9 @@ public class MasterProcedureTestingUtility { waitBackupMaster(testUtil, oldMaster); } - public static void waitBackupMaster(final HBaseTestingUtility testUtil, + public static void waitBackupMaster(final HBaseTestingUtil testUtil, final HMaster oldMaster) throws Exception { - MiniHBaseCluster cluster = testUtil.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = testUtil.getMiniHBaseCluster(); HMaster newMaster = cluster.getMaster(); while (newMaster == null || newMaster == oldMaster) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java index eb904b48a47..5bffea7ca52 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateNamespaceProcedure.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceExistException; import org.apache.hadoop.hbase.NamespaceNotFoundException; @@ -53,7 +53,7 @@ public class TestCreateNamespaceProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestCreateNamespaceProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateTableProcedureMuitipleRegions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateTableProcedureMuitipleRegions.java index 2aff487e892..10761e5c144 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateTableProcedureMuitipleRegions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestCreateTableProcedureMuitipleRegions.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.master.procedure; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -37,7 +37,7 @@ public class TestCreateTableProcedureMuitipleRegions { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCreateTableProcedureMuitipleRegions.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String F1 = "f1"; private static final String F2 = "f2"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java index 670d7a3ca09..adb528aaec7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteColumnFamilyProcedureFromClient.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.InvalidFamilyOperationException; import org.apache.hadoop.hbase.TableName; @@ -56,7 +56,7 @@ public class TestDeleteColumnFamilyProcedureFromClient { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDeleteColumnFamilyProcedureFromClient.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLENAME = TableName.valueOf("column_family_handlers"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java index 2f1a984a657..4a5f225c10e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestDeleteNamespaceProcedure.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.TableName; @@ -56,7 +56,7 @@ public class TestDeleteNamespaceProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestDeleteNamespaceProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestHBCKSCP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestHBCKSCP.java index a24b49d2f48..ff84afdabab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestHBCKSCP.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestHBCKSCP.java @@ -27,11 +27,11 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.Result; @@ -76,7 +76,7 @@ public class TestHBCKSCP extends TestSCPBase { @Test public void test() throws Exception { // we are about to do one for it? - MiniHBaseCluster cluster = this.util.getHBaseCluster(); + SingleProcessHBaseCluster cluster = this.util.getHBaseCluster(); // Assert that we have three RegionServers. Test depends on there being multiple. assertEquals(RS_COUNT, cluster.getLiveRegionServerThreads().size()); @@ -84,7 +84,7 @@ public class TestHBCKSCP extends TestSCPBase { int count; try (Table table = createTable(TableName.valueOf(this.name.getMethodName()))) { // Load the table with a bit of data so some logs to split and some edits in each region. - this.util.loadTable(table, HBaseTestingUtility.COLUMNS[0]); + this.util.loadTable(table, HBaseTestingUtil.COLUMNS[0]); count = util.countRows(table); } assertTrue("expected some rows", count > 0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestIgnoreUnknownFamily.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestIgnoreUnknownFamily.java index f173ea94d8b..06bacdb8c46 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestIgnoreUnknownFamily.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestIgnoreUnknownFamily.java @@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -50,7 +50,7 @@ public class TestIgnoreUnknownFamily { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestIgnoreUnknownFamily.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY = Bytes.toBytes("cf"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java index 5c1e6aaa15f..90902c89b23 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterFailoverWithProcedures.java @@ -22,8 +22,8 @@ import static org.junit.Assert.assertEquals; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -59,7 +59,7 @@ public class TestMasterFailoverWithProcedures { private static final Logger LOG = LoggerFactory.getLogger(TestMasterFailoverWithProcedures.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { // don't waste time retrying with the roll, the test is already slow enough. @@ -74,7 +74,7 @@ public class TestMasterFailoverWithProcedures { public void setup() throws Exception { setupConf(UTIL.getConfiguration()); // Set master number and use default values for other options. - StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(2).build(); UTIL.startMiniCluster(option); final ProcedureExecutor procExec = getMasterProcedureExecutor(); @@ -299,7 +299,7 @@ public class TestMasterFailoverWithProcedures { // ========================================================================== // Test Helpers // ========================================================================== - public static void testRecoveryAndDoubleExecution(final HBaseTestingUtility testUtil, + public static void testRecoveryAndDoubleExecution(final HBaseTestingUtil testUtil, final long procId, final int lastStepBeforeFailover) throws Exception { ProcedureExecutor procExec = testUtil.getHBaseCluster().getMaster().getMasterProcedureExecutor(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterObserverPostCalls.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterObserverPostCalls.java index 089a2a468a2..2d29aefc753 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterObserverPostCalls.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterObserverPostCalls.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -62,7 +62,7 @@ public class TestMasterObserverPostCalls { HBaseClassTestRule.forClass(TestMasterObserverPostCalls.class); private static final Logger LOG = LoggerFactory.getLogger(TestMasterObserverPostCalls.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setupCluster() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java index 947beed8493..a86b13c2a4b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestMasterProcedureEvents.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.RegionInfo; @@ -60,7 +60,7 @@ public class TestMasterProcedureEvents { private static final Logger LOG = LoggerFactory.getLogger(TestCreateTableProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java index 4622f79c43d..79ec0eb2b53 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -52,7 +52,7 @@ public class TestModifyNamespaceProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestModifyNamespaceProcedure.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java index bd0be29e5e3..01cfa8a501f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedureAdmin.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Random; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -55,7 +55,7 @@ public class TestProcedureAdmin { private static final Logger LOG = LoggerFactory.getLogger(TestProcedureAdmin.class); @Rule public TestName name = new TestName(); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedurePriority.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedurePriority.java index 3a01d16364d..f1b7d5763d8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedurePriority.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestProcedurePriority.java @@ -26,7 +26,7 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.client.AsyncAdmin; @@ -66,7 +66,7 @@ public class TestProcedurePriority { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestProcedurePriority.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String TABLE_NAME_PREFIX = "TestProcedurePriority-"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBackoff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBackoff.java index c512cae0eee..45d840b548d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBackoff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBackoff.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.RegionState.State; @@ -57,7 +57,7 @@ public class TestReopenTableRegionsProcedureBackoff { private static final Logger LOG = LoggerFactory.getLogger(TestReopenTableRegionsProcedureBackoff.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("Backoff"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureInfiniteLoop.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureInfiniteLoop.java index 870f3bf817a..6686a66ab81 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureInfiniteLoop.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureInfiniteLoop.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.master.procedure; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; @@ -47,7 +47,7 @@ public class TestReopenTableRegionsProcedureInfiniteLoop { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestReopenTableRegionsProcedureInfiniteLoop.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("InfiniteLoop"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCP.java index 72b1ef8f29e..c7505c39da1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCP.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCP.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -56,8 +56,8 @@ public class TestSCP extends TestSCPBase { final TableName tableName = TableName.valueOf("testConcurrentSCPForSameServer"); try (Table t = createTable(tableName)) { // Load the table with a bit of data so some logs to split and some edits in each region. - this.util.loadTable(t, HBaseTestingUtility.COLUMNS[0]); - final int count = HBaseTestingUtility.countRows(t); + this.util.loadTable(t, HBaseTestingUtil.COLUMNS[0]); + final int count = HBaseTestingUtil.countRows(t); assertTrue("expected some rows", count > 0); // find the first server that match the request and executes the test ServerName rsToKill = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCPBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCPBase.java index 6c116fa6c9f..996e1f3b40c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCPBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSCPBase.java @@ -21,9 +21,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionReplicaTestHelper; @@ -41,7 +41,7 @@ public class TestSCPBase { private static final Logger LOG = LoggerFactory.getLogger(TestSCPBase.class); static final int RS_COUNT = 3; - protected HBaseTestingUtility util; + protected HBaseTestingUtil util; protected void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); @@ -49,7 +49,7 @@ public class TestSCPBase { @Before public void setup() throws Exception { - this.util = new HBaseTestingUtility(); + this.util = new HBaseTestingUtil(); setupConf(this.util.getConfiguration()); startMiniCluster(); ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate( @@ -62,7 +62,7 @@ public class TestSCPBase { @After public void tearDown() throws Exception { - MiniHBaseCluster cluster = this.util.getHBaseCluster(); + SingleProcessHBaseCluster cluster = this.util.getHBaseCluster(); HMaster master = cluster == null ? null : cluster.getMaster(); if (master != null && master.getMasterProcedureExecutor() != null) { ProcedureTestingUtility.setKillAndToggleBeforeStoreUpdate(master.getMasterProcedureExecutor(), @@ -81,8 +81,8 @@ public class TestSCPBase { carryingMeta + "-doubleExecution-" + doubleExecution); try (Table t = createTable(tableName)) { // Load the table with a bit of data so some logs to split and some edits in each region. - this.util.loadTable(t, HBaseTestingUtility.COLUMNS[0]); - final int count = HBaseTestingUtility.countRows(t); + this.util.loadTable(t, HBaseTestingUtil.COLUMNS[0]); + final int count = HBaseTestingUtil.countRows(t); assertTrue("expected some rows", count > 0); final String checksum = util.checksumRows(t); // Run the procedure executor outside the master so we can mess with it. Need to disable @@ -118,7 +118,7 @@ public class TestSCPBase { ProcedureTestingUtility.waitProcedure(procExec, procId); } RegionReplicaTestHelper.assertReplicaDistributed(util, t); - assertEquals(count, HBaseTestingUtility.countRows(t)); + assertEquals(count, HBaseTestingUtil.countRows(t)); assertEquals(checksum, util.checksumRows(t)); } } @@ -129,8 +129,8 @@ public class TestSCPBase { } protected Table createTable(final TableName tableName) throws IOException { - final Table t = this.util.createTable(tableName, HBaseTestingUtility.COLUMNS, - HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE, getRegionReplication()); + final Table t = this.util.createTable(tableName, HBaseTestingUtil.COLUMNS, + HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE, getRegionReplication()); return t; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java index 49c98969d52..da8103154f7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSafemodeBringsDownMaster.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.RegionInfo; @@ -54,7 +54,7 @@ public class TestSafemodeBringsDownMaster { private static final Logger LOG = LoggerFactory.getLogger(TestSafemodeBringsDownMaster.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSchedulerQueueDeadLock.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSchedulerQueueDeadLock.java index ee7becc64ae..20653cfc617 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSchedulerQueueDeadLock.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSchedulerQueueDeadLock.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.procedure; import java.io.IOException; import java.util.concurrent.Semaphore; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure2.Procedure; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; @@ -47,7 +47,7 @@ public class TestSchedulerQueueDeadLock { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSchedulerQueueDeadLock.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("deadlock"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerRemoteProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerRemoteProcedure.java index 14342d469d3..82e57fcd865 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerRemoteProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestServerRemoteProcedure.java @@ -34,7 +34,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -77,7 +77,7 @@ public class TestServerRemoteProcedure { public TestName name = new TestName(); @Rule public final ExpectedException exception = ExpectedException.none(); - protected HBaseTestingUtility util; + protected HBaseTestingUtil util; protected MockRSProcedureDispatcher rsDispatcher; protected MockMasterServices master; protected AssignmentManager am; @@ -88,7 +88,7 @@ public class TestServerRemoteProcedure { @Before public void setUp() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); this.executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder() .setUncaughtExceptionHandler((t, e) -> LOG.warn("Uncaught: ", e)).build()); master = new MockMasterServices(util.getConfiguration(), this.regionsToRegionServers); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitWALProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitWALProcedure.java index 45c8d5b3b87..efdce89b7d2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitWALProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestSplitWALProcedure.java @@ -25,7 +25,7 @@ import java.util.Optional; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; @@ -51,7 +51,7 @@ public class TestSplitWALProcedure { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSplitWALProcedure.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private HMaster master; private TableName TABLE_NAME; private SplitWALManager splitWALManager; @@ -59,7 +59,7 @@ public class TestSplitWALProcedure { @Before public void setup() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.getConfiguration().setBoolean(HBASE_SPLIT_WAL_COORDINATED_BY_ZK, false); TEST_UTIL.getConfiguration().setInt(HBASE_SPLIT_WAL_MAX_SPLITTER, 1); TEST_UTIL.startMiniCluster(3); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java index bd7f26d9096..8327e7dd8da 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDDLProcedureBase.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.master.procedure; import static org.junit.Assert.assertTrue; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; @@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory; public abstract class TestTableDDLProcedureBase { private static final Logger LOG = LoggerFactory.getLogger(TestTableDDLProcedureBase.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static void setupConf(Configuration conf) { conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java index 9196921f595..b6fe4374a51 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestTableDescriptorModificationFromClient.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Set; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.InvalidFamilyOperationException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -60,7 +60,7 @@ public class TestTableDescriptorModificationFromClient { HBaseClassTestRule.forClass(TestTableDescriptorModificationFromClient.class); @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = null; private static final byte[] FAMILY_0 = Bytes.toBytes("cf0"); private static final byte[] FAMILY_1 = Bytes.toBytes("cf1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java index c0ee24d2847..816bdcdbd36 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.log.HBaseMarkers; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility; import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.TestProcedure; @@ -53,7 +53,7 @@ public class TestWALProcedureStoreOnHDFS { private static final Logger LOG = LoggerFactory.getLogger(TestWALProcedureStoreOnHDFS.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private WALProcedureStore store; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/MasterRegionTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/MasterRegionTestBase.java index 45102ddb642..ea6d9d093b1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/MasterRegionTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/MasterRegionTestBase.java @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ChoreService; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -42,7 +42,7 @@ import org.junit.Before; public class MasterRegionTestBase { - protected HBaseCommonTestingUtility htu; + protected HBaseCommonTestingUtil htu; protected MasterRegion region; @@ -74,7 +74,7 @@ public class MasterRegionTestBase { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); htu.getConfiguration().setBoolean(MemStoreLAB.USEMSLAB_KEY, false); // Runs on local filesystem. Test does not need sync. Turn off checks. htu.getConfiguration().setBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE, false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionOnTwoFileSystems.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionOnTwoFileSystems.java index 9d1e60f4cd9..fb075d513ab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionOnTwoFileSystems.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionOnTwoFileSystems.java @@ -36,8 +36,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; @@ -77,9 +77,9 @@ public class TestMasterRegionOnTwoFileSystems { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterRegionOnTwoFileSystems.class); - private static final HBaseCommonTestingUtility HFILE_UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil HFILE_UTIL = new HBaseCommonTestingUtil(); - private static final HBaseTestingUtility WAL_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil WAL_UTIL = new HBaseTestingUtil(); private static byte[] CF = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestModifyPeerProcedureRetryBackoff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestModifyPeerProcedureRetryBackoff.java index 7566d28e810..78bdde33a3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestModifyPeerProcedureRetryBackoff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestModifyPeerProcedureRetryBackoff.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.master.replication; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ProcedureTestUtil; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.procedure2.Procedure; @@ -42,7 +42,7 @@ public class TestModifyPeerProcedureRetryBackoff { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestModifyPeerProcedureRetryBackoff.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static boolean FAIL = true; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestSyncReplicationReplayWALManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestSyncReplicationReplayWALManager.java index a6290df1555..f7f4efcd20f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestSyncReplicationReplayWALManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestSyncReplicationReplayWALManager.java @@ -37,7 +37,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.master.MasterFileSystem; @@ -68,7 +68,7 @@ public class TestSyncReplicationReplayWALManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSyncReplicationReplayWALManager.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private SyncReplicationReplayWALManager manager; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestTransitPeerSyncReplicationStateProcedureBackoff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestTransitPeerSyncReplicationStateProcedureBackoff.java index 0526a8e8da3..e03b71365bc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestTransitPeerSyncReplicationStateProcedureBackoff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/replication/TestTransitPeerSyncReplicationStateProcedureBackoff.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.replication; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ProcedureTestUtil; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.procedure2.Procedure; @@ -42,7 +42,7 @@ public class TestTransitPeerSyncReplicationStateProcedureBackoff { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestTransitPeerSyncReplicationStateProcedureBackoff.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static boolean FAIL = true; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java index 1dcf355efa2..35cf935e06a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; import org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil; @@ -68,7 +68,7 @@ public class TestSnapshotFileCache { HBaseClassTestRule.forClass(TestSnapshotFileCache.class); protected static final Logger LOG = LoggerFactory.getLogger(TestSnapshotFileCache.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // don't refresh the cache unless we tell it to protected static final long PERIOD = Long.MAX_VALUE; protected static FileSystem fs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java index 7d1083e5594..2c5d64f7c40 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -56,7 +56,7 @@ public class TestSnapshotHFileCleaner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotHFileCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String TABLE_NAME_STR = "testSnapshotManifest"; private static final String SNAPSHOT_NAME_STR = "testSnapshotManifest-snapshot"; private static Path rootDir; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotManager.java index ff903c444eb..1d96536d39c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotManager.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.executor.ExecutorService; import org.apache.hadoop.hbase.master.MasterFileSystem; @@ -55,7 +55,7 @@ public class TestSnapshotManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotManager.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotWhileRSCrashes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotWhileRSCrashes.java index 46dc99f8609..1c1fcf81e3e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotWhileRSCrashes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotWhileRSCrashes.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNull; import java.io.IOException; import java.io.UncheckedIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Table; @@ -47,7 +47,7 @@ public class TestSnapshotWhileRSCrashes { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotWhileRSCrashes.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName NAME = TableName.valueOf("Cleanup"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestTakeSnapshotHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestTakeSnapshotHandler.java index 9000254db31..ab062683e58 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestTakeSnapshotHandler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestTakeSnapshotHandler.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import java.util.HashMap; import java.util.Map; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -49,7 +49,7 @@ import org.junit.rules.TestName; @Category({ MediumTests.class}) public class TestTakeSnapshotHandler { - private static HBaseTestingUtility UTIL; + private static HBaseTestingUtil UTIL; @ClassRule public static final HBaseClassTestRule CLASS_RULE = @@ -61,7 +61,7 @@ public class TestTakeSnapshotHandler { @Before public void setup() { - UTIL = new HBaseTestingUtility(); + UTIL = new HBaseTestingUtil(); } public TableDescriptor createTableInsertDataAndTakeSnapshot(Map snapshotProps) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobStressToolRunner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobStressToolRunner.java index 9b63b9de7d0..585bdf7d7d1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobStressToolRunner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobStressToolRunner.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -61,7 +61,7 @@ public class MobStressToolRunner { private static final Logger LOG = LoggerFactory.getLogger(MobStressToolRunner.class); - private HBaseTestingUtility HTU; + private HBaseTestingUtil HTU; private final static String famStr = "f1"; private final static byte[] fam = Bytes.toBytes(famStr); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobTestUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobTestUtil.java index bf064c57b22..3fdbb1ff95b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobTestUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/MobTestUtil.java @@ -24,7 +24,7 @@ import java.util.Random; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; @@ -116,6 +116,6 @@ public class MobTestUtil { Scan scan = new Scan(); // Do not retrieve the mob data when scanning scan.setAttribute(MobConstants.MOB_SCAN_RAW, Bytes.toBytes(Boolean.TRUE)); - return HBaseTestingUtility.countRows(table, scan); + return HBaseTestingUtil.countRows(table, scan); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java index d274db366c2..99f7484d0c9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java @@ -24,7 +24,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.io.hfile.CacheConfig; @@ -50,7 +50,7 @@ public class TestCachedMobFile { HBaseClassTestRule.forClass(TestCachedMobFile.class); static final Logger LOG = LoggerFactory.getLogger(TestCachedMobFile.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf = TEST_UTIL.getConfiguration(); private CacheConfig cacheConf = new CacheConfig(conf); private static final String FAMILY1 = "familyName1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java index e0d7d2c3bf0..70e7bbf4cb4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java @@ -21,7 +21,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -49,7 +49,7 @@ public class TestDefaultMobStoreFlusher { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDefaultMobStoreFlusher.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte[] row1 = Bytes.toBytes("row1"); private final static byte[] row2 = Bytes.toBytes("row2"); private final static byte[] family = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java index e4229fe8792..35d62f4ffe7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestExpiredMobFileCleaner.java @@ -23,7 +23,7 @@ import java.util.Random; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.BufferedMutator; @@ -51,7 +51,7 @@ public class TestExpiredMobFileCleaner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestExpiredMobFileCleaner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static TableName tableName = TableName.valueOf("TestExpiredMobFileCleaner"); private final static String family = "family"; private final static byte[] row1 = Bytes.toBytes("row1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java index 149de2045d0..5847a448df1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -81,7 +81,7 @@ public class TestMobCompactionWithDefaults { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobCompactionWithDefaults.class); - protected static HBaseTestingUtility HTU; + protected static HBaseTestingUtil HTU; protected static Configuration conf; protected static long minAgeToArchive = 10000; @@ -105,7 +105,7 @@ public class TestMobCompactionWithDefaults { @BeforeClass public static void htuStart() throws Exception { - HTU = new HBaseTestingUtility(); + HTU = new HBaseTestingUtil(); conf = HTU.getConfiguration(); conf.setInt("hfile.format.version", 3); // Disable automatic MOB compaction diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java index d5f9ae57993..1c7d8b0c103 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.mob; import java.util.Random; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -47,7 +47,7 @@ public class TestMobDataBlockEncoding { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobDataBlockEncoding.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte [] row1 = Bytes.toBytes("row1"); private final static byte [] family = Bytes.toBytes("family"); private final static byte [] qf1 = Bytes.toBytes("qualifier1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java index 297c19f2ac2..e7e6d788983 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.io.hfile.CacheConfig; @@ -51,7 +51,7 @@ public class TestMobFile { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobFile.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf = TEST_UTIL.getConfiguration(); private CacheConfig cacheConf = new CacheConfig(conf); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java index 8cfa0a68adb..80aa5f405ce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -56,7 +56,7 @@ public class TestMobFileCache { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobFileCache.class); - private HBaseTestingUtility UTIL; + private HBaseTestingUtil UTIL; private HRegion region; private Configuration conf; private MobFileCache mobFileCache; @@ -84,7 +84,7 @@ public class TestMobFileCache { @Before public void setUp() throws Exception { - UTIL = new HBaseTestingUtility(); + UTIL = new HBaseTestingUtil(); conf = UTIL.getConfiguration(); conf.set(MobConstants.MOB_FILE_CACHE_SIZE_KEY, TEST_CACHE_SIZE); TableDescriptorBuilder tableDescriptorBuilder = @@ -112,7 +112,7 @@ public class TestMobFileCache { TableDescriptor tableDescriptor = tableDescriptorBuilder.build(); RegionInfo regionInfo = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); mobFileCache = new MobFileCache(conf); - region = HBaseTestingUtility + region = HBaseTestingUtil .createRegionAndWAL(regionInfo, UTIL.getDataTestDir(), conf, tableDescriptor, mobFileCache); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCleanerChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCleanerChore.java index 54651229706..f70c2539af6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCleanerChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCleanerChore.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -66,7 +66,7 @@ public class TestMobFileCleanerChore { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobFileCleanerChore.class); - private HBaseTestingUtility HTU; + private HBaseTestingUtil HTU; private final static String famStr = "f1"; private final static byte[] fam = Bytes.toBytes(famStr); @@ -88,7 +88,7 @@ public class TestMobFileCleanerChore { @Before public void setUp() throws Exception { - HTU = new HBaseTestingUtility(); + HTU = new HBaseTestingUtil(); conf = HTU.getConfiguration(); initConf(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java index a6a2ee55009..1891de8adbb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; import java.util.Date; import java.util.Random; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.MD5Hash; @@ -41,7 +41,7 @@ public class TestMobFileName { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobFileName.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private String uuid; private Date date; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java index 25c6edcb16d..a037c036ff1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreCompaction.java @@ -17,8 +17,8 @@ */ package org.apache.hadoop.hbase.mob; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.apache.hadoop.hbase.regionserver.HStoreFile.BULKLOAD_TIME_KEY; import static org.apache.hadoop.hbase.regionserver.HStoreFile.MOB_CELLS_COUNT; import static org.junit.Assert.assertEquals; @@ -38,7 +38,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -93,7 +93,7 @@ public class TestMobStoreCompaction { @Rule public TestName name = new TestName(); static final Logger LOG = LoggerFactory.getLogger(TestMobStoreCompaction.class.getName()); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private Configuration conf = null; private HRegion region = null; @@ -110,7 +110,7 @@ public class TestMobStoreCompaction { private void init(Configuration conf, long mobThreshold) throws Exception { this.conf = conf; this.mobCellThreshold = mobThreshold; - HBaseTestingUtility UTIL = new HBaseTestingUtility(conf); + HBaseTestingUtil UTIL = new HBaseTestingUtil(conf); compactionThreshold = conf.getInt("hbase.hstore.compactionThreshold", 3); familyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(COLUMN_FAMILY).setMobEnabled(true) @@ -119,7 +119,7 @@ public class TestMobStoreCompaction { .modifyColumnFamily(familyDescriptor).build(); RegionInfo regionInfo = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - region = HBaseTestingUtility.createRegionAndWAL(regionInfo, + region = HBaseTestingUtil.createRegionAndWAL(regionInfo, UTIL.getDataTestDir(), conf, tableDescriptor, new MobFileCache(conf)); fs = FileSystem.get(conf); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java index b6b03e9ca8f..04f51402cc7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -67,7 +67,7 @@ public class TestMobStoreScanner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMobStoreScanner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte [] row1 = Bytes.toBytes("row1"); private final static byte [] row2 = Bytes.toBytes("row2"); private final static byte [] family = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobWithByteBuffAllocator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobWithByteBuffAllocator.java index e84af12c978..e80a2396c06 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobWithByteBuffAllocator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobWithByteBuffAllocator.java @@ -22,7 +22,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -57,7 +57,7 @@ public class TestMobWithByteBuffAllocator { private static final String TABLE_NAME = "TestMobWithByteBuffAllocator"; private static final Logger LOG = LoggerFactory.getLogger(TestMobWithByteBuffAllocator.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration CONF = UTIL.getConfiguration(); private static final byte[] FAMILY = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestNamedQueueRecorder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestNamedQueueRecorder.java index 161bcc11a20..58fe93803a6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestNamedQueueRecorder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestNamedQueueRecorder.java @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ipc.RpcCall; import org.apache.hadoop.hbase.ipc.RpcCallback; @@ -73,7 +73,7 @@ public class TestNamedQueueRecorder { private static final Logger LOG = LoggerFactory.getLogger(TestNamedQueueRecorder.class); - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); private NamedQueueRecorder namedQueueRecorder; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestSlowLogAccessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestSlowLogAccessor.java index f7bc6fee844..908f2e278a0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestSlowLogAccessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestSlowLogAccessor.java @@ -26,7 +26,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.Result; @@ -66,7 +66,7 @@ public class TestSlowLogAccessor { private static final Logger LOG = LoggerFactory.getLogger(TestNamedQueueRecorder.class); - private static final HBaseTestingUtility HBASE_TESTING_UTILITY = new HBaseTestingUtility(); + private static final HBaseTestingUtil HBASE_TESTING_UTILITY = new HBaseTestingUtil(); private NamedQueueRecorder namedQueueRecorder; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java index 7d67387eac5..928b54676c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java @@ -38,11 +38,11 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -100,7 +100,7 @@ public class TestNamespaceAuditor { HBaseClassTestRule.forClass(TestNamespaceAuditor.class); private static final Logger LOG = LoggerFactory.getLogger(TestNamespaceAuditor.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Admin ADMIN; private String prefix = "TestNamespaceAuditor"; @@ -115,7 +115,7 @@ public class TestNamespaceAuditor { conf.setBoolean(QuotaUtil.QUOTA_CONF_KEY, true); conf.setClass("hbase.coprocessor.regionserver.classes", CPRegionServerObserver.class, RegionServerObserver.class); - StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(2).build(); UTIL.startMiniCluster(option); waitForQuotaInitialize(UTIL); ADMIN = UTIL.getAdmin(); @@ -395,7 +395,7 @@ public class TestNamespaceAuditor { Collections.sort(hris, RegionInfo.COMPARATOR); // Fail region merge through Coprocessor hook - MiniHBaseCluster cluster = UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = UTIL.getHBaseCluster(); MasterCoprocessorHost cpHost = cluster.getMaster().getMasterCoprocessorHost(); Coprocessor coprocessor = cpHost.findCoprocessor(CPMasterObserver.class); CPMasterObserver masterObserver = (CPMasterObserver) coprocessor; @@ -544,7 +544,7 @@ public class TestNamespaceAuditor { .getTables().size(), after.getTables().size()); } - public static void waitForQuotaInitialize(final HBaseTestingUtility util) throws Exception { + public static void waitForQuotaInitialize(final HBaseTestingUtil util) throws Exception { util.waitFor(60000, new Waiter.Predicate() { @Override public boolean evaluate() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestFailedProcCleanup.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestFailedProcCleanup.java index 17b9a6ba5cd..e05c0c4f81a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestFailedProcCleanup.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestFailedProcCleanup.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Optional; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -61,7 +61,7 @@ public class TestFailedProcCleanup { private static final Logger LOG = LoggerFactory.getLogger(TestFailedProcCleanup.class); - protected static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; private static final TableName TABLE = TableName.valueOf("test"); private static final byte[] FAMILY = Bytes.toBytesBinary("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java index 8ab9ec80742..6aa4c51324b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureManager.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.HashMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -42,7 +42,7 @@ public class TestProcedureManager { HBaseClassTestRule.forClass(TestProcedureManager.class); private static final int NUM_RS = 2; - private static HBaseTestingUtility util = new HBaseTestingUtility(); + private static HBaseTestingUtil util = new HBaseTestingUtil(); @BeforeClass public static void setupBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java index 0266851ab39..b68c6fdc8de 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java @@ -36,7 +36,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.errorhandling.ForeignException; import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher; import org.apache.hadoop.hbase.errorhandling.TimeoutException; @@ -71,7 +71,7 @@ public class TestZKProcedure { HBaseClassTestRule.forClass(TestZKProcedure.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKProcedure.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String COORDINATOR_NODE_NAME = "coordinator"; private static final long KEEP_ALIVE = 100; // seconds private static final int POOL_SIZE = 1; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedureControllers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedureControllers.java index b0f366fb207..9d1c4a61454 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedureControllers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedureControllers.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -63,7 +63,7 @@ public class TestZKProcedureControllers { HBaseClassTestRule.forClass(TestZKProcedureControllers.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKProcedureControllers.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String COHORT_NODE_NAME = "expected"; private static final String CONTROLLER_NODE_NAME = "controller"; private static final VerificationMode once = Mockito.times(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStoreTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStoreTestBase.java index 19c88b670a4..9825828bff0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStoreTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStoreTestBase.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.procedure2.store.region; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.master.region.MasterRegion; import org.apache.hadoop.hbase.master.region.MasterRegionFactory; @@ -36,7 +36,7 @@ import org.junit.Before; */ public class RegionProcedureStoreTestBase { - protected HBaseCommonTestingUtility htu; + protected HBaseCommonTestingUtil htu; protected MasterRegion region; @@ -44,7 +44,7 @@ public class RegionProcedureStoreTestBase { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); Configuration conf = htu.getConfiguration(); conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, false); // Runs on local filesystem. Test does not need sync. Turn off checks. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/TestRegionProcedureStoreMigration.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/TestRegionProcedureStoreMigration.java index 5a5cfd184f7..694ca32c7b3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/TestRegionProcedureStoreMigration.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure2/store/region/TestRegionProcedureStoreMigration.java @@ -33,7 +33,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableName; @@ -64,7 +64,7 @@ public class TestRegionProcedureStoreMigration { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionProcedureStoreMigration.class); - private HBaseCommonTestingUtility htu; + private HBaseCommonTestingUtil htu; private Server server; @@ -76,7 +76,7 @@ public class TestRegionProcedureStoreMigration { @Before public void setUp() throws IOException { - htu = new HBaseCommonTestingUtility(); + htu = new HBaseCommonTestingUtil(); Configuration conf = htu.getConfiguration(); conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, false); // Runs on local filesystem. Test does not need sync. Turn off checks. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/SpaceQuotaHelperForTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/SpaceQuotaHelperForTests.java index 296d38f5167..eef0ea563d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/SpaceQuotaHelperForTests.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/SpaceQuotaHelperForTests.java @@ -34,9 +34,9 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -79,13 +79,13 @@ public class SpaceQuotaHelperForTests { public static final long ONE_MEGABYTE = ONE_KILOBYTE * ONE_KILOBYTE; public static final long ONE_GIGABYTE = ONE_MEGABYTE * ONE_KILOBYTE; - private final HBaseTestingUtility testUtil; + private final HBaseTestingUtil testUtil; private final TestName testName; private final AtomicLong counter; private static final int NUM_RETRIES = 10; public SpaceQuotaHelperForTests( - HBaseTestingUtility testUtil, TestName testName, AtomicLong counter) { + HBaseTestingUtil testUtil, TestName testName, AtomicLong counter) { this.testUtil = Objects.requireNonNull(testUtil); this.testName = Objects.requireNonNull(testName); this.counter = Objects.requireNonNull(counter); @@ -690,10 +690,10 @@ public class SpaceQuotaHelperForTests { * Predicate that waits for all store files in a table to have no compacted files. */ static class NoFilesToDischarge implements Predicate { - private final MiniHBaseCluster cluster; + private final SingleProcessHBaseCluster cluster; private final TableName tn; - NoFilesToDischarge(MiniHBaseCluster cluster, TableName tn) { + NoFilesToDischarge(SingleProcessHBaseCluster cluster, TableName tn) { this.cluster = cluster; this.tn = tn; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java index cdce1222d51..955918dd420 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java @@ -28,7 +28,7 @@ import static org.junit.Assert.assertTrue; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -55,7 +55,7 @@ public class TestClusterScopeQuotaThrottle { HBaseClassTestRule.forClass(TestClusterScopeQuotaThrottle.class); private final static int REFRESH_TIME = 30 * 60000; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static TableName[] TABLE_NAMES = new TableName[] { TableName.valueOf("TestQuotaAdmin0"), TableName.valueOf("TestQuotaAdmin1"), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileArchiverNotifierImpl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileArchiverNotifierImpl.java index c3c51bad577..5ce888a885d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileArchiverNotifierImpl.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestFileArchiverNotifierImpl.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -81,7 +81,7 @@ public class TestFileArchiverNotifierImpl { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFileArchiverNotifierImpl.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final AtomicLong COUNTER = new AtomicLong(); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestLowLatencySpaceQuotas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestLowLatencySpaceQuotas.java index c52c20257c1..bd4a29a3d62 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestLowLatencySpaceQuotas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestLowLatencySpaceQuotas.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -62,7 +62,7 @@ public class TestLowLatencySpaceQuotas { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLowLatencySpaceQuotas.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Global for all tests in the class private static final AtomicLong COUNTER = new AtomicLong(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestMasterQuotasObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestMasterQuotasObserver.java index e80ae40038e..f74003f730e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestMasterQuotasObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestMasterQuotasObserver.java @@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -57,7 +57,7 @@ public class TestMasterQuotasObserver { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMasterQuotasObserver.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static SpaceQuotaHelperForTests helper; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java index c2ab2432a26..50ee386542e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -78,7 +78,7 @@ public class TestQuotaAdmin { private static final Logger LOG = LoggerFactory.getLogger(TestQuotaAdmin.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static TableName[] TABLE_NAMES = new TableName[] { TableName.valueOf("TestQuotaAdmin0"), TableName.valueOf("TestQuotaAdmin1"), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreRegionReports.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreRegionReports.java index 912f042e168..28529acd7d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreRegionReports.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreRegionReports.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Map.Entry; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -66,7 +66,7 @@ public class TestQuotaObserverChoreRegionReports { private static final Logger LOG = LoggerFactory.getLogger(TestQuotaObserverChoreRegionReports.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreWithMiniCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreWithMiniCluster.java index 708ac965f57..41db656042b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreWithMiniCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaObserverChoreWithMiniCluster.java @@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.TableName; @@ -71,7 +71,7 @@ public class TestQuotaObserverChoreWithMiniCluster { private static final Logger LOG = LoggerFactory.getLogger(TestQuotaObserverChoreWithMiniCluster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final AtomicLong COUNTER = new AtomicLong(0); private static final long DEFAULT_WAIT_MILLIS = 500; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java index b8b5eb96d17..167e7dc97a6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -62,7 +62,7 @@ public class TestQuotaStatusRPCs { HBaseClassTestRule.forClass(TestQuotaStatusRPCs.class); private static final Logger LOG = LoggerFactory.getLogger(TestQuotaStatusRPCs.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final AtomicLong COUNTER = new AtomicLong(0); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaTableUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaTableUtil.java index fff833f7c7e..faaac4df3e5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaTableUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaTableUtil.java @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -76,7 +76,7 @@ public class TestQuotaTableUtil { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestQuotaTableUtil.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Connection connection; private int tableNameCounter; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java index 8495cd2c818..3d063d60710 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java @@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -63,7 +63,7 @@ public class TestQuotaThrottle { private final static int REFRESH_TIME = 30 * 60000; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte[] FAMILY = Bytes.toBytes("cf"); private final static byte[] QUALIFIER = Bytes.toBytes("q"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestRegionSizeUse.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestRegionSizeUse.java index 351b2a4d36a..7a3fc74676b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestRegionSizeUse.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestRegionSizeUse.java @@ -27,8 +27,8 @@ import java.util.Map.Entry; import java.util.Random; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -65,9 +65,9 @@ public class TestRegionSizeUse { private static final int SIZE_PER_VALUE = 256; private static final int NUM_SPLITS = 10; private static final String F1 = "f1"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSnapshotQuotaObserverChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSnapshotQuotaObserverChore.java index fca79da93a6..b6b65072854 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSnapshotQuotaObserverChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSnapshotQuotaObserverChore.java @@ -37,7 +37,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -81,7 +81,7 @@ public class TestSnapshotQuotaObserverChore { HBaseClassTestRule.forClass(TestSnapshotQuotaObserverChore.class); private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotQuotaObserverChore.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final AtomicLong COUNTER = new AtomicLong(); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaBasicFunctioning.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaBasicFunctioning.java index d5d4159159c..020e8a33793 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaBasicFunctioning.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaBasicFunctioning.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -62,7 +62,7 @@ public class TestSpaceQuotaBasicFunctioning { HBaseClassTestRule.forClass(TestSpaceQuotaBasicFunctioning.class); private static final Logger LOG = LoggerFactory.getLogger(TestSpaceQuotaBasicFunctioning.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int NUM_RETRIES = 10; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaDropTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaDropTable.java index 11b9ec67699..2b262817d55 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaDropTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaDropTable.java @@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -50,7 +50,7 @@ public class TestSpaceQuotaDropTable { HBaseClassTestRule.forClass(TestSpaceQuotaDropTable.class); private static final Logger LOG = LoggerFactory.getLogger(TestSpaceQuotaDropTable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaIncrease.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaIncrease.java index 5e6ca0ed108..731e5ef2c15 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaIncrease.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaIncrease.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -40,7 +40,7 @@ public class TestSpaceQuotaIncrease { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSpaceQuotaIncrease.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnBulkLoad.java index 94186f22752..cb05f3dcc85 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnBulkLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnBulkLoad.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionInfo; @@ -64,7 +64,7 @@ public class TestSpaceQuotaOnBulkLoad { HBaseClassTestRule.forClass(TestSpaceQuotaOnBulkLoad.class); private static final Logger LOG = LoggerFactory.getLogger(TestSpaceQuotaOnBulkLoad.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnNonExistingTables.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnNonExistingTables.java index c0f018aa54c..21417217b3a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnNonExistingTables.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaOnNonExistingTables.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.AfterClass; @@ -38,7 +38,7 @@ public class TestSpaceQuotaOnNonExistingTables { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSpaceQuotaOnNonExistingTables.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final TableName NON_EXISTENT_TABLE = TableName.valueOf("NON_EXISTENT_TABLE"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaRemoval.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaRemoval.java index 3ed6c716ec8..d94b0d5517a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaRemoval.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaRemoval.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; @@ -41,7 +41,7 @@ public class TestSpaceQuotaRemoval { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSpaceQuotaRemoval.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaSwitchPolicies.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaSwitchPolicies.java index 3d4a276bb47..f5df8ff2435 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaSwitchPolicies.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotaSwitchPolicies.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -40,7 +40,7 @@ public class TestSpaceQuotaSwitchPolicies { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSpaceQuotaSwitchPolicies.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithRegionReplicas.java index 9c3cf4aa835..9f08e114016 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithRegionReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithRegionReplicas.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; @@ -46,7 +46,7 @@ public class TestSpaceQuotasWithRegionReplicas { private static final Logger LOG = LoggerFactory.getLogger(TestSpaceQuotasWithRegionReplicas.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName testName = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithSnapshots.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithSnapshots.java index d681d2d0187..6c489da6320 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithSnapshots.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSpaceQuotasWithSnapshots.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -69,7 +69,7 @@ public class TestSpaceQuotasWithSnapshots { HBaseClassTestRule.forClass(TestSpaceQuotasWithSnapshots.class); private static final Logger LOG = LoggerFactory.getLogger(TestSpaceQuotasWithSnapshots.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Global for all tests in the class private static final AtomicLong COUNTER = new AtomicLong(0); private static final long FUDGE_FOR_TABLE_SIZE = 500L * SpaceQuotaHelperForTests.ONE_KILOBYTE; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java index 678533923ca..d5449b1efab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java @@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -66,7 +66,7 @@ public class TestSuperUserQuotaPermissions { HBaseClassTestRule.forClass(TestSuperUserQuotaPermissions.class); private static final Logger LOG = LoggerFactory.getLogger(TestSuperUserQuotaPermissions.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Default to the user running the tests private static final String SUPERUSER_NAME = System.getProperty("user.name"); private static final UserGroupInformation SUPERUSER_UGI = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/ThrottleQuotaTestUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/ThrottleQuotaTestUtil.java index 646c9ce7a52..3b98cba0503 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/ThrottleQuotaTestUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/ThrottleQuotaTestUtil.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.quotas; import java.io.IOException; import java.util.Objects; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -102,32 +102,32 @@ public final class ThrottleQuotaTestUtil { return count; } - static void triggerUserCacheRefresh(HBaseTestingUtility testUtil, boolean bypass, + static void triggerUserCacheRefresh(HBaseTestingUtil testUtil, boolean bypass, TableName... tables) throws Exception { triggerCacheRefresh(testUtil, bypass, true, false, false, false, false, tables); } - static void triggerTableCacheRefresh(HBaseTestingUtility testUtil, boolean bypass, + static void triggerTableCacheRefresh(HBaseTestingUtil testUtil, boolean bypass, TableName... tables) throws Exception { triggerCacheRefresh(testUtil, bypass, false, true, false, false, false, tables); } - static void triggerNamespaceCacheRefresh(HBaseTestingUtility testUtil, boolean bypass, + static void triggerNamespaceCacheRefresh(HBaseTestingUtil testUtil, boolean bypass, TableName... tables) throws Exception { triggerCacheRefresh(testUtil, bypass, false, false, true, false, false, tables); } - static void triggerRegionServerCacheRefresh(HBaseTestingUtility testUtil, boolean bypass) + static void triggerRegionServerCacheRefresh(HBaseTestingUtil testUtil, boolean bypass) throws Exception { triggerCacheRefresh(testUtil, bypass, false, false, false, true, false); } - static void triggerExceedThrottleQuotaCacheRefresh(HBaseTestingUtility testUtil, + static void triggerExceedThrottleQuotaCacheRefresh(HBaseTestingUtil testUtil, boolean exceedEnabled) throws Exception { triggerCacheRefresh(testUtil, exceedEnabled, false, false, false, false, true); } - private static void triggerCacheRefresh(HBaseTestingUtility testUtil, boolean bypass, + private static void triggerCacheRefresh(HBaseTestingUtil testUtil, boolean bypass, boolean userLimiter, boolean tableLimiter, boolean nsLimiter, boolean rsLimiter, boolean exceedThrottleQuota, final TableName... tables) throws Exception { envEdge.incValue(2 * REFRESH_TIME); @@ -193,7 +193,7 @@ public final class ThrottleQuotaTestUtil { envEdge.incValue(70000); } - static void clearQuotaCache(HBaseTestingUtility testUtil) { + static void clearQuotaCache(HBaseTestingUtil testUtil) { for (RegionServerThread rst : testUtil.getMiniHBaseCluster().getRegionServerThreads()) { RegionServerRpcQuotaManager quotaManager = rst.getRegionServer().getRegionServerRpcQuotaManager(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java index 3e8f82d642a..0b86e0af0e3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java @@ -24,7 +24,7 @@ import java.util.Random; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -42,7 +42,7 @@ public class EncodedSeekPerformanceTest { /** Default number of seeks which will be used in benchmark. */ public static int DEFAULT_NUMBER_OF_SEEKS = 10000; - private final HBaseTestingUtility testingUtility = new HBaseTestingUtility(); + private final HBaseTestingUtil testingUtility = new HBaseTestingUtil(); private Configuration configuration = testingUtility.getConfiguration(); private CacheConfig cacheConf = new CacheConfig(configuration); private Random randomizer; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java index fc95cfcecdb..af24c279853 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.util.Bytes; @@ -52,7 +52,7 @@ public class MockHStoreFile extends HStoreFile { long modificationTime; boolean compactedAway; - MockHStoreFile(HBaseTestingUtility testUtil, Path testPath, + MockHStoreFile(HBaseTestingUtil testUtil, Path testPath, long length, long ageInDisk, boolean isRef, long sequenceid) throws IOException { super(testUtil.getTestFileSystem(), testPath, testUtil.getConfiguration(), new CacheConfig(testUtil.getConfiguration()), BloomType.NONE, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java index 95ea37e9aea..a221b00303a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java @@ -17,8 +17,8 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam2; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam2; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -40,7 +40,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MultithreadedTestUtil; import org.apache.hadoop.hbase.MultithreadedTestUtil.TestContext; @@ -96,7 +96,7 @@ public class TestAtomicOperation { @Rule public TestName name = new TestName(); HRegion region = null; - private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Test names static byte[] tableName; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java index 9271ff2f5e9..0e62b503896 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksRead.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Delete; @@ -71,7 +71,7 @@ public class TestBlocksRead { BloomType.ROW, BloomType.NONE }; HRegion region = null; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final String DIR = TEST_UTIL.getDataTestDir("TestBlocksRead").toString(); private Configuration conf = TEST_UTIL.getConfiguration(); @@ -87,7 +87,7 @@ public class TestBlocksRead { } /** - * Callers must afterward call {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} + * Callers must afterward call {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} * @return created and initialized region. */ private HRegion initHRegion(byte[] tableName, String callingMethod, Configuration conf, @@ -96,7 +96,7 @@ public class TestBlocksRead { } /** - * Callers must afterward call {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} + * Callers must afterward call {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} */ private HRegion initHRegion(byte[] tableName, String callingMethod, Configuration conf, String family, BlockCache blockCache) throws IOException { @@ -111,9 +111,9 @@ public class TestBlocksRead { RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(tableName)).build(); Path path = new Path(DIR + callingMethod); if (blockCache != null) { - return HBaseTestingUtility.createRegionAndWAL(info, path, conf, builder.build(), blockCache); + return HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build(), blockCache); } else { - return HBaseTestingUtility.createRegionAndWAL(info, path, conf, builder.build()); + return HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build()); } } @@ -259,7 +259,7 @@ public class TestBlocksRead { assertEquals(1, kvs.length); verifyData(kvs[0], "row", "col5", 5); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -365,7 +365,7 @@ public class TestBlocksRead { verifyData(kvs[1], "row", "col2", 12); verifyData(kvs[2], "row", "col3", 13); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -413,7 +413,7 @@ public class TestBlocksRead { assertEquals(2 * BLOOM_TYPE.length, blocksEnd - blocksStart); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -439,7 +439,7 @@ public class TestBlocksRead { assertEquals(1, kvs.length); verifyData(kvs[0], "row", "col99", 201); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java index 69b1446a502..f18acdc7a8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -62,13 +62,13 @@ public class TestBlocksScanned { private static byte [] END_KEY = Bytes.toBytes("zzz"); private static int BLOCK_SIZE = 70; - private static HBaseTestingUtility TEST_UTIL = null; + private static HBaseTestingUtil TEST_UTIL = null; private Configuration conf; private Path testDir; @Before public void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf = TEST_UTIL.getConfiguration(); testDir = TEST_UTIL.getDataTestDir("TestBlocksScanned"); } @@ -102,7 +102,7 @@ public class TestBlocksScanned { RegionInfo regionInfo = RegionInfoBuilder.newBuilder(td.getTableName()).setStartKey(START_KEY).setEndKey(END_KEY) .build(); - HRegion r = HBaseTestingUtility.createRegionAndWAL(regionInfo, testDir, conf, td, blockCache); + HRegion r = HBaseTestingUtil.createRegionAndWAL(regionInfo, testDir, conf, td, blockCache); addContent(r, FAMILY, COL); r.flush(true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoadReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoadReplication.java index 07576b3d1ff..c2333920350 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoadReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoadReplication.java @@ -40,7 +40,7 @@ import org.apache.hadoop.hbase.CellBuilder; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -111,7 +111,7 @@ public class TestBulkLoadReplication extends TestReplicationBase { private static AtomicInteger BULK_LOADS_COUNT; private static CountDownLatch BULK_LOAD_LATCH; - protected static final HBaseTestingUtility UTIL3 = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL3 = new HBaseTestingUtil(); protected static final Configuration CONF3 = UTIL3.getConfiguration(); private static final Path BULK_LOAD_BASE_DIR = new Path("/bulk_dir"); @@ -148,7 +148,7 @@ public class TestBulkLoadReplication extends TestReplicationBase { Connection connection3 = ConnectionFactory.createConnection(CONF3); try (Admin admin3 = connection3.getAdmin()) { - admin3.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin3.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } UTIL3.waitUntilAllRegionsAssigned(tableName); htable3 = connection3.getTable(tableName); @@ -176,12 +176,12 @@ public class TestBulkLoadReplication extends TestReplicationBase { BULK_LOADS_COUNT = new AtomicInteger(0); } - private ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtility util) { + private ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtil util) { return ReplicationPeerConfig.newBuilder() .setClusterKey(util.getClusterKey()).setSerial(isSerialPeer()).build(); } - private void setupCoprocessor(HBaseTestingUtility cluster){ + private void setupCoprocessor(HBaseTestingUtil cluster){ cluster.getHBaseCluster().getRegions(tableName).forEach(r -> { try { TestBulkLoadReplication.BulkReplicationTestObserver cp = r.getCoprocessorHost(). @@ -247,7 +247,7 @@ public class TestBulkLoadReplication extends TestReplicationBase { protected void assertBulkLoadConditions(TableName tableName, byte[] row, byte[] value, - HBaseTestingUtility utility, Table...tables) throws Exception { + HBaseTestingUtil utility, Table...tables) throws Exception { BULK_LOAD_LATCH = new CountDownLatch(3); bulkLoadOnCluster(tableName, row, value, utility); assertTrue(BULK_LOAD_LATCH.await(1, TimeUnit.MINUTES)); @@ -257,7 +257,7 @@ public class TestBulkLoadReplication extends TestReplicationBase { } protected void bulkLoadOnCluster(TableName tableName, byte[] row, byte[] value, - HBaseTestingUtility cluster) throws Exception { + HBaseTestingUtil cluster) throws Exception { String bulkLoadFilePath = createHFileForFamilies(row, value, cluster.getConfiguration()); copyToHdfs(bulkLoadFilePath, cluster.getDFSCluster()); BulkLoadHFilesTool bulkLoadHFilesTool = new BulkLoadHFilesTool(cluster.getConfiguration()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkloadBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkloadBase.java index a2e398ff3a5..5c5d5307e50 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkloadBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkloadBase.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -66,7 +66,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos; public class TestBulkloadBase { @ClassRule public static TemporaryFolder testFolder = new TemporaryFolder(); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final WAL log = mock(WAL.class); protected final Configuration conf = HBaseConfiguration.create(); private final Random random = new Random(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java index 60ca5b3896b..cd83dc8c249 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -82,7 +82,7 @@ public class TestCacheOnWriteInSchema { private static final Logger LOG = LoggerFactory.getLogger(TestCacheOnWriteInSchema.class); @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String DIR = TEST_UTIL.getDataTestDir("TestCacheOnWriteInSchema").toString(); private static byte [] table; private static byte [] family = Bytes.toBytes("family"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileAfterFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileAfterFailover.java index dcc73801878..b3c12fa3683 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileAfterFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileAfterFailover.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -58,7 +58,7 @@ public class TestCleanupCompactedFileAfterFailover { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCleanupCompactedFileAfterFailover.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static Admin admin; private static Table table; @@ -71,7 +71,7 @@ public class TestCleanupCompactedFileAfterFailover { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); // Set the scanner lease to 20min, so the scanner can't be closed by RegionServer TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 1200000); TEST_UTIL.getConfiguration() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileOnRegionClose.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileOnRegionClose.java index ac44fe0e4d6..f43b0f579dd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileOnRegionClose.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupCompactedFileOnRegionClose.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; import java.util.Collection; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Delete; @@ -52,11 +52,11 @@ public class TestCleanupCompactedFileOnRegionClose { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCleanupCompactedFileOnRegionClose.class); - private static HBaseTestingUtility util; + private static HBaseTestingUtil util; @BeforeClass public static void beforeClass() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); util.getConfiguration().setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MIN_KEY,100); util.getConfiguration().set("dfs.blocksize", "64000"); util.getConfiguration().set("dfs.namenode.fs-limits.min-block-size", "1024"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupMetaWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupMetaWAL.java index 63b611d378f..f8d59dec390 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupMetaWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCleanupMetaWAL.java @@ -23,7 +23,7 @@ import static org.junit.Assert.fail; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory; public class TestCleanupMetaWAL { private static final Logger LOG = LoggerFactory.getLogger(TestCleanupMetaWAL.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClearRegionBlockCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClearRegionBlockCache.java index 74c07e41996..8f869e1bbea 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClearRegionBlockCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClearRegionBlockCache.java @@ -25,9 +25,9 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CacheEvictionStats; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.AsyncAdmin; @@ -62,12 +62,12 @@ public class TestClearRegionBlockCache { private static final byte[][] SPLIT_KEY = new byte[][] { Bytes.toBytes("5") }; private static final int NUM_RS = 2; - private final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private final HBaseTestingUtil HTU = new HBaseTestingUtil(); private Configuration CONF = HTU.getConfiguration(); private Table table; private HRegionServer rs1, rs2; - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; @Parameterized.Parameter public String cacheType; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClusterId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClusterId.java index 53d1fc57be0..4d8092c3f85 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClusterId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestClusterId.java @@ -25,10 +25,10 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; @@ -51,8 +51,8 @@ public class TestClusterId { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestClusterId.class); - private final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private JVMClusterUtil.RegionServerThread rst; @@ -83,7 +83,7 @@ public class TestClusterId { //Make sure RS is in blocking state Thread.sleep(10000); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(1).numRegionServers(0).build(); TEST_UTIL.startMiniHBaseCluster(option); @@ -105,7 +105,7 @@ public class TestClusterId { FSDataOutputStream s = null; try { s = fs.create(filePath); - s.writeUTF(HBaseCommonTestingUtility.getRandomUUID().toString()); + s.writeUTF(HBaseCommonTestingUtil.getRandomUUID().toString()); } finally { if (s != null) { s.close(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java index cf39dc0d1e8..5c12617656f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.TableName; @@ -61,7 +61,7 @@ public class TestColumnSeeking { HBaseClassTestRule.forClass(TestColumnSeeking.class); @Rule public TestName name = new TestName(); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestColumnSeeking.class); @@ -171,10 +171,10 @@ public class TestColumnSeeking { assertTrue(KeyValueTestUtil.containsIgnoreMvccVersion(results, kvSet)); } } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @SuppressWarnings("unchecked") @@ -286,7 +286,7 @@ public class TestColumnSeeking { assertTrue(KeyValueTestUtil.containsIgnoreMvccVersion(results, kvSet)); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } List generateRandomWords(int numberOfWords, String suffix) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java index 06fbf8959e3..ba9f70c0ffb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Connection; @@ -53,7 +53,7 @@ public class TestCompactSplitThread { HBaseClassTestRule.forClass(TestCompactSplitThread.class); private static final Logger LOG = LoggerFactory.getLogger(TestCompactSplitThread.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final TableName tableName = TableName.valueOf(getClass().getSimpleName()); private final byte[] family = Bytes.toBytes("f"); private static final int NUM_RS = 1; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java index 6d9635118ba..d8dc7c9b6c1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -111,12 +111,12 @@ public class TestCompactingMemStore extends TestDefaultMemStore { conf.setBoolean(MemStoreLAB.USEMSLAB_KEY, true); conf.setFloat(MemStoreLAB.CHUNK_POOL_MAXSIZE_KEY, 0.2f); conf.setInt(HRegion.MEMSTORE_PERIODIC_FLUSH_INTERVAL, 1000); - HBaseTestingUtility hbaseUtility = new HBaseTestingUtility(conf); + HBaseTestingUtil hbaseUtility = new HBaseTestingUtil(conf); ColumnFamilyDescriptor familyDescriptor = ColumnFamilyDescriptorBuilder.of(FAMILY); TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(TableName.valueOf("foobar")) .setColumnFamily(familyDescriptor).build(); RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf("foobar")).build(); - WAL wal = HBaseTestingUtility.createWal(conf, hbaseUtility.getDataTestDir(), info); + WAL wal = HBaseTestingUtil.createWal(conf, hbaseUtility.getDataTestDir(), info); this.region = HRegion.createHRegion(info, hbaseUtility.getDataTestDir(), conf, tableDescriptor, wal, true); this.regionServicesForStores = Mockito.spy(region.getRegionServicesForStores()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java index a9b867b2272..ac4af015443 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY_BYTES; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY_BYTES; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.apache.hadoop.hbase.regionserver.Store.PRIORITY_USER; import static org.apache.hadoop.hbase.regionserver.compactions.CloseChecker.SIZE_LIMIT_KEY; import static org.apache.hadoop.hbase.regionserver.compactions.CloseChecker.TIME_LIMIT_KEY; @@ -48,7 +48,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.Waiter; @@ -102,7 +102,7 @@ public class TestCompaction { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected Configuration conf = UTIL.getConfiguration(); private HRegion r = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java index baf9db5dded..1837bfae4d9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -66,7 +66,7 @@ public class TestCompactionArchiveConcurrentClose { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompactionArchiveConcurrentClose.class); - private HBaseTestingUtility testUtil; + private HBaseTestingUtil testUtil; private Path testDir; private AtomicBoolean archived = new AtomicBoolean(); @@ -76,7 +76,7 @@ public class TestCompactionArchiveConcurrentClose { @Before public void setup() throws Exception { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); testDir = testUtil.getDataTestDir("TestStoreFileRefresherChore"); CommonFSUtils.setRootDir(testUtil.getConfiguration(), testDir); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java index c954139f86c..c5af9a45228 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java @@ -36,7 +36,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.backup.FailedArchiveException; @@ -73,7 +73,7 @@ public class TestCompactionArchiveIOException { private static final String ERROR_FILE = "fffffffffffffffffdeadbeef"; - public HBaseTestingUtility testUtil; + public HBaseTestingUtil testUtil; private Path testDir; @@ -82,7 +82,7 @@ public class TestCompactionArchiveIOException { @Before public void setup() throws Exception { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); testUtil.startMiniDFSCluster(1); testDir = testUtil.getDataTestDirOnTestFS(); CommonFSUtils.setRootDir(testUtil.getConfiguration(), testDir); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java index c19adfd7b42..c5cc9ca20c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -57,7 +57,7 @@ public class TestCompactionFileNotFound { HBaseClassTestRule.forClass(TestCompactionFileNotFound.class); private static final Logger LOG = LoggerFactory.getLogger(TestCompactionFileNotFound.class); - private static final HBaseTestingUtility util = new HBaseTestingUtility(); + private static final HBaseTestingUtil util = new HBaseTestingUtil(); private static final TableName TEST_TABLE = TableName.valueOf("test"); private static final byte[] TEST_FAMILY = Bytes.toBytes("f1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionInDeadRegionServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionInDeadRegionServer.java index 78042cc976f..32c602d4552 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionInDeadRegionServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionInDeadRegionServer.java @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; @@ -69,7 +69,7 @@ public class TestCompactionInDeadRegionServer { private static final Logger LOG = LoggerFactory.getLogger(TestCompactionInDeadRegionServer.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java index b124e288a48..a4a3f865b20 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionLifeCycleTracker.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -73,7 +73,7 @@ public class TestCompactionLifeCycleTracker { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompactionLifeCycleTracker.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME = TableName.valueOf(TestCompactionLifeCycleTracker.class.getSimpleName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java index a448c923127..bbf7250dd04 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionPolicy.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -50,7 +50,7 @@ import org.apache.hbase.thirdparty.com.google.common.collect.Lists; public class TestCompactionPolicy { private final static Logger LOG = LoggerFactory.getLogger(TestCompactionPolicy.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected Configuration conf; protected HStore store; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java index 66fd583d0a2..1a5aa8ee137 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.CompactionState; @@ -55,7 +55,7 @@ public class TestCompactionState { HBaseClassTestRule.forClass(TestCompactionState.class); private static final Logger LOG = LoggerFactory.getLogger(TestCompactionState.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static Random random = new Random(); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionWithByteBuff.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionWithByteBuff.java index 62433f253da..adc4f6dc188 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionWithByteBuff.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionWithByteBuff.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -52,7 +52,7 @@ public class TestCompactionWithByteBuff { @Rule public TestName name = new TestName(); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static Admin admin = null; @@ -109,7 +109,7 @@ public class TestCompactionWithByteBuff { } } - private Table createTable(HBaseTestingUtility util, TableName tableName) + private Table createTable(HBaseTestingUtil util, TableName tableName) throws IOException { TableDescriptor td = TableDescriptorBuilder.newBuilder(tableName) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactorMemLeak.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactorMemLeak.java index 9a6e96a9bda..e0fca1fea7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactorMemLeak.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactorMemLeak.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue.KeyOnlyKeyValue; import org.apache.hadoop.hbase.TableName; @@ -52,7 +52,7 @@ import org.junit.rules.TestName; @Category({ RegionServerTests.class, MediumTests.class }) public class TestCompactorMemLeak { - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration CONF = UTIL.getConfiguration(); private static final AtomicBoolean IS_LAST_CELL_ON_HEAP = new AtomicBoolean(false); private static final byte[] FAMILY = Bytes.toBytes("f"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java index 5d80964ebd7..ac4dd965f4b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java @@ -34,7 +34,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -71,8 +71,8 @@ public class TestCompoundBloomFilter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompoundBloomFilter.class); - private static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger( TestCompoundBloomFilter.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataBlockEncodingTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataBlockEncodingTool.java index 560e2f73c6b..93424b6353a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataBlockEncodingTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataBlockEncodingTool.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Tag; import org.apache.hadoop.hbase.io.compress.Compression; @@ -50,7 +50,7 @@ public class TestDataBlockEncodingTool { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDataBlockEncodingTool.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String ROOT_DIR = TEST_UTIL.getDataTestDir("TestDataBlockEncodingTool").toString(); private static final Configuration conf = TEST_UTIL.getConfiguration(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java index ba5a181e490..74bf075f83d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java @@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -920,7 +920,7 @@ public class TestDefaultMemStore { try { EnvironmentEdgeForMemstoreTest edge = new EnvironmentEdgeForMemstoreTest(); EnvironmentEdgeManager.injectEdge(edge); - HBaseTestingUtility hbaseUtility = new HBaseTestingUtility(conf); + HBaseTestingUtil hbaseUtility = new HBaseTestingUtil(conf); String cf = "foo"; HRegion region = hbaseUtility.createTestRegion("foobar", ColumnFamilyDescriptorBuilder.of(cf)); @@ -946,7 +946,7 @@ public class TestDefaultMemStore { // the MEMSTORE_PERIODIC_FLUSH_INTERVAL is set to a higher value) Configuration conf = new Configuration(); conf.setInt(HRegion.MEMSTORE_PERIODIC_FLUSH_INTERVAL, HRegion.SYSTEM_CACHE_FLUSH_INTERVAL * 10); - HBaseTestingUtility hbaseUtility = new HBaseTestingUtility(conf); + HBaseTestingUtil hbaseUtility = new HBaseTestingUtil(conf); Path testDir = hbaseUtility.getDataTestDir(); EnvironmentEdgeForMemstoreTest edge = new EnvironmentEdgeForMemstoreTest(); EnvironmentEdgeManager.injectEdge(edge); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java index 7804d702581..faf61b6e36b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java @@ -22,7 +22,7 @@ import java.util.Random; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -56,7 +56,7 @@ public class TestDeleteMobTable { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDeleteMobTable.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte[] FAMILY = Bytes.toBytes("family"); private final static byte[] QF = Bytes.toBytes("qualifier"); private static Random random = new Random(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionDisabled.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionDisabled.java index fbd5c0ae90e..87ceca7518c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionDisabled.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionDisabled.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -49,7 +49,7 @@ public class TestEncryptionDisabled { @Rule public ExpectedException exception = ExpectedException.none(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static TableDescriptorBuilder tdb; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java index 2d74d49cf83..a082f4ffcc6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java @@ -30,7 +30,7 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -66,7 +66,7 @@ public class TestEncryptionKeyRotation { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestEncryptionKeyRotation.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Configuration conf = TEST_UTIL.getConfiguration(); private static final Key initialCFKey; private static final Key secondCFKey; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java index b1c6c85f9ea..94901bca9bd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionRandomKeying.java @@ -26,7 +26,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -53,7 +53,7 @@ public class TestEncryptionRandomKeying { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestEncryptionRandomKeying.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static TableDescriptorBuilder tdb; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java index 3a3e371f7e4..9934417ed1a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java @@ -34,7 +34,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; @@ -84,7 +84,7 @@ public class TestEndToEndSplitTransaction { HBaseClassTestRule.forClass(TestEndToEndSplitTransaction.class); private static final Logger LOG = LoggerFactory.getLogger(TestEndToEndSplitTransaction.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Configuration CONF = TEST_UTIL.getConfiguration(); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java index 732d0f56883..707462f05f2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java @@ -33,10 +33,10 @@ import org.apache.hadoop.fs.FilterFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PositionedReadable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -73,7 +73,7 @@ public class TestFSErrorsExposed { private static final Logger LOG = LoggerFactory.getLogger(TestFSErrorsExposed.class); - HBaseTestingUtility util = new HBaseTestingUtility(); + HBaseTestingUtil util = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -231,7 +231,7 @@ public class TestFSErrorsExposed { util.getDFSCluster().restartDataNodes(); } finally { - MiniHBaseCluster cluster = util.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = util.getMiniHBaseCluster(); if (cluster != null) cluster.killAll(); util.shutdownMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFailedAppendAndSync.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFailedAppendAndSync.java index dab82144f04..05e0f1f42ee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFailedAppendAndSync.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFailedAppendAndSync.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.DroppedSnapshotException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableName; @@ -78,7 +78,7 @@ public class TestFailedAppendAndSync { HRegion region = null; // Do not run unit tests in parallel (? Why not? It don't work? Why not? St.Ack) - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; public static Configuration CONF ; private String dir; @@ -87,7 +87,7 @@ public class TestFailedAppendAndSync { @Before public void setup() throws IOException { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); CONF = TEST_UTIL.getConfiguration(); // Disable block cache. CONF.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0f); @@ -314,7 +314,7 @@ public class TestFailedAppendAndSync { /** * @return A region on which you must call - * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} when done. + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. */ public static HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, Configuration conf, WAL wal) throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java index b2fbe2d9e32..0b1a41e4fd3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushLifeCycleTracker.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -63,7 +63,7 @@ public class TestFlushLifeCycleTracker { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFlushLifeCycleTracker.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName NAME = TableName.valueOf(TestFlushLifeCycleTracker.class.getSimpleName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java index 79f0291f2db..a435b9d9b23 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableDescriptors; @@ -83,7 +83,7 @@ public class TestGetClosestAtOrBefore { private static final byte[] T35 = Bytes.toBytes("035"); private static final byte[] T40 = Bytes.toBytes("040"); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Configuration conf = UTIL.getConfiguration(); @Test @@ -94,7 +94,7 @@ public class TestGetClosestAtOrBefore { FSTableDescriptors.tryUpdateMetaTableDescriptor(UTIL.getConfiguration()); TableDescriptor td = tds.get(TableName.META_TABLE_NAME); td = TableDescriptorBuilder.newBuilder(td).setMemStoreFlushSize(64 * 1024 * 1024).build(); - HRegion mr = HBaseTestingUtility.createRegionAndWAL(RegionInfoBuilder.FIRST_META_REGIONINFO, + HRegion mr = HBaseTestingUtil.createRegionAndWAL(RegionInfoBuilder.FIRST_META_REGIONINFO, rootdir, conf, td); try { // Write rows for three tables 'A', 'B', and 'C'. @@ -159,7 +159,7 @@ public class TestGetClosestAtOrBefore { findRow(mr, 'C', 46, -1); findRow(mr, 'C', 43, -1); } finally { - HBaseTestingUtility.closeRegionAndWAL(mr); + HBaseTestingUtil.closeRegionAndWAL(mr); } } @@ -200,8 +200,8 @@ public class TestGetClosestAtOrBefore { @Test public void testGetClosestRowBefore3() throws IOException { HRegion region = null; - byte[] c0 = HBaseTestingUtility.COLUMNS[0]; - byte[] c1 = HBaseTestingUtility.COLUMNS[1]; + byte[] c0 = HBaseTestingUtil.COLUMNS[0]; + byte[] c1 = HBaseTestingUtil.COLUMNS[1]; try { TableName tn = TableName.valueOf(testName.getMethodName()); TableDescriptor htd = UTIL.createTableDescriptor(tn); @@ -311,7 +311,7 @@ public class TestGetClosestAtOrBefore { @Test public void testGetClosestRowBefore2() throws IOException { HRegion region = null; - byte[] c0 = HBaseTestingUtility.COLUMNS[0]; + byte[] c0 = HBaseTestingUtil.COLUMNS[0]; try { TableName tn = TableName.valueOf(testName.getMethodName()); TableDescriptor htd = UTIL.createTableDescriptor(tn); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHMobStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHMobStore.java index 5105c72d350..318cb18c9ff 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHMobStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHMobStore.java @@ -41,7 +41,7 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -117,7 +117,7 @@ public class TestHMobStore { private List expected = new ArrayList<>(); private long id = EnvironmentEdgeManager.currentTime(); private Get get = new Get(row); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final String DIR = TEST_UTIL.getDataTestDir("TestHMobStore").toString(); /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 2e79bf9b055..a5584ff3259 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -17,10 +17,10 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.COLUMNS; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam2; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam3; +import static org.apache.hadoop.hbase.HBaseTestingUtil.COLUMNS; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam2; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam3; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -82,12 +82,11 @@ import org.apache.hadoop.hbase.DroppedSnapshotException; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants.OperationStatusCode; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.MultithreadedTestUtil; import org.apache.hadoop.hbase.MultithreadedTestUtil.RepeatingTestThread; import org.apache.hadoop.hbase.MultithreadedTestUtil.TestThread; @@ -95,7 +94,8 @@ import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.RegionTooBusyException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TagType; import org.apache.hadoop.hbase.Waiter; @@ -225,7 +225,7 @@ public class TestHRegion { HRegion region = null; // Do not run unit tests in parallel (? Why not? It don't work? Why not? St.Ack) - protected static HBaseTestingUtility TEST_UTIL; + protected static HBaseTestingUtil TEST_UTIL; public static Configuration CONF ; private String dir; private final int MAX_VERSIONS = 2; @@ -248,7 +248,7 @@ public class TestHRegion { @Before public void setup() throws IOException { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); CONF = TEST_UTIL.getConfiguration(); NettyAsyncFSWALConfigHelper.setEventLoopConfig(CONF, GROUP, NioSocketChannel.class); dir = TEST_UTIL.getDataTestDir("TestHRegion").toString(); @@ -260,7 +260,7 @@ public class TestHRegion { @After public void tearDown() throws IOException { // Region may have been closed, but it is still no harm if we close it again here using HTU. - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); EnvironmentEdgeManagerTestHelper.reset(); LOG.info("Cleaning test directory: " + TEST_UTIL.getDataTestDir()); TEST_UTIL.cleanupTestDir(); @@ -276,7 +276,7 @@ public class TestHRegion { assertEquals(HConstants.NO_SEQNUM, region.getMaxFlushedSeqId()); // Weird. This returns 0 if no store files or no edits. Afraid to change it. assertEquals(0, (long)region.getMaxStoreSeqId().get(COLUMN_FAMILY_BYTES)); - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); assertEquals(HConstants.NO_SEQNUM, region.getMaxFlushedSeqId()); assertEquals(0, (long)region.getMaxStoreSeqId().get(COLUMN_FAMILY_BYTES)); // Open region again. @@ -291,7 +291,7 @@ public class TestHRegion { assertEquals(0, (long)region.getMaxStoreSeqId().get(COLUMN_FAMILY_BYTES)); region.flush(true); long max = region.getMaxFlushedSeqId(); - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); assertEquals(max, region.getMaxFlushedSeqId()); this.region = null; } @@ -323,7 +323,7 @@ public class TestHRegion { put.addColumn(COLUMN_FAMILY_BYTES, Bytes.toBytes("abc"), value); region.put(put); // Close with something in memstore and something in the snapshot. Make sure all is cleared. - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); assertEquals(0, region.getMemStoreDataSize()); region = null; } @@ -382,7 +382,7 @@ public class TestHRegion { /** * Create a WAL outside of the usual helper in - * {@link HBaseTestingUtility#createWal(Configuration, Path, RegionInfo)} because that method + * {@link HBaseTestingUtil#createWal(Configuration, Path, RegionInfo)} because that method * doesn't play nicely with FaultyFileSystem. Call this method before overriding * {@code fs.file.impl}. * @param callingMethod a unique component for the path, probably the name of the test method. @@ -447,7 +447,7 @@ public class TestHRegion { this.region = initHRegion(tableName, method, CONF, family); final WALFactory wals = new WALFactory(CONF, method); try { - for (byte[] row : HBaseTestingUtility.ROWS) { + for (byte[] row : HBaseTestingUtil.ROWS) { Put put = new Put(row); put.addColumn(family, family, row); region.put(put); @@ -461,7 +461,7 @@ public class TestHRegion { // After flush, offheap should be zero assertEquals(0, region.getMemStoreOffHeapSize()); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -539,7 +539,7 @@ public class TestHRegion { // Make sure our memory accounting is right. Assert.assertEquals(sizeOfOnePut * 2, region.getMemStoreDataSize()); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } return null; } @@ -586,7 +586,7 @@ public class TestHRegion { p2.add(new KeyValue(row, COLUMN_FAMILY_BYTES, qual3, 3, (byte[])null)); region.put(p2); // Now try close on top of a failing flush. - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); region = null; fail(); } catch (DroppedSnapshotException dse) { @@ -595,7 +595,7 @@ public class TestHRegion { } finally { // Make it so all writes succeed from here on out so can close clean ffs.fault.set(false); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } return null; } @@ -729,7 +729,7 @@ public class TestHRegion { } finally { CONF.set("hbase.region.archive.recovered.edits", "false"); CONF.set(CommonFSUtils.HBASE_WAL_DIR, ""); - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -780,7 +780,7 @@ public class TestHRegion { assertArrayEquals(Bytes.toBytes(i), CellUtil.cloneValue(kvs.get(0))); } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -836,7 +836,7 @@ public class TestHRegion { } } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -926,7 +926,7 @@ public class TestHRegion { assertEquals(1, region.getStoreFileList(columns).size()); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -1014,7 +1014,7 @@ public class TestHRegion { // close the region now, and reopen again region.getTableDescriptor(); region.getRegionInfo(); - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); try { region = HRegion.openHRegion(region, null); } catch (WrongRegionException wre) { @@ -1039,7 +1039,7 @@ public class TestHRegion { assertArrayEquals(Bytes.toBytes(i), value); } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); CONF.setClass(HConstants.REGION_IMPL, HRegion.class, Region.class); @@ -1145,7 +1145,7 @@ public class TestHRegion { } // close the region now, and reopen again - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); region = HRegion.openHRegion(region, null); // now check whether we have can read back the data from region @@ -1156,7 +1156,7 @@ public class TestHRegion { assertArrayEquals(Bytes.toBytes(i), value); } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } @@ -1344,7 +1344,7 @@ public class TestHRegion { } } finally { if (this.region != null) { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -1625,7 +1625,7 @@ public class TestHRegion { // We don't want to race with the mutate Thread.sleep(10); startingClose.countDown(); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); region = null; } catch (IOException e) { throw new RuntimeException(e); @@ -3663,7 +3663,7 @@ public class TestHRegion { 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT); RegionInfo info = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); Path logDir = TEST_UTIL.getDataTestDirOnTestFS(method + ".log"); - final WAL wal = HBaseTestingUtility.createWal(TEST_UTIL.getConfiguration(), logDir, info); + final WAL wal = HBaseTestingUtil.createWal(TEST_UTIL.getConfiguration(), logDir, info); this.region = TEST_UTIL.createLocalHRegion(info, CONF, tableDescriptor, wal); // Put 4 version to memstore @@ -4538,7 +4538,7 @@ public class TestHRegion { } catch (InterruptedException ie) { LOG.warn("Caught exception when joining with flushThread", ie); } - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -4702,7 +4702,7 @@ public class TestHRegion { } try { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } catch (DroppedSnapshotException dse) { // We could get this on way out because we interrupt the background flusher and it could // fail anywhere causing a DSE over in the background flusher... only it is not properly @@ -4900,7 +4900,7 @@ public class TestHRegion { } ctx.stop(); - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; } } @@ -5090,7 +5090,7 @@ public class TestHRegion { @Test public void testgetHDFSBlocksDistribution() throws Exception { - HBaseTestingUtility htu = new HBaseTestingUtility(); + HBaseTestingUtil htu = new HBaseTestingUtil(); // Why do we set the block size in this test? If we set it smaller than the kvs, then we'll // break up the file in to more pieces that can be distributed across the three nodes and we // won't be able to have the condition this test asserts; that at least one node has @@ -5101,12 +5101,12 @@ public class TestHRegion { htu.getConfiguration().setInt("dfs.replication", 2); // set up a cluster with 3 nodes - MiniHBaseCluster cluster = null; + SingleProcessHBaseCluster cluster = null; String dataNodeHosts[] = new String[] { "host1", "host2", "host3" }; int regionServersCount = 3; try { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(regionServersCount).dataNodeHosts(dataNodeHosts).build(); cluster = htu.startMiniCluster(option); byte[][] families = { fam1, fam2 }; @@ -5216,11 +5216,11 @@ public class TestHRegion { RegionInfo hri = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); // Create a region and skip the initialization (like CreateTableHandler) - region = HBaseTestingUtility.createRegionAndWAL(hri, rootDir, CONF, + region = HBaseTestingUtil.createRegionAndWAL(hri, rootDir, CONF, tableDescriptor, false); Path regionDir = region.getRegionFileSystem().getRegionDir(); FileSystem fs = region.getRegionFileSystem().getFileSystem(); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); Path regionInfoFile = new Path(regionDir, HRegionFileSystem.REGION_INFO_FILE); @@ -5231,7 +5231,7 @@ public class TestHRegion { // Try to open the region region = HRegion.openHRegion(rootDir, hri, tableDescriptor, null, CONF); assertEquals(regionDir, region.getRegionFileSystem().getRegionDir()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); // Verify that the .regioninfo file is still there assertTrue(HRegionFileSystem.REGION_INFO_FILE + " should be present in the region dir", @@ -5245,7 +5245,7 @@ public class TestHRegion { region = HRegion.openHRegion(rootDir, hri, tableDescriptor, null, CONF); // region = TEST_UTIL.openHRegion(hri, htd); assertEquals(regionDir, region.getRegionFileSystem().getRegionDir()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); // Verify that the .regioninfo file is still there assertTrue(HRegionFileSystem.REGION_INFO_FILE + " should be present in the region dir", @@ -5553,7 +5553,7 @@ public class TestHRegion { // XXX: The spied AsyncFSWAL can not work properly because of a Mockito defect that can not // deal with classes which have a field of an inner class. See discussions in HBASE-15536. walConf.set(WALFactory.WAL_PROVIDER, "filesystem"); - final WALFactory wals = new WALFactory(walConf, HBaseTestingUtility.getRandomUUID().toString()); + final WALFactory wals = new WALFactory(walConf, HBaseTestingUtil.getRandomUUID().toString()); final WAL wal = spy(wals.getWAL(RegionInfoBuilder.newBuilder(tableName).build())); this.region = initHRegion(tableName, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, CONF, false, tableDurability, wal, @@ -5589,7 +5589,7 @@ public class TestHRegion { verify(wal, never()).sync(); } - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); wals.close(); this.region = null; } @@ -5621,7 +5621,7 @@ public class TestHRegion { HRegion primaryRegion = null, secondaryRegion = null; try { - primaryRegion = HBaseTestingUtility.createRegionAndWAL(primaryHri, + primaryRegion = HBaseTestingUtil.createRegionAndWAL(primaryHri, rootDir, TEST_UTIL.getConfiguration(), tableDescriptor); // load some data @@ -5636,10 +5636,10 @@ public class TestHRegion { verifyData(secondaryRegion, 0, 1000, cq, families); } finally { if (primaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(primaryRegion); + HBaseTestingUtil.closeRegionAndWAL(primaryRegion); } if (secondaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(secondaryRegion); + HBaseTestingUtil.closeRegionAndWAL(secondaryRegion); } } } @@ -5670,7 +5670,7 @@ public class TestHRegion { HRegion primaryRegion = null, secondaryRegion = null; try { - primaryRegion = HBaseTestingUtility.createRegionAndWAL(primaryHri, + primaryRegion = HBaseTestingUtil.createRegionAndWAL(primaryHri, rootDir, TEST_UTIL.getConfiguration(), tableDescriptor); // load some data @@ -5690,10 +5690,10 @@ public class TestHRegion { } } finally { if (primaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(primaryRegion); + HBaseTestingUtil.closeRegionAndWAL(primaryRegion); } if (secondaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(secondaryRegion); + HBaseTestingUtil.closeRegionAndWAL(secondaryRegion); } } } @@ -5728,7 +5728,7 @@ public class TestHRegion { HRegion primaryRegion = null, secondaryRegion = null; try { - primaryRegion = HBaseTestingUtility.createRegionAndWAL(primaryHri, + primaryRegion = HBaseTestingUtil.createRegionAndWAL(primaryHri, rootDir, TEST_UTIL.getConfiguration(), tableDescriptor); // load some data @@ -5750,10 +5750,10 @@ public class TestHRegion { verifyData(secondaryRegion, 0, 1000, cq, families); } finally { if (primaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(primaryRegion); + HBaseTestingUtil.closeRegionAndWAL(primaryRegion); } if (secondaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(secondaryRegion); + HBaseTestingUtil.closeRegionAndWAL(secondaryRegion); } } } @@ -5900,7 +5900,7 @@ public class TestHRegion { /** * @return A region on which you must call - * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} when done. + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. */ protected HRegion initHRegion(TableName tableName, String callingMethod, Configuration conf, byte[]... families) throws IOException { @@ -5909,7 +5909,7 @@ public class TestHRegion { /** * @return A region on which you must call - * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} when done. + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. */ protected HRegion initHRegion(TableName tableName, String callingMethod, Configuration conf, boolean isReadOnly, byte[]... families) throws IOException { @@ -5922,14 +5922,14 @@ public class TestHRegion { Path logDir = TEST_UTIL.getDataTestDirOnTestFS(callingMethod + ".log"); RegionInfo hri = RegionInfoBuilder.newBuilder(tableName).setStartKey(startKey).setEndKey(stopKey).build(); - final WAL wal = HBaseTestingUtility.createWal(conf, logDir, hri); + final WAL wal = HBaseTestingUtil.createWal(conf, logDir, hri); return initHRegion(tableName, startKey, stopKey, conf, isReadOnly, Durability.SYNC_WAL, wal, families); } /** * @return A region on which you must call - * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} when done. + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. */ public HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, Configuration conf, boolean isReadOnly, Durability durability, WAL wal, @@ -6681,14 +6681,14 @@ public class TestHRegion { // open the region w/o rss and wal and flush some files region = - HBaseTestingUtility.createRegionAndWAL(hri, TEST_UTIL.getDataTestDir(), TEST_UTIL + HBaseTestingUtil.createRegionAndWAL(hri, TEST_UTIL.getDataTestDir(), TEST_UTIL .getConfiguration(), htd); assertNotNull(region); // create a file in fam1 for the region before opening in OpenRegionHandler region.put(new Put(Bytes.toBytes("a")).addColumn(fam1, fam1, fam1)); region.flush(true); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); ArgumentCaptor editCaptor = ArgumentCaptor.forClass(WALEdit.class); @@ -6751,7 +6751,7 @@ public class TestHRegion { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam1)).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableName).build(); Path path = TEST_UTIL.getDataTestDir(getClass().getSimpleName()); - region = HBaseTestingUtility.createRegionAndWAL(info, path, + region = HBaseTestingUtil.createRegionAndWAL(info, path, TEST_UTIL.getConfiguration(), tableDescriptor); Put put = new Put(Bytes.toBytes("a-b-0-0")); put.addColumn(fam1, qual1, Bytes.toBytes("c1-value")); @@ -6901,7 +6901,7 @@ public class TestHRegion { } catch (Throwable e) { } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); region = null; CONF.setLong("hbase.busy.wait.duration", defaultBusyWaitDuration); } @@ -6927,7 +6927,7 @@ public class TestHRegion { Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setInt(HFile.FORMAT_VERSION_KEY, HFile.MIN_FORMAT_VERSION_WITH_TAGS); - region = HBaseTestingUtility.createRegionAndWAL( + region = HBaseTestingUtil.createRegionAndWAL( RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(), TEST_UTIL.getDataTestDir(), conf, tableDescriptor); assertNotNull(region); @@ -7218,7 +7218,7 @@ public class TestHRegion { final TableDescriptor htd = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam1)).build(); region = HRegion.createHRegion(hri, TEST_UTIL.getDataTestDir(), conf, htd, - HBaseTestingUtility.createWal(conf, TEST_UTIL.getDataTestDirOnTestFS(method + ".log"), hri)); + HBaseTestingUtil.createWal(conf, TEST_UTIL.getDataTestDirOnTestFS(method + ".log"), hri)); Mutation[] mutations = new Mutation[] { new Put(a) @@ -7388,7 +7388,7 @@ public class TestHRegion { } } finally { try { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); CONF.setInt("hbase.regionserver.wal.disruptor.event.count", 16 * 1024); } catch (DroppedSnapshotException dse) { // We could get this on way out because we interrupt the background flusher and it could diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java index 8f452dc2f28..80d62b88299 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -66,7 +66,7 @@ public class TestHRegionFileSystem { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHRegionFileSystem.class); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestHRegionFileSystem.class); public static final byte[] FAMILY_NAME = Bytes.toBytes("info"); @@ -80,7 +80,7 @@ public class TestHRegionFileSystem { @Test public void testBlockStoragePolicy() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); Configuration conf = TEST_UTIL.getConfiguration(); TEST_UTIL.startMiniCluster(); Table table = TEST_UTIL.createTable(TABLE_NAME, FAMILIES); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java index 85848a09d8a..6633081a4c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java @@ -25,8 +25,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -64,7 +64,7 @@ public class TestHRegionOnCluster { HBaseClassTestRule.forClass(TestHRegionOnCluster.class); private static final Logger LOG = LoggerFactory.getLogger(TestHRegionOnCluster.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -78,7 +78,7 @@ public class TestHRegionOnCluster { try { final TableName tableName = TableName.valueOf(name.getMethodName()); final byte[] FAMILY = Bytes.toBytes("family"); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster master = cluster.getMaster(); // Create table diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java index 71eb7bafd2d..1db4bb8109e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java @@ -48,7 +48,7 @@ import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -123,7 +123,7 @@ public class TestHRegionReplayEvents { private static final Logger LOG = LoggerFactory.getLogger(TestHRegion.class); @Rule public TestName name = new TestName(); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; public static Configuration CONF; private String dir; @@ -149,7 +149,7 @@ public class TestHRegionReplayEvents { @BeforeClass public static void setUpBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniDFSCluster(1); } @@ -216,10 +216,10 @@ public class TestHRegionReplayEvents { } if (primaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(primaryRegion); + HBaseTestingUtil.closeRegionAndWAL(primaryRegion); } if (secondaryRegion != null) { - HBaseTestingUtility.closeRegionAndWAL(secondaryRegion); + HBaseTestingUtil.closeRegionAndWAL(secondaryRegion); } EnvironmentEdgeManagerTestHelper.reset(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java index c0d778a6e5f..34d4681023e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java @@ -37,13 +37,13 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.MultithreadedTestUtil.RepeatingTestThread; import org.apache.hadoop.hbase.MultithreadedTestUtil.TestContext; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -101,7 +101,7 @@ public class TestHRegionServerBulkLoad { HBaseClassTestRule.forClass(TestHRegionServerBulkLoad.class); private static final Logger LOG = LoggerFactory.getLogger(TestHRegionServerBulkLoad.class); - protected static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected final static Configuration conf = UTIL.getConfiguration(); protected final static byte[] QUAL = Bytes.toBytes("qual"); protected final static int NUM_CFS = 10; @@ -341,7 +341,7 @@ public class TestHRegionServerBulkLoad { int numScanners = 50; // Set createWALDir to true and use default values for other options. - UTIL.startMiniCluster(StartMiniClusterOption.builder().createWALDir(true).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().createWALDir(true).build()); try { WAL log = UTIL.getHBaseCluster().getRegionServer(0).getWAL(null); FindBulkHBaseListener listener = new FindBulkHBaseListener(); @@ -400,7 +400,7 @@ public class TestHRegionServerBulkLoad { } private void setConf(Configuration c) { - UTIL = new HBaseTestingUtility(c); + UTIL = new HBaseTestingUtil(c); } static class FindBulkHBaseListener extends TestWALActionsListener.DummyWALActionsListener { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java index e5779b43cbc..0b4ec8f6a99 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionTracing.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.client.Append; @@ -63,7 +63,7 @@ public class TestHRegionTracing { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHRegionTracing.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static byte[] FAMILY = Bytes.toBytes("family"); @@ -96,7 +96,7 @@ public class TestHRegionTracing { RegionInfo info = RegionInfoBuilder.newBuilder(tableName).build(); ChunkCreator.initialize(MemStoreLAB.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null, MemStoreLAB.INDEX_CHUNK_SIZE_PERCENTAGE_DEFAULT); - wal = HBaseTestingUtility.createWal(UTIL.getConfiguration(), + wal = HBaseTestingUtil.createWal(UTIL.getConfiguration(), new Path(UTIL.getDataTestDir(), tableName.getNameAsString()), null); region = HRegion.createHRegion(info, UTIL.getDataTestDir(), UTIL.getConfiguration(), desc, wal); region = UTIL.createLocalHRegion(info, desc); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionWithInMemoryFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionWithInMemoryFlush.java index e64994aa310..ad6f1596ded 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionWithInMemoryFlush.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionWithInMemoryFlush.java @@ -21,7 +21,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -49,7 +49,7 @@ public class TestHRegionWithInMemoryFlush extends TestHRegion { /** * @return A region on which you must call - * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} when done. + * {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} when done. */ @Override public HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, @@ -89,7 +89,7 @@ public class TestHRegionWithInMemoryFlush extends TestHRegion { final WALFactory wals = new WALFactory(CONF, method); int count = 0; try { - for (byte[] row : HBaseTestingUtility.ROWS) { + for (byte[] row : HBaseTestingUtil.ROWS) { Put put = new Put(row); put.addColumn(family, family, row); region.put(put); @@ -109,7 +109,7 @@ public class TestHRegionWithInMemoryFlush extends TestHRegion { Assert.assertEquals(0, region.getMemStoreOffHeapSize()); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java index 3cae0346dbb..c8a0b3869eb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java @@ -65,7 +65,7 @@ import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.MemoryCompactionPolicy; @@ -157,7 +157,7 @@ public class TestHStore { long id = EnvironmentEdgeManager.currentTime(); Get get = new Get(row); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String DIR = TEST_UTIL.getDataTestDir("TestStore").toString(); @Before @@ -497,7 +497,7 @@ public class TestHStore { new HStore(this.store.getHRegion(), this.store.getColumnFamilyDescriptor(), c, false); assertEquals(2, this.store.getStorefilesCount()); - result = HBaseTestingUtility.getFromStoreFile(store, + result = HBaseTestingUtil.getFromStoreFile(store, get.getRow(), qualifiers); assertEquals(1, result.size()); @@ -519,7 +519,7 @@ public class TestHStore { this.store.add(new KeyValue(row, family, qf6, 1, (byte[])null), null); //Get - result = HBaseTestingUtility.getFromStoreFile(store, + result = HBaseTestingUtil.getFromStoreFile(store, get.getRow(), qualifiers); //Compare @@ -583,7 +583,7 @@ public class TestHStore { flush(3); //Get - result = HBaseTestingUtility.getFromStoreFile(store, + result = HBaseTestingUtil.getFromStoreFile(store, get.getRow(), qualifiers); //this.store.get(get, qualifiers, result); @@ -619,7 +619,7 @@ public class TestHStore { this.store.add(new KeyValue(row, family, qf6, 1, (byte[])null), null); //Get - result = HBaseTestingUtility.getFromStoreFile(store, + result = HBaseTestingUtil.getFromStoreFile(store, get.getRow(), qualifiers); //Need to sort the result since multiple files @@ -829,27 +829,27 @@ public class TestHStore { get.addColumn(family,qf1); get.setTimeRange(0,15); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()>0); get.setTimeRange(40,90); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()>0); get.setTimeRange(10,45); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()>0); get.setTimeRange(80,145); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()>0); get.setTimeRange(1,2); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()>0); get.setTimeRange(90,200); - result = HBaseTestingUtility.getFromStoreFile(store, get); + result = HBaseTestingUtil.getFromStoreFile(store, get); assertTrue(result.size()==0); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java index 55228f76c47..e6f0357204f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java @@ -44,7 +44,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -102,7 +102,7 @@ public class TestHStoreFile { HBaseClassTestRule.forClass(TestHStoreFile.class); private static final Logger LOG = LoggerFactory.getLogger(TestHStoreFile.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private CacheConfig cacheConf = new CacheConfig(TEST_UTIL.getConfiguration()); private static String ROOT_DIR = TEST_UTIL.getDataTestDir("TestStoreFile").toString(); private static final ChecksumType CKTYPE = ChecksumType.CRC32C; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java index 205f4cbfd31..d17e30107f5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java @@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.Table; @@ -45,7 +45,7 @@ public class TestHdfsSnapshotHRegion { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHdfsSnapshotHRegion.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String SNAPSHOT_NAME = "foo_snapshot"; private Table table; public static final TableName TABLE_NAME = TableName.valueOf("foo"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java index 622a09f351f..626048b487d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHeapMemoryManager.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; @@ -62,7 +62,7 @@ public class TestHeapMemoryManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHeapMemoryManager.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private long maxHeapSize = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestIsDeleteFailure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestIsDeleteFailure.java index 13e311003c8..75af6bf2434 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestIsDeleteFailure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestIsDeleteFailure.java @@ -20,7 +20,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Mutation; @@ -50,7 +50,7 @@ import org.junit.rules.TestName; */ @Category({ RegionServerTests.class, FilterTests.class, MediumTests.class }) public class TestIsDeleteFailure { - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java index ca3ae632270..d15796c9423 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java @@ -24,8 +24,8 @@ import java.util.Random; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -73,7 +73,7 @@ public class TestJoinedScanners { private static final Logger LOG = LoggerFactory.getLogger(TestJoinedScanners.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] cf_essential = Bytes.toBytes("essential"); private static final byte[] cf_joined = Bytes.toBytes("joined"); @@ -97,7 +97,7 @@ public class TestJoinedScanners { String[] dataNodeHosts = new String[] {"host1", "host2", "host3"}; int regionServersCount = 3; - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numRegionServers(regionServersCount).dataNodeHosts(dataNodeHosts).build(); TEST_UTIL.startMiniCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java index ca9e0f63b7e..522487fb9da 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.COLUMNS; +import static org.apache.hadoop.hbase.HBaseTestingUtil.COLUMNS; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -30,7 +30,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -62,7 +62,7 @@ public class TestKeepDeletes { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestKeepDeletes.class); - HBaseTestingUtility hbu = new HBaseTestingUtility(); + HBaseTestingUtil hbu = new HBaseTestingUtil(); private final byte[] T0 = Bytes.toBytes("0"); private final byte[] T1 = Bytes.toBytes("1"); private final byte[] T2 = Bytes.toBytes("2"); @@ -188,7 +188,7 @@ public class TestKeepDeletes { checkResult(r, c0, c0, T1); assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -238,7 +238,7 @@ public class TestKeepDeletes { scan.next(kvs); assertTrue(kvs.isEmpty()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -293,7 +293,7 @@ public class TestKeepDeletes { // major compaction deleted it assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -317,7 +317,7 @@ public class TestKeepDeletes { // ok! } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -407,7 +407,7 @@ public class TestKeepDeletes { assertTrue(CellUtil.isDelete(kvs.get(1))); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -450,7 +450,7 @@ public class TestKeepDeletes { region.compact(true); assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -513,7 +513,7 @@ public class TestKeepDeletes { region.compact(true); assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -591,7 +591,7 @@ public class TestKeepDeletes { region.compact(true); assertEquals(1, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -671,7 +671,7 @@ public class TestKeepDeletes { checkGet(region, T2, c1, c0, ts+3, T2, T1); checkGet(region, T2, c1, c1, ts+3, T2, T1); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -766,7 +766,7 @@ public class TestKeepDeletes { region.compact(true); assertEquals(1, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -817,7 +817,7 @@ public class TestKeepDeletes { assertEquals(4, kvs.size()); scanner.close(); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -895,7 +895,7 @@ public class TestKeepDeletes { region.compact(true); assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /** @@ -939,7 +939,7 @@ public class TestKeepDeletes { // all delete marker gone assertEquals(0, countDeleteMarkers(region)); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } private void checkGet(Region region, byte[] row, byte[] fam, byte[] col, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestLogRoller.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestLogRoller.java index ed7d5dc9c43..1405e40a55e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestLogRoller.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestLogRoller.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.regionserver.wal.FSHLog; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -49,7 +49,7 @@ public class TestLogRoller { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLogRoller.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final int LOG_ROLL_PERIOD = 20 * 1000; private static final String LOG_DIR = "WALs"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java index 9c7929f0e9d..85fdf0871f7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY_BYTES; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY_BYTES; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.apache.hadoop.hbase.regionserver.Store.PRIORITY_USER; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -37,7 +37,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeepDeletedCells; @@ -93,7 +93,7 @@ public class TestMajorCompaction { @Rule public TestName name; private static final Logger LOG = LoggerFactory.getLogger(TestMajorCompaction.class.getName()); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected Configuration conf = UTIL.getConfiguration(); private HRegion r = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMasterAddressTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMasterAddressTracker.java index cba05a4e904..835c5af17f9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMasterAddressTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMasterAddressTracker.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; import java.util.concurrent.Semaphore; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; @@ -55,7 +55,7 @@ public class TestMasterAddressTracker { private static final Logger LOG = LoggerFactory.getLogger(TestMasterAddressTracker.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Cleaned up after each unit test. private static ZKWatcher zk; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreSegmentsIterator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreSegmentsIterator.java index 6c4ed458e8f..d6d9baf7a48 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreSegmentsIterator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreSegmentsIterator.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -76,7 +76,7 @@ public class TestMemStoreSegmentsIterator { @Before public void setup() throws IOException { Configuration conf = new Configuration(); - HBaseTestingUtility hbaseUtility = new HBaseTestingUtility(conf); + HBaseTestingUtil hbaseUtility = new HBaseTestingUtil(conf); TableDescriptorBuilder tableDescriptorBuilder = TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE)); ColumnFamilyDescriptor columnFamilyDescriptor = @@ -85,7 +85,7 @@ public class TestMemStoreSegmentsIterator { RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(TABLE)).build(); Path rootPath = hbaseUtility.getDataTestDir(ROOT_SUB_PATH); - this.wal = HBaseTestingUtility.createWal(conf, rootPath, info); + this.wal = HBaseTestingUtil.createWal(conf, rootPath, info); this.region = HRegion.createHRegion(info, rootPath, conf, tableDescriptorBuilder.build(), this.wal, true); this.store = new HStore(this.region, columnFamilyDescriptor, conf, false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java index a31a6be72b1..089397313fe 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.COLUMNS; +import static org.apache.hadoop.hbase.HBaseTestingUtil.COLUMNS; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -27,7 +27,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -61,7 +61,7 @@ public class TestMinVersions { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMinVersions.class); - HBaseTestingUtility hbu = new HBaseTestingUtility(); + HBaseTestingUtil hbu = new HBaseTestingUtil(); private final byte[] T0 = Bytes.toBytes("0"); private final byte[] T1 = Bytes.toBytes("1"); private final byte[] T2 = Bytes.toBytes("2"); @@ -123,7 +123,7 @@ public class TestMinVersions { r = hbu.getClosestRowBefore(region, T2, c0); checkResult(r, c0, T4); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -187,7 +187,7 @@ public class TestMinVersions { r = region.get(g); // this'll use ExplicitColumnTracker checkResult(r, c0, T3,T2,T1); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -252,7 +252,7 @@ public class TestMinVersions { r = region.get(g); // this'll use ExplicitColumnTracker checkResult(r, c0, T3); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -332,7 +332,7 @@ public class TestMinVersions { r = region.get(g); // this'll use ExplicitColumnTracker checkResult(r, c0, T5,T4); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -429,7 +429,7 @@ public class TestMinVersions { r = region.get(g); assertTrue(r.isEmpty()); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -521,7 +521,7 @@ public class TestMinVersions { r = region.get(g); checkResult(r, c0, T2); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -582,7 +582,7 @@ public class TestMinVersions { region.compact(true); verifyAfterTtl(region, ts); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java index 8b1d9bca4dd..56e7cb9432b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY_BYTES; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam2; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY_BYTES; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam2; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -30,7 +30,7 @@ import java.util.Optional; import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.TableName; @@ -69,7 +69,7 @@ public class TestMinorCompaction { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Configuration CONF = UTIL.getConfiguration(); private HRegion r = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java index 7d48fce17e7..bed40bbf59e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java @@ -35,7 +35,7 @@ import java.util.TreeSet; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -104,7 +104,7 @@ public abstract class TestMultiColumnScanner { /** The probability to delete a row/column pair */ private static final double DELETE_PROBABILITY = 0.02; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Parameter(0) public Compression.Algorithm comprAlgo; @@ -258,7 +258,7 @@ public abstract class TestMultiColumnScanner { "pairs", lastDelTimeMap.size() > 0); LOG.info("Number of row/col pairs deleted at least once: " + lastDelTimeMap.size()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } private static String getRowQualStr(Cell kv) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java index 75ad7c186b7..7cb2aa47e02 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java @@ -32,7 +32,7 @@ import java.util.concurrent.BlockingDeque; import java.util.concurrent.LinkedBlockingDeque; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ipc.HBaseRpcController; @@ -73,7 +73,7 @@ public class TestMultiLogThreshold { private static final TableName NAME = TableName.valueOf("tableName"); private static final byte[] TEST_FAM = Bytes.toBytes("fam"); - private HBaseTestingUtility util; + private HBaseTestingUtil util; private Configuration conf; private int threshold; private HRegionServer rs; @@ -106,7 +106,7 @@ public class TestMultiLogThreshold { @Before public void setupTest() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); conf = util.getConfiguration(); threshold = conf.getInt(HConstants.BATCH_ROWS_THRESHOLD_NAME, HConstants.BATCH_ROWS_THRESHOLD_DEFAULT); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMutateRowsRecovery.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMutateRowsRecovery.java index e3b1085b6a7..3dfb43eedd1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMutateRowsRecovery.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMutateRowsRecovery.java @@ -17,14 +17,14 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -57,7 +57,7 @@ public class TestMutateRowsRecovery { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMutateRowsRecovery.class); - private MiniHBaseCluster cluster = null; + private SingleProcessHBaseCluster cluster = null; private Connection connection = null; private static final int NB_SERVERS = 3; @@ -68,7 +68,7 @@ public class TestMutateRowsRecovery { static final byte[] row1 = Bytes.toBytes("rowA"); static final byte[] row2 = Bytes.toBytes("rowB"); - static final HBaseTestingUtility TESTING_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TESTING_UTIL = new HBaseTestingUtil(); @BeforeClass public static void before() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNewVersionBehaviorFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNewVersionBehaviorFromClientSide.java index e7f58d5412d..582f6c9542e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNewVersionBehaviorFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNewVersionBehaviorFromClientSide.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNull; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Delete; @@ -53,7 +53,7 @@ public class TestNewVersionBehaviorFromClientSide { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestNewVersionBehaviorFromClientSide.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW = Bytes.toBytes("r1"); private static final byte[] ROW2 = Bytes.toBytes("r2"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNotCleanupCompactedFileWhenRegionWarmup.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNotCleanupCompactedFileWhenRegionWarmup.java index 8070f1d987a..5a96152d923 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNotCleanupCompactedFileWhenRegionWarmup.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestNotCleanupCompactedFileWhenRegionWarmup.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.regionserver; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -57,7 +57,7 @@ public class TestNotCleanupCompactedFileWhenRegionWarmup { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestNotCleanupCompactedFileWhenRegionWarmup.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static Admin admin; private static Table table; @@ -69,7 +69,7 @@ public class TestNotCleanupCompactedFileWhenRegionWarmup { @BeforeClass public static void beforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); // Set the scanner lease to 20min, so the scanner can't be closed by RegionServer TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 1200000); TEST_UTIL.getConfiguration() diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenRegionFailedMemoryLeak.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenRegionFailedMemoryLeak.java index f533d8c1888..05246c9dcfd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenRegionFailedMemoryLeak.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenRegionFailedMemoryLeak.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.junit.Assert.fail; import static org.mockito.Mockito.spy; @@ -29,7 +29,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -58,7 +58,7 @@ public class TestOpenRegionFailedMemoryLeak { private static final Logger LOG = LoggerFactory.getLogger(TestOpenRegionFailedMemoryLeak.class); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @AfterClass public static void tearDown() throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenSeqNumUnexpectedIncrease.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenSeqNumUnexpectedIncrease.java index ba8ae66a406..1a4eb1f31e3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenSeqNumUnexpectedIncrease.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestOpenSeqNumUnexpectedIncrease.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -52,7 +52,7 @@ public class TestOpenSeqNumUnexpectedIncrease { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestOpenSeqNumUnexpectedIncrease.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static AtomicInteger FAILED_OPEN = new AtomicInteger(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java index 0933f5b6bb9..60446ca9503 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,7 +26,7 @@ import java.util.Random; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants.OperationStatusCode; import org.apache.hadoop.hbase.TableName; @@ -68,7 +68,7 @@ public class TestParallelPut { @Rule public TestName name = new TestName(); private HRegion region = null; - private static HBaseTestingUtility HBTU = new HBaseTestingUtility(); + private static HBaseTestingUtil HBTU = new HBaseTestingUtil(); private static final int THREADS100 = 100; // Test names diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java index d644b2b994e..d366c83a01b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java @@ -30,10 +30,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -75,7 +75,7 @@ public class TestPerColumnFamilyFlush { private static final Logger LOG = LoggerFactory.getLogger(TestPerColumnFamilyFlush.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Path DIR = TEST_UTIL.getDataTestDir("TestHRegion"); @@ -97,7 +97,7 @@ public class TestPerColumnFamilyFlush { } RegionInfo info = RegionInfoBuilder.newBuilder(TABLENAME).build(); Path path = new Path(DIR, callingMethod); - return HBaseTestingUtility.createRegionAndWAL(info, path, conf, builder.build()); + return HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build()); } // A helper function to create puts. @@ -132,7 +132,7 @@ public class TestPerColumnFamilyFlush { @Test public void testSelectiveFlushWhenEnabled() throws IOException { // Set up the configuration, use new one to not conflict with minicluster in other tests - Configuration conf = new HBaseTestingUtility().getConfiguration(); + Configuration conf = new HBaseTestingUtil().getConfiguration(); conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, 200 * 1024); conf.set(FlushPolicyFactory.HBASE_FLUSH_POLICY_KEY, FlushAllLargeStoresPolicy.class.getName()); conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN, @@ -268,13 +268,13 @@ public class TestPerColumnFamilyFlush { // Since we won't find any CF above the threshold, and hence no specific // store to flush, we should flush all the memstores. assertEquals(0, region.getMemStoreDataSize()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test public void testSelectiveFlushWhenNotEnabled() throws IOException { // Set up the configuration, use new one to not conflict with minicluster in other tests - Configuration conf = new HBaseTestingUtility().getConfiguration(); + Configuration conf = new HBaseTestingUtil().getConfiguration(); conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, 200 * 1024); conf.set(FlushPolicyFactory.HBASE_FLUSH_POLICY_KEY, FlushAllStoresPolicy.class.getName()); @@ -327,12 +327,12 @@ public class TestPerColumnFamilyFlush { assertEquals(MutableSegment.DEEP_OVERHEAD, cf3MemstoreSize.getHeapSize()); assertEquals(0, totalMemstoreSize); assertEquals(HConstants.NO_SEQNUM, smallestSeqInRegionCurrentMemstore); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } // Find the (first) region which has the specified name. private static Pair getRegionWithName(TableName tableName) { - MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); List rsts = cluster.getRegionServerThreads(); for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) { HRegionServer hrs = rsts.get(i).getRegionServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java index d59b4aead89..6d202bd3fac 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -58,7 +58,7 @@ public class TestPriorityRpc { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestPriorityRpc.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static HRegionServer RS = null; private static PriorityFunction PRIORITY = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSChoresScheduled.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSChoresScheduled.java index 95ce746ec5f..633adb0c404 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSChoresScheduled.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSChoresScheduled.java @@ -22,9 +22,9 @@ import java.lang.reflect.Field; import org.apache.hadoop.hbase.ExecutorStatusChore; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ScheduledChore; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.junit.AfterClass; @@ -46,11 +46,11 @@ public class TestRSChoresScheduled { private static HRegionServer hRegionServer; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { - UTIL.startMiniCluster(StartMiniClusterOption.builder().numRegionServers(1).build()); + UTIL.startMiniCluster(StartTestingClusterOption.builder().numRegionServers(1).build()); hRegionServer = UTIL.getMiniHBaseCluster().getRegionServer(0); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenInitializing.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenInitializing.java index 40919dd2174..7cffc39c165 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenInitializing.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSKilledWhenInitializing.java @@ -28,10 +28,10 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.LocalHBaseCluster; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.ServerListener; @@ -90,7 +90,7 @@ public class TestRSKilledWhenInitializing { Configuration conf = HBaseConfiguration.create(); conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, 1); // Start the cluster - final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(conf); + final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(conf); TEST_UTIL.startMiniDFSCluster(3); TEST_UTIL.startMiniZKCluster(); TEST_UTIL.createRootDir(); @@ -196,9 +196,9 @@ public class TestRSKilledWhenInitializing { * the response to a reportForDuty. When it dies, it clears its ephemeral znode which the master * notices and so removes the region from its set of online regionservers. */ - static class RegisterAndDieRegionServer extends MiniHBaseCluster.MiniHBaseClusterRegionServer { - public RegisterAndDieRegionServer(Configuration conf) - throws IOException, InterruptedException { + static class RegisterAndDieRegionServer + extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer { + public RegisterAndDieRegionServer(Configuration conf) throws IOException, InterruptedException { super(conf); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java index 8754172ba03..c0e72cbf94e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReadAndWriteRegionInfoFile.java @@ -26,8 +26,8 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -47,7 +47,7 @@ public class TestReadAndWriteRegionInfoFile { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestReadAndWriteRegionInfoFile.class); - private static final HBaseCommonTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseCommonTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration CONF = UTIL.getConfiguration(); @@ -72,11 +72,11 @@ public class TestReadAndWriteRegionInfoFile { // Create a region. That'll write the .regioninfo file. FSTableDescriptors fsTableDescriptors = new FSTableDescriptors(FS, ROOT_DIR); FSTableDescriptors.tryUpdateAndGetMetaTableDescriptor(CONF, FS, ROOT_DIR); - HRegion r = HBaseTestingUtility.createRegionAndWAL(ri, ROOT_DIR, CONF, + HRegion r = HBaseTestingUtil.createRegionAndWAL(ri, ROOT_DIR, CONF, fsTableDescriptors.get(TableName.META_TABLE_NAME)); // Get modtime on the file. long modtime = getModTime(r); - HBaseTestingUtility.closeRegionAndWAL(r); + HBaseTestingUtil.closeRegionAndWAL(r); Thread.sleep(1001); r = HRegion.openHRegion(ROOT_DIR, ri, fsTableDescriptors.get(TableName.META_TABLE_NAME), null, CONF); @@ -86,7 +86,7 @@ public class TestReadAndWriteRegionInfoFile { // Now load the file. HRegionFileSystem.loadRegionInfoFileContent(r.getRegionFileSystem().getFileSystem(), r.getRegionFileSystem().getRegionDir()); - HBaseTestingUtility.closeRegionAndWAL(r); + HBaseTestingUtil.closeRegionAndWAL(r); } private long getModTime(final HRegion r) throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java index c287e02dc97..cb8ec4fcf14 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MemoryCompactionPolicy; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -71,7 +71,7 @@ public class TestRecoveredEdits { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRecoveredEdits.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestRecoveredEdits.class); private static BlockCache blockCache; @@ -142,7 +142,7 @@ public class TestRecoveredEdits { LOG.info("Region directory already exists. Deleting."); fs.delete(hrfs.getRegionDir(), true); } - HRegion region = HBaseTestingUtility + HRegion region = HBaseTestingUtil .createRegionAndWAL(hri, hbaseRootDir, conf, tableDescriptor, blockCache); assertEquals(encodedRegionName, region.getRegionInfo().getEncodedName()); List storeFiles = region.getStoreFileList(RECOVEREDITS_COLUMNFAMILY_ARRAY); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEditsReplayAndAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEditsReplayAndAbort.java index ea943452ad3..8906ee3ccf1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEditsReplayAndAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEditsReplayAndAbort.java @@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -83,7 +83,7 @@ public class TestRecoveredEditsReplayAndAbort { protected TableName tableName; protected String method; - protected static HBaseTestingUtility TEST_UTIL; + protected static HBaseTestingUtil TEST_UTIL; public static Configuration CONF ; private HRegion region = null; @@ -91,7 +91,7 @@ public class TestRecoveredEditsReplayAndAbort { @Before public void setup() throws IOException { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); CONF = TEST_UTIL.getConfiguration(); method = name.getMethodName(); tableName = TableName.valueOf(method); @@ -129,7 +129,7 @@ public class TestRecoveredEditsReplayAndAbort { RegionInfo info = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); Path logDir = TEST_UTIL .getDataTestDirOnTestFS("TestRecoveredEidtsReplayAndAbort.log"); - final WAL wal = HBaseTestingUtility.createWal(CONF, logDir, info); + final WAL wal = HBaseTestingUtil.createWal(CONF, logDir, info); Path rootDir = TEST_UTIL.getDataTestDir(); Path tableDir = CommonFSUtils.getTableDir(rootDir, info.getTable()); HRegionFileSystem @@ -204,7 +204,7 @@ public class TestRecoveredEditsReplayAndAbort { //a memory leak. Assert.assertEquals(0, ChunkCreator.getInstance().numberOfMappedChunks()); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); this.region = null; wals.close(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java index 64d3cb9f8b4..803f497b89d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionFavoredNodes.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -55,7 +55,7 @@ public class TestRegionFavoredNodes { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionFavoredNodes.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Table table; private static final TableName TABLE_NAME = TableName.valueOf("table"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionIncrement.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionIncrement.java index 0f369965e60..8a937a3bff2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionIncrement.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionIncrement.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; @@ -66,14 +66,14 @@ public class TestRegionIncrement { private static final Logger LOG = LoggerFactory.getLogger(TestRegionIncrement.class); @Rule public TestName name = new TestName(); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private final static byte [] INCREMENT_BYTES = Bytes.toBytes("increment"); private static final int THREAD_COUNT = 10; private static final int INCREMENT_COUNT = 10000; @Before public void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); } @After diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInfo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInfo.java index e5402b82b9d..2874206241a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInfo.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInfo.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -176,17 +176,17 @@ public class TestRegionInfo { @Test public void testReadAndWriteHRegionInfoFile() throws IOException, InterruptedException { - HBaseTestingUtility htu = new HBaseTestingUtility(); + HBaseTestingUtil htu = new HBaseTestingUtil(); RegionInfo hri = RegionInfoBuilder.FIRST_META_REGIONINFO; Path basedir = htu.getDataTestDir(); // Create a region. That'll write the .regioninfo file. FSTableDescriptors fsTableDescriptors = new FSTableDescriptors(htu.getConfiguration()); FSTableDescriptors.tryUpdateMetaTableDescriptor(htu.getConfiguration()); - HRegion r = HBaseTestingUtility.createRegionAndWAL(hri, basedir, htu.getConfiguration(), + HRegion r = HBaseTestingUtil.createRegionAndWAL(hri, basedir, htu.getConfiguration(), fsTableDescriptors.get(TableName.META_TABLE_NAME)); // Get modtime on the file. long modtime = getModTime(r); - HBaseTestingUtility.closeRegionAndWAL(r); + HBaseTestingUtil.closeRegionAndWAL(r); Thread.sleep(1001); r = HRegion.openHRegion(basedir, hri, fsTableDescriptors.get(TableName.META_TABLE_NAME), null, htu.getConfiguration()); @@ -199,7 +199,7 @@ public class TestRegionInfo { r.getRegionFileSystem().getFileSystem(), r.getRegionFileSystem().getRegionDir()); assertEquals(0, org.apache.hadoop.hbase.client.RegionInfo.COMPARATOR.compare(hri, deserializedHri)); - HBaseTestingUtility.closeRegionAndWAL(r); + HBaseTestingUtil.closeRegionAndWAL(r); } long getModTime(final HRegion r) throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInterrupt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInterrupt.java index 10fa0b9af75..1e3ce753037 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInterrupt.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionInterrupt.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.TableName; @@ -79,7 +79,7 @@ public class TestRegionInterrupt { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionInterrupt.class); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestRegionInterrupt.class); static final byte[] FAMILY = Bytes.toBytes("info"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java index b80358cd1a4..737ba46b707 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java @@ -35,11 +35,11 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CatalogFamilyFormat; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.client.Admin; @@ -114,7 +114,7 @@ public class TestRegionMergeTransactionOnCluster { private static int waitTime = 60 * 1000; - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static HMaster MASTER; private static Admin ADMIN; @@ -122,10 +122,10 @@ public class TestRegionMergeTransactionOnCluster { @BeforeClass public static void beforeAllTests() throws Exception { // Start a cluster - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .masterClass(MyMaster.class).numRegionServers(NB_SERVERS).numDataNodes(NB_SERVERS).build(); TEST_UTIL.startMiniCluster(option); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); MASTER = cluster.getMaster(); MASTER.balanceSwitch(false); ADMIN = TEST_UTIL.getConnection().getAdmin(); @@ -158,7 +158,7 @@ public class TestRegionMergeTransactionOnCluster { // Randomly choose one of the two merged regions RegionInfo hri = RandomUtils.nextBoolean() ? mergedRegions.getFirst() : mergedRegions.getSecond(); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); AssignmentManager am = cluster.getMaster().getAssignmentManager(); RegionStates regionStates = am.getRegionStates(); @@ -475,7 +475,7 @@ public class TestRegionMergeTransactionOnCluster { Table table = TEST_UTIL.createTable(tablename, FAMILYNAME, splitRows); LOG.info("Created " + table.getName()); if (replication > 1) { - HBaseTestingUtility.setReplicas(ADMIN, tablename, replication); + HBaseTestingUtil.setReplicas(ADMIN, tablename, replication); LOG.info("Set replication of " + replication + " on " + table.getName()); } loadData(table); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMove.java index c71ada3babe..9f5ed94b981 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMove.java @@ -26,7 +26,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.DoNotRetryRegionException; @@ -60,7 +60,7 @@ public class TestRegionMove { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); public static Configuration CONF ; protected static final String F1 = "f1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionOpen.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionOpen.java index 33e69887484..781f4d52a40 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionOpen.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionOpen.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -64,7 +64,7 @@ public class TestRegionOpen { private static final Logger LOG = LoggerFactory.getLogger(TestRegionOpen.class); private static final int NB_SERVERS = 1; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java index 3b47f37885a..ea6589d95ae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaFailover.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -66,13 +66,13 @@ public class TestRegionReplicaFailover { private static final Logger LOG = LoggerFactory.getLogger(TestRegionReplicaReplicationEndpoint.class); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final int NB_SERVERS = 3; - protected final byte[][] families = new byte[][] {HBaseTestingUtility.fam1, - HBaseTestingUtility.fam2, HBaseTestingUtility.fam3}; - protected final byte[] fam = HBaseTestingUtility.fam1; + protected final byte[][] families = + new byte[][] { HBaseTestingUtil.fam1, HBaseTestingUtil.fam2, HBaseTestingUtil.fam3 }; + protected final byte[] fam = HBaseTestingUtil.fam1; protected final byte[] qual1 = Bytes.toBytes("qual1"); protected final byte[] value1 = Bytes.toBytes("value1"); protected final byte[] row = Bytes.toBytes("rowA"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java index 5ecddb0aca3..61f8fe8f511 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicas.java @@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TestMetaTableAccessor; @@ -86,7 +86,7 @@ public class TestRegionReplicas { private static RegionInfo hriPrimary; private static RegionInfo hriSecondary; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; @BeforeClass @@ -133,7 +133,7 @@ public class TestRegionReplicas { HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary - Assert.assertEquals(1000, HBaseTestingUtility.countRows(table)); + Assert.assertEquals(1000, HBaseTestingUtil.countRows(table)); } finally { HTU.deleteNumericRows(table, f, 0, 1000); closeRegion(HTU, getRS(), hriSecondary); @@ -163,7 +163,7 @@ public class TestRegionReplicas { //load some data to primary HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary - Assert.assertEquals(1000, HBaseTestingUtility.countRows(table)); + Assert.assertEquals(1000, HBaseTestingUtil.countRows(table)); // flush so that region replica can read HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName()); region.flush(true); @@ -187,7 +187,7 @@ public class TestRegionReplicas { //load some data to primary HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary - Assert.assertEquals(1000, HBaseTestingUtility.countRows(table)); + Assert.assertEquals(1000, HBaseTestingUtil.countRows(table)); // flush so that region replica can read HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName()); region.flush(true); @@ -256,7 +256,7 @@ public class TestRegionReplicas { LOG.info("Loading data to primary region"); HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary - Assert.assertEquals(1000, HBaseTestingUtility.countRows(table)); + Assert.assertEquals(1000, HBaseTestingUtil.countRows(table)); // flush so that region replica can read LOG.info("Flushing primary region"); HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasAreDistributed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasAreDistributed.java index cc0b8cb50bd..f9bfa2af757 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasAreDistributed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasAreDistributed.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -58,7 +58,7 @@ public class TestRegionReplicasAreDistributed { private static final int NB_SERVERS = 3; private static Table table; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; Map> serverVsOnlineRegions; Map> serverVsOnlineRegions2; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java index 4ca8059bc28..bd0bbd77c81 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithModifyTable.java @@ -24,7 +24,7 @@ import java.util.Arrays; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; @@ -56,7 +56,7 @@ public class TestRegionReplicasWithModifyTable { private static final int NB_SERVERS = 3; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; @Parameter @@ -93,7 +93,7 @@ public class TestRegionReplicasWithModifyTable { if (disableBeforeModifying) { HTU.getAdmin().disableTable(tableName); } - HBaseTestingUtility.setReplicas(HTU.getAdmin(), tableName, enableReplicaCount); + HBaseTestingUtil.setReplicas(HTU.getAdmin(), tableName, enableReplicaCount); if (disableBeforeModifying) { HTU.getAdmin().enableTable(tableName); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithRestartScenarios.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithRestartScenarios.java index d4e250708e2..91fbb7338c6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithRestartScenarios.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicasWithRestartScenarios.java @@ -23,7 +23,7 @@ import java.util.Collection; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -65,7 +65,7 @@ public class TestRegionReplicasWithRestartScenarios { private Table table; private TableName tableName; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java index 478393d81f9..87837866dc5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbort.java @@ -33,10 +33,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -86,14 +86,14 @@ public class TestRegionServerAbort { private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerAbort.class); - private HBaseTestingUtility testUtil; + private HBaseTestingUtil testUtil; private Configuration conf; private MiniDFSCluster dfsCluster; - private MiniHBaseCluster cluster; + private SingleProcessHBaseCluster cluster; @Before public void setup() throws Exception { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); conf = testUtil.getConfiguration(); conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, StopBlockingRegionObserver.class.getName()); @@ -107,7 +107,8 @@ public class TestRegionServerAbort { testUtil.startMiniZKCluster(); dfsCluster = testUtil.startMiniDFSCluster(2); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(2).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(2).build(); cluster = testUtil.startMiniHBaseCluster(option); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java index 1cb1c0287cf..2448098179f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerAbortTimeout.java @@ -26,8 +26,8 @@ import java.util.TimerTask; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -60,7 +60,7 @@ public class TestRegionServerAbortTimeout { private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerAbortTimeout.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("RSAbort"); @@ -80,11 +80,12 @@ public class TestRegionServerAbortTimeout { // Will schedule a abort timeout task after SLEEP_TIME_WHEN_CLOSE_REGION ms conf.setLong(HRegionServer.ABORT_TIMEOUT, SLEEP_TIME_WHEN_CLOSE_REGION); conf.set(HRegionServer.ABORT_TIMEOUT_TASK, TestAbortTimeoutTask.class.getName()); - StartMiniClusterOption option = StartMiniClusterOption.builder().numRegionServers(2).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numRegionServers(2).build(); UTIL.startMiniCluster(option); TableDescriptor td = TableDescriptorBuilder.newBuilder(TABLE_NAME) - .setCoprocessor(SleepWhenCloseCoprocessor.class.getName()) - .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(CF).build()).build(); + .setCoprocessor(SleepWhenCloseCoprocessor.class.getName()) + .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(CF).build()).build(); UTIL.getAdmin().createTable(td, Bytes.toBytes("0"), Bytes.toBytes("9"), REGIONS_NUM); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerCrashDisableWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerCrashDisableWAL.java index 208fa98ef6a..18c1ef88684 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerCrashDisableWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerCrashDisableWAL.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -49,7 +49,7 @@ public class TestRegionServerCrashDisableWAL { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRegionServerCrashDisableWAL.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("test"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java index af87a2ac718..8ea72f76004 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java @@ -30,8 +30,8 @@ import java.util.Locale; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.util.DNS; @@ -57,7 +57,7 @@ public class TestRegionServerHostname { private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerHostname.class); - private HBaseTestingUtility TEST_UTIL; + private HBaseTestingUtil TEST_UTIL; private static final int NUM_MASTERS = 1; private static final int NUM_RS = 1; @@ -65,7 +65,7 @@ public class TestRegionServerHostname { @Before public void setup() { Configuration conf = HBaseConfiguration.create(); - TEST_UTIL = new HBaseTestingUtility(conf); + TEST_UTIL = new HBaseTestingUtil(conf); } @After @@ -106,7 +106,7 @@ public class TestRegionServerHostname { TEST_UTIL.getConfiguration().set(DNS.MASTER_HOSTNAME_KEY, hostName); TEST_UTIL.getConfiguration().set(DNS.UNSAFE_RS_HOSTNAME_KEY, hostName); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(NUM_RS).numDataNodes(NUM_RS).build(); TEST_UTIL.startMiniCluster(option); try { @@ -169,7 +169,7 @@ public class TestRegionServerHostname { TEST_UTIL.getConfiguration().set(DNS.UNSAFE_RS_HOSTNAME_KEY, hostName); TEST_UTIL.getConfiguration().setBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true); try { - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(NUM_RS).numDataNodes(NUM_RS).build(); TEST_UTIL.startMiniCluster(option); } catch (Exception e) { @@ -191,7 +191,7 @@ public class TestRegionServerHostname { public void testRegionServerHostnameReportedToMaster() throws Exception { TEST_UTIL.getConfiguration().setBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .numMasters(NUM_MASTERS).numRegionServers(NUM_RS).numDataNodes(NUM_RS).build(); TEST_UTIL.startMiniCluster(option); int expectedRS = NUM_RS; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java index 9db187d0a31..d0657a2f125 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java @@ -29,11 +29,11 @@ import java.util.Optional; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Append; @@ -88,10 +88,10 @@ public class TestRegionServerMetrics { public TestName testName = new TestName(); private static MetricsAssertHelper metricsHelper; - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static HRegionServer rs; private static Configuration conf; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static Connection connection; private static MetricsRegionServer metricsRegionServer; private static MetricsRegionServerSource serverSource; @@ -106,7 +106,7 @@ public class TestRegionServerMetrics { @BeforeClass public static void startCluster() throws Exception { metricsHelper = CompatibilityFactory.getInstance(MetricsAssertHelper.class); - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf = TEST_UTIL.getConfiguration(); conf.getLong("hbase.splitlog.max.resubmit", 0); // Make the failure test faster diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java index 81a855922da..4260b1d57c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.ServerName; @@ -71,7 +71,7 @@ public class TestRegionServerNoMaster { private static RegionInfo hri; private static byte[] regionName; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @BeforeClass @@ -93,7 +93,7 @@ public class TestRegionServerNoMaster { stopMasterAndAssignMeta(HTU); } - public static void stopMasterAndAssignMeta(HBaseTestingUtility HTU) + public static void stopMasterAndAssignMeta(HBaseTestingUtil HTU) throws IOException, InterruptedException { // Stop master HMaster master = HTU.getHBaseCluster().getMaster(); @@ -131,7 +131,7 @@ public class TestRegionServerNoMaster { } /** Flush the given region in the mini cluster. Since no master, we cannot use HBaseAdmin.flush() */ - public static void flushRegion(HBaseTestingUtility HTU, RegionInfo regionInfo) + public static void flushRegion(HBaseTestingUtil HTU, RegionInfo regionInfo) throws IOException { for (RegionServerThread rst : HTU.getMiniHBaseCluster().getRegionServerThreads()) { HRegion region = rst.getRegionServer().getRegionByEncodedName(regionInfo.getEncodedName()); @@ -157,7 +157,7 @@ public class TestRegionServerNoMaster { } - public static void openRegion(HBaseTestingUtility HTU, HRegionServer rs, RegionInfo hri) + public static void openRegion(HBaseTestingUtil HTU, HRegionServer rs, RegionInfo hri) throws Exception { AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(rs.getServerName(), hri, null); @@ -171,7 +171,7 @@ public class TestRegionServerNoMaster { checkRegionIsOpened(HTU, rs, hri); } - public static void checkRegionIsOpened(HBaseTestingUtility HTU, HRegionServer rs, + public static void checkRegionIsOpened(HBaseTestingUtil HTU, HRegionServer rs, RegionInfo hri) throws Exception { while (!rs.getRegionsInTransitionInRS().isEmpty()) { Thread.sleep(1); @@ -180,7 +180,7 @@ public class TestRegionServerNoMaster { Assert.assertTrue(rs.getRegion(hri.getRegionName()).isAvailable()); } - public static void closeRegion(HBaseTestingUtility HTU, HRegionServer rs, RegionInfo hri) + public static void closeRegion(HBaseTestingUtil HTU, HRegionServer rs, RegionInfo hri) throws Exception { AdminProtos.CloseRegionRequest crr = ProtobufUtil.buildCloseRegionRequest( rs.getServerName(), hri.getRegionName()); @@ -189,7 +189,7 @@ public class TestRegionServerNoMaster { checkRegionIsClosed(HTU, rs, hri); } - public static void checkRegionIsClosed(HBaseTestingUtility HTU, HRegionServer rs, + public static void checkRegionIsClosed(HBaseTestingUtil HTU, HRegionServer rs, RegionInfo hri) throws Exception { while (!rs.getRegionsInTransitionInRS().isEmpty()) { Thread.sleep(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java index b5c55be2166..de3335bddc9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerOnlineConfigChange.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -64,7 +64,7 @@ public class TestRegionServerOnlineConfigChange { private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerOnlineConfigChange.class.getName()); private static final long WAIT_TIMEOUT = TimeUnit.MINUTES.toMillis(2); - private static HBaseTestingUtility hbaseTestingUtility = new HBaseTestingUtility(); + private static HBaseTestingUtil hbaseTestingUtility = new HBaseTestingUtil(); private static Configuration conf = null; private static Table t1 = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java index e433b90a88d..35cb81d2314 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.RegionMetrics; import org.apache.hadoop.hbase.ServerMetrics; import org.apache.hadoop.hbase.ServerName; @@ -79,7 +79,7 @@ public class TestRegionServerReadRequestMetrics { private static final Logger LOG = LoggerFactory.getLogger(TestRegionServerReadRequestMetrics.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("test"); private static final byte[] CF1 = Bytes.toBytes("c1"); private static final byte[] CF2 = Bytes.toBytes("c2"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java index 12c31ba2637..da49b8710c5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java @@ -27,11 +27,11 @@ import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LocalHBaseCluster; -import org.apache.hadoop.hbase.MiniHBaseCluster.MiniHBaseClusterRegionServer; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster.MiniHBaseClusterRegionServer; import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.ServerManager; @@ -63,7 +63,7 @@ public class TestRegionServerReportForDuty { private static final long SLEEP_INTERVAL = 500; - private HBaseTestingUtility testUtil; + private HBaseTestingUtil testUtil; private LocalHBaseCluster cluster; private RegionServerThread rs; private RegionServerThread rs2; @@ -72,7 +72,7 @@ public class TestRegionServerReportForDuty { @Before public void setUp() throws Exception { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); testUtil.startMiniDFSCluster(1); testUtil.startMiniZKCluster(1); testUtil.createRootDir(); @@ -166,7 +166,7 @@ public class TestRegionServerReportForDuty { // Start a master and wait for it to become the active/primary master. // Use a random unique port - cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); + cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtil.randomFreePort()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, 1); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, 1); master = cluster.addMaster(); @@ -194,7 +194,7 @@ public class TestRegionServerReportForDuty { // Start a new master and use another random unique port // Also let it wait for exactly 2 region severs to report in. // TODO: Add handling bindexception. Random port is not enough!!! Flakie test! - cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); + cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtil.randomFreePort()); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, 2); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, 2); backupMaster = cluster.addMaster(); @@ -221,7 +221,7 @@ public class TestRegionServerReportForDuty { // Start a master and wait for it to become the active/primary master. // Use a random unique port - cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); + cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtil.randomFreePort()); // Override the default RS RPC retry interval of 100ms to 300ms cluster.getConfiguration().setLong("hbase.regionserver.rpc.retry.interval", 300); cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, 1); @@ -248,7 +248,7 @@ public class TestRegionServerReportForDuty { public void testReportForDutyWithEnvironmentEdge() throws Exception { // Start a master and wait for it to become the active/primary master. // Use a random unique port - cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtility.randomFreePort()); + cluster.getConfiguration().setInt(HConstants.MASTER_PORT, HBaseTestingUtil.randomFreePort()); // Set the dispatch and retry delay to 0 since we want the rpc request to be sent immediately cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec", 0); cluster.getConfiguration().setLong("hbase.regionserver.rpc.retry.interval", 0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java index acc3f9dd1ee..91a80aba028 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java @@ -21,10 +21,10 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Put; @@ -50,9 +50,9 @@ public class TestRemoveRegionMetrics { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRemoveRegionMetrics.class); - private static MiniHBaseCluster cluster; + private static SingleProcessHBaseCluster cluster; private static Configuration conf; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static MetricsAssertHelper metricsHelper; @Rule @@ -61,7 +61,7 @@ public class TestRemoveRegionMetrics { @BeforeClass public static void startCluster() throws Exception { metricsHelper = CompatibilityFactory.getInstance(MetricsAssertHelper.class); - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf = TEST_UTIL.getConfiguration(); conf.getLong("hbase.splitlog.max.resubmit", 0); // Make the failure test faster diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRequestsPerSecondMetric.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRequestsPerSecondMetric.java index 54d30722fcf..bd166722118 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRequestsPerSecondMetric.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRequestsPerSecondMetric.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -44,7 +44,7 @@ public class TestRequestsPerSecondMetric { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRequestsPerSecondMetric.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final long METRICS_PERIOD = 2000L; private static Configuration conf; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java index 6c6182fc7f5..85045ea79a9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -59,7 +59,7 @@ public class TestResettingCounters { @Test public void testResettingCounters() throws Exception { - HBaseTestingUtility htu = new HBaseTestingUtility(); + HBaseTestingUtil htu = new HBaseTestingUtil(); Configuration conf = htu.getConfiguration(); FileSystem fs = FileSystem.get(conf); byte [] table = Bytes.toBytes(name.getMethodName()); @@ -90,7 +90,7 @@ public class TestResettingCounters { throw new IOException("Failed delete of " + path); } } - HRegion region = HBaseTestingUtility.createRegionAndWAL(hri, path, conf, tableDescriptor); + HRegion region = HBaseTestingUtil.createRegionAndWAL(hri, path, conf, tableDescriptor); try { Increment odd = new Increment(rows[0]); odd.setDurability(Durability.SKIP_WAL); @@ -121,9 +121,9 @@ public class TestResettingCounters { assertEquals(6, Bytes.toLong(CellUtil.cloneValue(kvs[i]))); } } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java index d4347361fc5..ceb160b8e7b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java @@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -81,7 +81,7 @@ public class TestReversibleScanners { HBaseClassTestRule.forClass(TestReversibleScanners.class); private static final Logger LOG = LoggerFactory.getLogger(TestReversibleScanners.class); - HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static byte[] FAMILYNAME = Bytes.toBytes("testCf"); private static long TS = EnvironmentEdgeManager.currentTime(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowPrefixBloomFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowPrefixBloomFilter.java index 52e0461edbf..b6a4ceb8d1e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowPrefixBloomFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowPrefixBloomFilter.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Get; @@ -70,7 +70,7 @@ public class TestRowPrefixBloomFilter { HBaseClassTestRule.forClass(TestRowPrefixBloomFilter.class); private static final Logger LOG = LoggerFactory.getLogger(TestRowPrefixBloomFilter.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private CacheConfig cacheConf = new CacheConfig(TEST_UTIL.getConfiguration()); private static final ChecksumType CKTYPE = ChecksumType.CRC32C; private static final int CKBYTES = 512; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java index 9aa3129a190..0f07959ae00 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRowTooBig.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -51,7 +51,7 @@ public class TestRowTooBig { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRowTooBig.class); - private final static HBaseTestingUtility HTU = new HBaseTestingUtility(); + private final static HBaseTestingUtil HTU = new HBaseTestingUtil(); private static Path rootRegionDir; private static final TableDescriptor TEST_TD = TableDescriptorBuilder .newBuilder(TableName.valueOf(TestRowTooBig.class.getSimpleName())).build(); @@ -88,7 +88,7 @@ public class TestRowTooBig { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam1)).build(); final RegionInfo hri = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(hri, rootRegionDir, + HRegion region = HBaseTestingUtil.createRegionAndWAL(hri, rootRegionDir, HTU.getConfiguration(), tableDescriptor); try { // Add 5 cells to memstore @@ -104,7 +104,7 @@ public class TestRowTooBig { Get get = new Get(row1); region.get(get); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -128,7 +128,7 @@ public class TestRowTooBig { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam1)).build(); final RegionInfo hri = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build(); - HRegion region = HBaseTestingUtility.createRegionAndWAL(hri, rootRegionDir, + HRegion region = HBaseTestingUtil.createRegionAndWAL(hri, rootRegionDir, HTU.getConfiguration(), tableDescriptor); try { // Add to memstore @@ -146,7 +146,7 @@ public class TestRowTooBig { Get get = new Get(row1); region.get(get); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java index 496933769d5..2688cbfc54a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSCVFWithMiniCluster.java @@ -25,7 +25,7 @@ import java.util.Iterator; import java.util.List; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -79,7 +79,7 @@ public class TestSCVFWithMiniCluster { @BeforeClass public static void setUp() throws Exception { - HBaseTestingUtility util = new HBaseTestingUtility(); + HBaseTestingUtil util = new HBaseTestingUtil(); util.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java index 92f790c95c1..31637f4e6ec 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -85,7 +85,7 @@ public class TestScanWithBloomError { private FileSystem fs; private Configuration conf; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Parameters public static final Collection parameters() { @@ -121,7 +121,7 @@ public class TestScanWithBloomError { createStoreFile(new int[] {1, 9}); scanColSet(new int[]{1, 4, 6, 7}, new int[]{1, 6, 7}); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } private void scanColSet(int[] colSet, int[] expectedResultCols) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java index b60a2151a19..029aa56bcbb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.hbase.regionserver; -import static org.apache.hadoop.hbase.HBaseTestingUtility.START_KEY_BYTES; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam1; -import static org.apache.hadoop.hbase.HBaseTestingUtility.fam2; +import static org.apache.hadoop.hbase.HBaseTestingUtil.START_KEY_BYTES; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam1; +import static org.apache.hadoop.hbase.HBaseTestingUtil.fam2; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -32,7 +32,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.TableName; @@ -78,7 +78,7 @@ public class TestScanner { @Rule public TestName name = new TestName(); private static final Logger LOG = LoggerFactory.getLogger(TestScanner.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte [] FIRST_ROW = HConstants.EMPTY_START_ROW; private static final byte [][] COLS = { HConstants.CATALOG_FAMILY }; @@ -165,7 +165,7 @@ public class TestScanner { assertTrue(count > 10); s.close(); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -218,7 +218,7 @@ public class TestScanner { rowInclusiveStopFilter(scan, stopRow); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -244,7 +244,7 @@ public class TestScanner { return; } } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -283,7 +283,7 @@ public class TestScanner { // Store some new information - String address = HConstants.LOCALHOST_IP + ":" + HBaseTestingUtility.randomFreePort(); + String address = HConstants.LOCALHOST_IP + ":" + HBaseTestingUtil.randomFreePort(); put = new Put(ROW_KEY, EnvironmentEdgeManager.currentTime()); put.addColumn(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER, @@ -354,7 +354,7 @@ public class TestScanner { } finally { // clean up - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -470,7 +470,7 @@ public class TestScanner { LOG.error("Failed", e); throw e; } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -492,7 +492,7 @@ public class TestScanner { LOG.error("Failed", e); throw e; } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } @@ -548,7 +548,7 @@ public class TestScanner { assertTrue(CellUtil.matchingFamily(results.get(0), fam1)); assertTrue(CellUtil.matchingFamily(results.get(1), fam2)); } finally { - HBaseTestingUtility.closeRegionAndWAL(this.region); + HBaseTestingUtil.closeRegionAndWAL(this.region); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java index 810f0f68256..f678f2bcfab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.KeyValue; @@ -87,7 +87,7 @@ public class TestScannerHeartbeatMessages { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScannerHeartbeatMessages.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static AsyncConnection CONN; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRPCScanMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRPCScanMetrics.java index d9a9e251f13..6ec22fb100e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRPCScanMetrics.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRPCScanMetrics.java @@ -18,20 +18,19 @@ package org.apache.hadoop.hbase.regionserver; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster.MiniHBaseClusterRegionServer; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster.MiniHBaseClusterRegionServer; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; -import org.apache.hadoop.hbase.client.TestClientScannerRPCTimeout; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.util.Bytes; @@ -44,7 +43,6 @@ import org.junit.experimental.categories.Category; import org.junit.rules.TestName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; @Category({ RegionServerTests.class, MediumTests.class}) public class TestScannerRPCScanMetrics { @@ -54,7 +52,7 @@ public class TestScannerRPCScanMetrics { HBaseClassTestRule.forClass(TestScannerRPCScanMetrics.class); private static final Logger LOG = LoggerFactory.getLogger(TestScannerRPCScanMetrics.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAMILY = Bytes.toBytes("testFamily"); private static final byte[] QUALIFIER = Bytes.toBytes("testQualifier"); private static final byte[] VALUE = Bytes.toBytes("testValue"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRetriableFailure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRetriableFailure.java index 588ff78a2fc..16fe4e30dbf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRetriableFailure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerRetriableFailure.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.client.Durability; @@ -63,7 +63,7 @@ public class TestScannerRetriableFailure { private static final Logger LOG = LoggerFactory.getLogger(TestScannerRetriableFailure.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final String FAMILY_NAME_STR = "f"; private static final byte[] FAMILY_NAME = Bytes.toBytes(FAMILY_NAME_STR); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java index 8cd4d16bfbf..7be349e88af 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -65,7 +65,7 @@ public class TestScannerWithBulkload { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestScannerWithBulkload.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithCorruptHFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithCorruptHFile.java index f0beb12083c..1788e472026 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithCorruptHFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithCorruptHFile.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Optional; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Durability; @@ -60,7 +60,7 @@ public class TestScannerWithCorruptHFile { @Rule public TestName name = new TestName(); private static final byte[] FAMILY_NAME = Bytes.toBytes("f"); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSecureBulkLoadManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSecureBulkLoadManager.java index 88f201efff6..0fb291c7a4b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSecureBulkLoadManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSecureBulkLoadManager.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.AsyncClusterConnection; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -85,7 +85,7 @@ public class TestSecureBulkLoadManager { private Thread ealierBulkload; private Thread laterBulkload; - protected final static HBaseTestingUtility testUtil = new HBaseTestingUtility(); + protected final static HBaseTestingUtil testUtil = new HBaseTestingUtil(); private static Configuration conf = testUtil.getConfiguration(); @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java index d7367ad99c8..a49d2e4bc19 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -127,11 +127,11 @@ public class TestSeekOptimizations { private long totalSeekDiligent, totalSeekLazy; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Parameters public static final Collection parameters() { - return HBaseTestingUtility.BLOOM_AND_COMPRESSION_COMBINATIONS; + return HBaseTestingUtil.BLOOM_AND_COMPRESSION_COMBINATIONS; } public TestSeekOptimizations(Compression.Algorithm comprAlgo, @@ -449,7 +449,7 @@ public class TestSeekOptimizations { @After public void tearDown() throws IOException { if (region != null) { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } // We have to re-set the lazy seek flag back to the default so that other @@ -482,8 +482,8 @@ public class TestSeekOptimizations { if (eLen != aLen || i != minLen) { throw new AssertionError( "Expected and actual KV arrays differ at position " + i + ": " + - HBaseTestingUtility.safeGetAsStr(expected, i) + " (length " + eLen +") vs. " + - HBaseTestingUtility.safeGetAsStr(actual, i) + " (length " + aLen + ")" + additionalMsg); + HBaseTestingUtil.safeGetAsStr(expected, i) + " (length " + eLen +") vs. " + + HBaseTestingUtil.safeGetAsStr(actual, i) + " (length " + aLen + ")" + additionalMsg); } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSettingTimeoutOnBlockingPoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSettingTimeoutOnBlockingPoint.java index ccfa2247c26..5043f94dfa2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSettingTimeoutOnBlockingPoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSettingTimeoutOnBlockingPoint.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import java.util.Optional; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; @@ -52,7 +52,7 @@ public class TestSettingTimeoutOnBlockingPoint { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSettingTimeoutOnBlockingPoint.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] FAM = Bytes.toBytes("f"); private static final byte[] ROW1 = Bytes.toBytes("row1"); private static final byte[] ROW2 = Bytes.toBytes("row2"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestShutdownWhileWALBroken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestShutdownWhileWALBroken.java index 30c954be5c3..00ecf9847a0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestShutdownWhileWALBroken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestShutdownWhileWALBroken.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; @@ -62,7 +62,7 @@ public class TestShutdownWhileWALBroken { private static final Logger LOG = LoggerFactory.getLogger(TestShutdownWhileWALBroken.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("TestShutdownWhileWALBroken"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java index 49949ed43a7..c96a5c98fdc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java @@ -34,7 +34,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.SplitLogCounters; import org.apache.hadoop.hbase.SplitLogTask; @@ -70,8 +70,8 @@ public class TestSplitLogWorker { private static final Logger LOG = LoggerFactory.getLogger(TestSplitLogWorker.class); private static final int WAIT_TIME = 15000; private final ServerName MANAGER = ServerName.valueOf("manager,1,1"); - private final static HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private DummyServer ds; private ZKWatcher zkw; private SplitLogWorker slw; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java index f455ba8d8d1..73cbfde00cb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java @@ -45,12 +45,12 @@ import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.ZooKeeperConnectionException; @@ -135,18 +135,18 @@ public class TestSplitTransactionOnCluster { private static final Logger LOG = LoggerFactory.getLogger(TestSplitTransactionOnCluster.class); private Admin admin = null; - private MiniHBaseCluster cluster = null; + private SingleProcessHBaseCluster cluster = null; private static final int NB_SERVERS = 3; - static final HBaseTestingUtility TESTING_UTIL = - new HBaseTestingUtility(); + static final HBaseTestingUtil TESTING_UTIL = + new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @BeforeClass public static void before() throws Exception { TESTING_UTIL.getConfiguration().setInt(HConstants.HBASE_BALANCER_PERIOD, 60000); - StartMiniClusterOption option = StartMiniClusterOption.builder() + StartTestingClusterOption option = StartTestingClusterOption.builder() .masterClass(MyMaster.class).numRegionServers(NB_SERVERS). numDataNodes(NB_SERVERS).build(); TESTING_UTIL.startMiniCluster(option); @@ -963,7 +963,7 @@ public class TestSplitTransactionOnCluster { * @return A regionserver that is not notThisOne or null if none * found */ - private HRegionServer getOtherRegionServer(final MiniHBaseCluster cluster, + private HRegionServer getOtherRegionServer(final SingleProcessHBaseCluster cluster, final HRegionServer notThisOne) { for (RegionServerThread rst: cluster.getRegionServerThreads()) { HRegionServer hrs = rst.getRegionServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java index 9cd0ec2a16b..550b6d4ac09 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitWalDataLoss.java @@ -28,7 +28,7 @@ import java.util.Map; import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.hadoop.hbase.DroppedSnapshotException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -70,7 +70,7 @@ public class TestSplitWalDataLoss { private static final Logger LOG = LoggerFactory.getLogger(TestSplitWalDataLoss.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private NamespaceDescriptor namespace = NamespaceDescriptor.create(getClass().getSimpleName()) .build(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileInfo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileInfo.java index ea2d473cbb3..6c76553a02a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileInfo.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileInfo.java @@ -27,7 +27,7 @@ import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.io.Reference; @@ -49,7 +49,7 @@ public class TestStoreFileInfo { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestStoreFileInfo.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /** * Validate that we can handle valid tables with '.', '_', and '-' chars. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java index 30a005d0557..9141327d26d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java @@ -34,7 +34,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; @@ -67,7 +67,7 @@ public class TestStoreFileRefresherChore { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestStoreFileRefresherChore.class); - private HBaseTestingUtility TEST_UTIL; + private HBaseTestingUtil TEST_UTIL; private Path testDir; @Rule @@ -75,7 +75,7 @@ public class TestStoreFileRefresherChore { @Before public void setUp() throws IOException { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); testDir = TEST_UTIL.getDataTestDir("TestStoreFileRefresherChore"); CommonFSUtils.setRootDir(TEST_UTIL.getConfiguration(), testDir); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileScannerWithTagCompression.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileScannerWithTagCompression.java index 823840633e2..4e85c2619c0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileScannerWithTagCompression.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileScannerWithTagCompression.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ArrayBackedTag; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.PrivateCellUtil; @@ -57,7 +57,7 @@ public class TestStoreFileScannerWithTagCompression { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestStoreFileScannerWithTagCompression.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static CacheConfig cacheConf = new CacheConfig(TEST_UTIL.getConfiguration()); private static String ROOT_DIR = TEST_UTIL.getDataTestDir( diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java index 5e3091031cb..5fd37606cfb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java @@ -42,7 +42,7 @@ import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.ExtendedCellBuilderFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -81,7 +81,7 @@ public class TestStoreScanner { private static final String CF_STR = "cf"; private static final byte[] CF = Bytes.toBytes(CF_STR); static Configuration CONF = HBaseConfiguration.create(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private ScanInfo scanInfo = new ScanInfo(CONF, CF, 0, Integer.MAX_VALUE, Long.MAX_VALUE, KeepDeletedCells.FALSE, HConstants.DEFAULT_BLOCKSIZE, 0, CellComparator.getInstance(), false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScannerClosure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScannerClosure.java index b97ecada00b..4cb023f9b9d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScannerClosure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScannerClosure.java @@ -36,7 +36,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeepDeletedCells; import org.apache.hadoop.hbase.KeyValue; @@ -85,7 +85,7 @@ public class TestStoreScannerClosure { static Configuration CONF = HBaseConfiguration.create(); private static CacheConfig cacheConf; private static FileSystem fs; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private ScanInfo scanInfo = new ScanInfo(CONF, CF, 0, Integer.MAX_VALUE, Long.MAX_VALUE, KeepDeletedCells.FALSE, HConstants.DEFAULT_BLOCKSIZE, 0, CellComparator.getInstance(), false); private final static byte[] fam = Bytes.toBytes("cf_1"); @@ -111,7 +111,7 @@ public class TestStoreScannerClosure { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam)).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableName).build(); Path path = TEST_UTIL.getDataTestDir("test"); - region = HBaseTestingUtility.createRegionAndWAL(info, path, + region = HBaseTestingUtil.createRegionAndWAL(info, path, TEST_UTIL.getConfiguration(), tableDescriptor); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java index 54471446bdc..63db911f8b5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStripeStoreFileManager.java @@ -37,7 +37,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -57,7 +57,7 @@ public class TestStripeStoreFileManager { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestStripeStoreFileManager.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Path BASEDIR = TEST_UTIL.getDataTestDir(TestStripeStoreFileManager.class.getSimpleName()); private static final Path CFDIR = HRegionFileSystem.getStoreHomedir(BASEDIR, "region", diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSwitchToStreamRead.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSwitchToStreamRead.java index 61a0689bc4a..d826397c6b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSwitchToStreamRead.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSwitchToStreamRead.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; @@ -54,7 +54,7 @@ public class TestSwitchToStreamRead { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSwitchToStreamRead.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static TableName TABLE_NAME = TableName.valueOf("stream"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java index a8e93b9fd82..26e294b7f4c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTags.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -82,7 +82,7 @@ public class TestTags { static boolean useFilter = false; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public final TestName TEST_NAME = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimestampFilterSeekHint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimestampFilterSeekHint.java index 57d252adb55..e370d6853d0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimestampFilterSeekHint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimestampFilterSeekHint.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Get; @@ -45,7 +45,7 @@ public class TestTimestampFilterSeekHint { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestTimestampFilterSeekHint.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static String RK = "myRK"; private final static byte[] RK_BYTES = Bytes.toBytes(RK); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java index ffb4c7ff655..93f06fa3185 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; @@ -78,7 +78,7 @@ public class TestWALLockup { private static final String COLUMN_FAMILY = "MyCF"; private static final byte [] COLUMN_FAMILY_BYTES = Bytes.toBytes(COLUMN_FAMILY); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration CONF ; private String dir; @@ -442,7 +442,7 @@ public class TestWALLockup { } /** - * @return A region on which you must call {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} + * @return A region on which you must call {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} * when done. */ private static HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java index 555434b8411..d29c0967556 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -82,7 +82,7 @@ public class TestWALMonotonicallyIncreasingSeqId { HBaseClassTestRule.forClass(TestWALMonotonicallyIncreasingSeqId.class); private final Logger LOG = LoggerFactory.getLogger(getClass()); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Path testDir = TEST_UTIL.getDataTestDir("TestWALMonotonicallyIncreasingSeqId"); private WALFactory wals; private FileSystem fileSystem; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java index ac18145e235..006be2124da 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWalAndCompactingMemStoreFlush.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MemoryCompactionPolicy; import org.apache.hadoop.hbase.TableName; @@ -58,7 +58,7 @@ public class TestWalAndCompactingMemStoreFlush { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWalAndCompactingMemStoreFlush.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Path DIR = TEST_UTIL.getDataTestDir("TestHRegion"); public static final TableName TABLENAME = TableName.valueOf("TestWalAndCompactingMemStoreFlush", "t1"); @@ -91,7 +91,7 @@ public class TestWalAndCompactingMemStoreFlush { RegionInfo info = RegionInfoBuilder.newBuilder(TABLENAME).build(); Path path = new Path(DIR, callingMethod); HRegion region = - HBaseTestingUtility.createRegionAndWAL(info, path, conf, builder.build(), false); + HBaseTestingUtil.createRegionAndWAL(info, path, conf, builder.build(), false); region.regionServicesForStores = Mockito.spy(region.regionServicesForStores); ThreadPoolExecutor pool = (ThreadPoolExecutor) Executors.newFixedThreadPool(1); Mockito.when(region.regionServicesForStores.getInMemoryCompactionPool()).thenReturn(pool); @@ -364,7 +364,7 @@ public class TestWalAndCompactingMemStoreFlush { // Also compacted memstores are flushed to disk. assertEquals(0, region.getMemStoreDataSize()); System.out.println(s); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } /*------------------------------------------------------------------------------*/ @@ -622,7 +622,7 @@ public class TestWalAndCompactingMemStoreFlush { assertTrue(cf3ActiveSizePhaseVII.getDataSize() < cf3ActiveSizePhaseVI.getDataSize()); assertTrue(cf5ActiveSizePhaseVII.getDataSize() < cf5ActiveSizePhaseVI.getDataSize()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -754,7 +754,7 @@ public class TestWalAndCompactingMemStoreFlush { assertTrue(smallestSeqCF1PhaseIV > smallestSeqCF1PhaseIII); assertTrue(smallestSeqCF3PhaseIV > smallestSeqCF3PhaseIII); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } @Test @@ -896,7 +896,7 @@ public class TestWalAndCompactingMemStoreFlush { .getHeapSize() + "\n", 0, cf2MemstoreSizePhaseIV.getDataSize()); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } // should end in 300 seconds (5 minutes) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java index f8a95d96183..5ba1035cf82 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Durability; @@ -59,7 +59,7 @@ public class TestWideScanner { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWideScanner.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestWideScanner.class); @@ -88,13 +88,13 @@ public class TestWideScanner { Path testDir = UTIL.getDataTestDir(); RegionInfo hri = RegionInfoBuilder.newBuilder(TESTTABLEDESC.getTableName()).build(); REGION = - HBaseTestingUtility.createRegionAndWAL(hri, testDir, UTIL.getConfiguration(), TESTTABLEDESC); + HBaseTestingUtil.createRegionAndWAL(hri, testDir, UTIL.getConfiguration(), TESTTABLEDESC); } @AfterClass public static void tearDown() throws IOException { if (REGION != null) { - HBaseTestingUtility.closeRegionAndWAL(REGION); + HBaseTestingUtil.closeRegionAndWAL(REGION); REGION = null; } UTIL.cleanupTestDir(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java index dabb79910b4..9d119d39381 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -65,7 +65,7 @@ public class TestCompactedHFilesDischarger { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompactedHFilesDischarger.class); - private final HBaseTestingUtility testUtil = new HBaseTestingUtility(); + private final HBaseTestingUtil testUtil = new HBaseTestingUtil(); private HRegion region; private final static byte[] fam = Bytes.toBytes("cf_1"); private final static byte[] qual1 = Bytes.toBytes("qf_1"); @@ -82,7 +82,7 @@ public class TestCompactedHFilesDischarger { .setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam)).build(); RegionInfo info = RegionInfoBuilder.newBuilder(tableName).build(); Path path = testUtil.getDataTestDir(getClass().getSimpleName()); - region = HBaseTestingUtility.createRegionAndWAL(info, path, + region = HBaseTestingUtil.createRegionAndWAL(info, path, testUtil.getConfiguration(), tableDescriptor); rss = mock(RegionServerServices.class); List regions = new ArrayList<>(1); @@ -95,7 +95,7 @@ public class TestCompactedHFilesDischarger { counter.set(0); scanCompletedCounter.set(0); latch = new CountDownLatch(3); - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); testUtil.cleanupTestDir(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java index 3090572ac30..9e8b9b47911 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestFIFOCompactionPolicy.java @@ -26,9 +26,9 @@ import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; @@ -68,7 +68,7 @@ public class TestFIFOCompactionPolicy { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFIFOCompactionPolicy.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final TableName tableName = TableName.valueOf(getClass().getSimpleName()); @@ -80,7 +80,7 @@ public class TestFIFOCompactionPolicy { public ExpectedException error = ExpectedException.none(); private HStore getStoreWithName(TableName tableName) { - MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); List rsts = cluster.getRegionServerThreads(); for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) { HRegionServer hrs = rsts.get(i).getRegionServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestOffPeakHours.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestOffPeakHours.java index c2ddf8617f6..cd7630ca7c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestOffPeakHours.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestOffPeakHours.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Before; @@ -38,11 +38,11 @@ public class TestOffPeakHours { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestOffPeakHours.class); - private static HBaseTestingUtility testUtil; + private static HBaseTestingUtil testUtil; @BeforeClass public static void setUpClass() { - testUtil = new HBaseTestingUtility(); + testUtil = new HBaseTestingUtil(); } private int hourOfDay; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java index 3157e33c678..811cf1bd02d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestCompactionWithThroughputController.java @@ -25,8 +25,8 @@ import java.util.List; import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -65,7 +65,7 @@ public class TestCompactionWithThroughputController { private static final Logger LOG = LoggerFactory.getLogger(TestCompactionWithThroughputController.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final double EPSILON = 1E-6; @@ -76,7 +76,7 @@ public class TestCompactionWithThroughputController { private final byte[] qualifier = Bytes.toBytes("q"); private HStore getStoreWithName(TableName tableName) { - MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); List rsts = cluster.getRegionServerThreads(); for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) { HRegionServer hrs = rsts.get(i).getRegionServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java index 73e36dade00..aee6c9f6e02 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java @@ -26,8 +26,8 @@ import java.util.Random; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Connection; @@ -67,7 +67,7 @@ public class TestFlushWithThroughputController { LoggerFactory.getLogger(TestFlushWithThroughputController.class); private static final double EPSILON = 1.3E-6; - private HBaseTestingUtility hbtu; + private HBaseTestingUtil hbtu; @Rule public TestName testName = new TestName(); private TableName tableName; private final byte[] family = Bytes.toBytes("f"); @@ -75,7 +75,7 @@ public class TestFlushWithThroughputController { @Before public void setUp() { - hbtu = new HBaseTestingUtility(); + hbtu = new HBaseTestingUtil(); tableName = TableName.valueOf("Table-" + testName.getMethodName()); hbtu.getConfiguration().set( FlushThroughputControllerFactory.HBASE_FLUSH_THROUGHPUT_CONTROLLER_KEY, @@ -88,7 +88,7 @@ public class TestFlushWithThroughputController { } private HStore getStoreWithName(TableName tableName) { - MiniHBaseCluster cluster = hbtu.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = hbtu.getMiniHBaseCluster(); List rsts = cluster.getRegionServerThreads(); for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) { HRegionServer hrs = rsts.get(i).getRegionServer(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java index c43d49be5bc..068489b06b8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java @@ -53,7 +53,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -105,7 +105,7 @@ public abstract class AbstractTestFSWAL { protected static Configuration CONF; protected static FileSystem FS; protected static Path DIR; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public final TestName currentTest = new TestName(); @@ -417,9 +417,9 @@ public abstract class AbstractTestFSWAL { final byte[] rowName = tableName.getName(); final TableDescriptor htd = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.of("f")).build(); - HRegion r = HBaseTestingUtility.createRegionAndWAL(hri, TEST_UTIL.getDefaultRootDirPath(), + HRegion r = HBaseTestingUtil.createRegionAndWAL(hri, TEST_UTIL.getDefaultRootDirPath(), TEST_UTIL.getConfiguration(), htd); - HBaseTestingUtility.closeRegionAndWAL(r); + HBaseTestingUtil.closeRegionAndWAL(r); final int countPerFamily = 10; final AtomicBoolean goslow = new AtomicBoolean(false); NavigableMap scopes = new TreeMap<>(Bytes.BYTES_COMPARATOR); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRollPeriod.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRollPeriod.java index e3da0ecf0c1..b4a26e4ba8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRollPeriod.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRollPeriod.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory; public abstract class AbstractTestLogRollPeriod { private static final Logger LOG = LoggerFactory.getLogger(AbstractTestLogRollPeriod.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static long LOG_ROLL_PERIOD = 4000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java index 6e2059d9f30..bbff17d4a8f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java @@ -24,11 +24,11 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -69,8 +69,8 @@ public abstract class AbstractTestLogRolling { protected FileSystem fs; protected MiniDFSCluster dfsCluster; protected Admin admin; - protected MiniHBaseCluster cluster; - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected SingleProcessHBaseCluster cluster; + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public final TestName name = new TestName(); public AbstractTestLogRolling() { @@ -121,7 +121,7 @@ public abstract class AbstractTestLogRolling { @Before public void setUp() throws Exception { // Use 2 DataNodes and default values for other StartMiniCluster options. - TEST_UTIL.startMiniCluster(StartMiniClusterOption.builder().numDataNodes(2).build()); + TEST_UTIL.startMiniCluster(StartTestingClusterOption.builder().numDataNodes(2).build()); cluster = TEST_UTIL.getHBaseCluster(); dfsCluster = TEST_UTIL.getDFSCluster(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java index 43095d34827..f9179cb1541 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java @@ -22,7 +22,7 @@ import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -40,7 +40,7 @@ import org.junit.rules.TestName; * WAL tests that can be reused across providers. */ public abstract class AbstractTestProtobufLog { - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected FileSystem fs; protected Path dir; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java index d967f5f75d8..4d2213517d1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestWALReplay.java @@ -51,11 +51,11 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -120,7 +120,7 @@ import org.slf4j.LoggerFactory; */ public abstract class AbstractTestWALReplay { private static final Logger LOG = LoggerFactory.getLogger(AbstractTestWALReplay.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final EnvironmentEdge ee = EnvironmentEdgeManager.getDelegate(); private Path hbaseRootDir = null; private String logName; @@ -208,7 +208,7 @@ public abstract class AbstractTestWALReplay { resultScanner.close(); assertEquals(1, count); - MiniHBaseCluster hbaseCluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster hbaseCluster = TEST_UTIL.getMiniHBaseCluster(); List regions = hbaseCluster.getRegions(tableName); assertEquals(1, regions.size()); @@ -278,8 +278,8 @@ public abstract class AbstractTestWALReplay { TableDescriptor tableDescriptor = createBasic3FamilyHTD(tableName); Region region2 = - HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, tableDescriptor); - HBaseTestingUtility.closeRegionAndWAL(region2); + HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, tableDescriptor); + HBaseTestingUtil.closeRegionAndWAL(region2); final byte[] rowName = tableName.getName(); WAL wal1 = createWAL(this.conf, hbaseRootDir, logName); @@ -336,8 +336,8 @@ public abstract class AbstractTestWALReplay { final Path basedir = new Path(this.hbaseRootDir, tableName.getNameAsString()); deleteDir(basedir); final TableDescriptor htd = createBasic3FamilyHTD(tableName); - Region region2 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region2); + Region region2 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region2); WAL wal = createWAL(this.conf, hbaseRootDir, logName); HRegion region = HRegion.openHRegion(hri, htd, wal, this.conf); @@ -359,7 +359,7 @@ public abstract class AbstractTestWALReplay { // Now 'crash' the region by stealing its wal final Configuration newConf = HBaseConfiguration.create(this.conf); - User user = HBaseTestingUtility.getDifferentUser(newConf, tableName.getNameAsString()); + User user = HBaseTestingUtil.getDifferentUser(newConf, tableName.getNameAsString()); user.runAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { @@ -395,8 +395,8 @@ public abstract class AbstractTestWALReplay { final Path basedir = new Path(this.hbaseRootDir, tableName.getNameAsString()); deleteDir(basedir); final TableDescriptor htd = createBasic3FamilyHTD(tableName); - HRegion region2 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region2); + HRegion region2 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region2); WAL wal = createWAL(this.conf, hbaseRootDir, logName); HRegion region = HRegion.openHRegion(hri, htd, wal, this.conf); @@ -423,7 +423,7 @@ public abstract class AbstractTestWALReplay { // Now 'crash' the region by stealing its wal final Configuration newConf = HBaseConfiguration.create(this.conf); - User user = HBaseTestingUtility.getDifferentUser(newConf, tableName.getNameAsString()); + User user = HBaseTestingUtil.getDifferentUser(newConf, tableName.getNameAsString()); user.runAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { @@ -458,8 +458,8 @@ public abstract class AbstractTestWALReplay { final byte[] rowName = tableName.getName(); final int countPerFamily = 10; final TableDescriptor htd = createBasic3FamilyHTD(tableName); - HRegion region3 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region3); + HRegion region3 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region3); // Write countPerFamily edits into the three families. Do a flush on one // of the families during the load of edits so its seqid is not same as // others to test we do right thing when different seqids. @@ -503,7 +503,7 @@ public abstract class AbstractTestWALReplay { assertEquals(2 * result.size(), result2.size()); wal2.sync(); final Configuration newConf = HBaseConfiguration.create(this.conf); - User user = HBaseTestingUtility.getDifferentUser(newConf, tableName.getNameAsString()); + User user = HBaseTestingUtil.getDifferentUser(newConf, tableName.getNameAsString()); user.runAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { @@ -554,8 +554,8 @@ public abstract class AbstractTestWALReplay { final byte[] rowName = tableName.getName(); final int countPerFamily = 10; final TableDescriptor htd = createBasic3FamilyHTD(tableName); - HRegion region3 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region3); + HRegion region3 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region3); // Write countPerFamily edits into the three families. Do a flush on one // of the families during the load of edits so its seqid is not same as // others to test we do right thing when different seqids. @@ -631,8 +631,8 @@ public abstract class AbstractTestWALReplay { final Path basedir = CommonFSUtils.getTableDir(this.hbaseRootDir, tableName); deleteDir(basedir); final TableDescriptor htd = createBasic3FamilyHTD(tableName); - HRegion region3 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region3); + HRegion region3 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region3); // Write countPerFamily edits into the three families. Do a flush on one // of the families during the load of edits so its seqid is not same as // others to test we do right thing when different seqids. @@ -730,8 +730,8 @@ public abstract class AbstractTestWALReplay { deleteDir(basedir); final TableDescriptor htd = createBasic3FamilyHTD(tableName); - HRegion region2 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region2); + HRegion region2 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region2); final WAL wal = createWAL(this.conf, hbaseRootDir, logName); final byte[] rowName = tableName.getName(); final byte[] regionName = hri.getEncodedNameAsBytes(); @@ -771,7 +771,7 @@ public abstract class AbstractTestWALReplay { // Make a new conf and a new fs for the splitter to run on so we can take // over old wal. final Configuration newConf = HBaseConfiguration.create(this.conf); - User user = HBaseTestingUtility.getDifferentUser(newConf, ".replay.wal.secondtime"); + User user = HBaseTestingUtil.getDifferentUser(newConf, ".replay.wal.secondtime"); user.runAs(new PrivilegedExceptionAction() { @Override public Void run() throws Exception { @@ -885,9 +885,9 @@ public abstract class AbstractTestWALReplay { final byte[] rowName = tableName.getName(); final int countPerFamily = 10; final TableDescriptor htd = createBasic1FamilyHTD(tableName); - HRegion region1 = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HRegion region1 = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); Path regionDir = region1.getWALRegionDir(); - HBaseTestingUtility.closeRegionAndWAL(region1); + HBaseTestingUtil.closeRegionAndWAL(region1); WAL wal = createWAL(this.conf, hbaseRootDir, logName); HRegion region = HRegion.openHRegion(this.conf, this.fs, hbaseRootDir, hri, htd, wal); @@ -985,8 +985,8 @@ public abstract class AbstractTestWALReplay { for (byte[] fam : htd.getColumnFamilyNames()) { scopes.put(fam, 0); } - HRegion region = HBaseTestingUtility.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); - HBaseTestingUtility.closeRegionAndWAL(region); + HRegion region = HBaseTestingUtil.createRegionAndWAL(hri, hbaseRootDir, this.conf, htd); + HBaseTestingUtil.closeRegionAndWAL(region); final byte[] family = htd.getColumnFamilies()[0].getName(); final byte[] rowName = tableName.getName(); FSWALEntry entry1 = createFSWALEntry(htd, hri, 1L, rowName, family, ee, mvcc, 1, scopes); @@ -1050,7 +1050,7 @@ public abstract class AbstractTestWALReplay { wal.init(); // Set down maximum recovery so we dfsclient doesn't linger retrying something // long gone. - HBaseTestingUtility.setMaxRecoveryErrorCount(wal.getOutputStream(), 1); + HBaseTestingUtil.setMaxRecoveryErrorCount(wal.getOutputStream(), 1); return wal; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestCombinedAsyncWriter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestCombinedAsyncWriter.java index 50bb277a5a3..359add7fd14 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestCombinedAsyncWriter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestCombinedAsyncWriter.java @@ -22,7 +22,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; @@ -51,7 +51,7 @@ public class TestCombinedAsyncWriter { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCombinedAsyncWriter.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static EventLoopGroup EVENT_LOOP_GROUP; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java index 469b28935e4..de09d5b2b41 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestDurability.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -75,7 +75,7 @@ public class TestDurability { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestDurability.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static FileSystem FS; private static MiniDFSCluster CLUSTER; private static Configuration CONF; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHBaseWalOnEC.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHBaseWalOnEC.java index 0f137c967f2..6dccb785366 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHBaseWalOnEC.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHBaseWalOnEC.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.StreamCapabilities; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -64,7 +64,7 @@ public class TestHBaseWalOnEC { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHBaseWalOnEC.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java index 9d32594ad57..179b0fb2a00 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java @@ -25,11 +25,11 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -78,8 +78,8 @@ public class TestLogRollAbort { private static final Logger LOG = LoggerFactory.getLogger(AbstractTestLogRolling.class); private static MiniDFSCluster dfsCluster; private static Admin admin; - private static MiniHBaseCluster cluster; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static SingleProcessHBaseCluster cluster; + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /* For the split-then-roll test */ private static final Path HBASEDIR = new Path("/hbase"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java index 96d2a42bf70..c2206399872 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java @@ -26,7 +26,7 @@ import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableDescriptors; @@ -62,7 +62,7 @@ public class TestLogRollingNoCluster { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLogRollingNoCluster.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final static byte [] EMPTY_1K_ARRAY = new byte[1024]; private static final int NUM_THREADS = 100; // Spin up this many threads private static final int NUM_ENTRIES = 100; // How many entries to write diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java index e40d7e1ae2b..d2733375c85 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java @@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -57,8 +57,8 @@ public class TestWALActionsListener { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWALActionsListener.class); - private final static HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private final static byte[] SOME_BYTES = Bytes.toBytes("t"); private static Configuration conf; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALConfiguration.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALConfiguration.java index f3f48e99c06..32a04d5e65a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALConfiguration.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALConfiguration.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver.wal; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -52,7 +52,7 @@ import static org.junit.Assert.fail; @Category({ RegionServerTests.class, SmallTests.class }) public class TestWALConfiguration { private static final Logger LOG = LoggerFactory.getLogger(TestWALConfiguration.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWALConfiguration.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java index 66e19a8cfda..c1a53a098fb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java @@ -22,7 +22,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.wal.WAL; @@ -51,7 +51,7 @@ public class TestWALReplay extends AbstractTestWALReplay { wal.init(); // Set down maximum recovery so we dfsclient doesn't linger retrying something // long gone. - HBaseTestingUtility.setMaxRecoveryErrorCount(wal.getOutputStream(), 1); + HBaseTestingUtil.setMaxRecoveryErrorCount(wal.getOutputStream(), 1); return wal; } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/WALDurabilityTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/WALDurabilityTestBase.java index 0daeb13b16e..1b1f4ecdd9d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/WALDurabilityTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/WALDurabilityTestBase.java @@ -25,7 +25,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -48,7 +48,7 @@ public abstract class WALDurabilityTestBase { private static final String COLUMN_FAMILY = "MyCF"; private static final byte[] COLUMN_FAMILY_BYTES = Bytes.toBytes(COLUMN_FAMILY); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf; private String dir; @Rule @@ -107,7 +107,7 @@ public abstract class WALDurabilityTestBase { assertTrue(getSyncFlag(wal)); assertTrue(getWriterSyncFlag(wal)); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } // global hbase.wal.hsync true, no override in put call @@ -144,7 +144,7 @@ public abstract class WALDurabilityTestBase { assertFalse(getSyncFlag(wal)); assertFalse(getWriterSyncFlag(wal)); } finally { - HBaseTestingUtility.closeRegionAndWAL(region); + HBaseTestingUtil.closeRegionAndWAL(region); } } @@ -153,7 +153,7 @@ public abstract class WALDurabilityTestBase { } /** - * @return A region on which you must call {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} + * @return A region on which you must call {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} * when done. */ public static HRegion initHRegion(TableName tableName, byte[] startKey, byte[] stopKey, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java index 8c5c78cec43..2bcca44aeca 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java @@ -25,7 +25,7 @@ import java.io.UncheckedIOException; import java.util.UUID; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; @@ -51,7 +51,7 @@ import org.junit.rules.TestName; */ public class SerialReplicationTestBase { - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static String PEER_ID = "1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java index a8f3442785f..e25aefa52b3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java @@ -31,10 +31,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.client.Admin; @@ -64,11 +64,11 @@ import org.apache.hbase.thirdparty.com.google.common.collect.ImmutableMap; */ public class SyncReplicationTestBase { - protected static final HBaseZKTestingUtility ZK_UTIL = new HBaseZKTestingUtility(); + protected static final HBaseZKTestingUtil ZK_UTIL = new HBaseZKTestingUtil(); - protected static final HBaseTestingUtility UTIL1 = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL1 = new HBaseTestingUtil(); - protected static final HBaseTestingUtility UTIL2 = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL2 = new HBaseTestingUtil(); protected static TableName TABLE_NAME = TableName.valueOf("SyncRep"); @@ -82,7 +82,7 @@ public class SyncReplicationTestBase { protected static Path REMOTE_WAL_DIR2; - protected static void initTestingUtility(HBaseTestingUtility util, String zkParent) { + protected static void initTestingUtility(HBaseTestingUtil util, String zkParent) { util.setZkCluster(ZK_UTIL.getZkCluster()); Configuration conf = util.getConfiguration(); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkParent); @@ -106,8 +106,8 @@ public class SyncReplicationTestBase { ZK_UTIL.startMiniZKCluster(); initTestingUtility(UTIL1, "/cluster1"); initTestingUtility(UTIL2, "/cluster2"); - StartMiniClusterOption option = - StartMiniClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); UTIL1.startMiniCluster(option); UTIL2.startMiniCluster(option); TableDescriptor td = @@ -135,7 +135,7 @@ public class SyncReplicationTestBase { .setRemoteWALDir(REMOTE_WAL_DIR1.toUri().toString()).build()); } - private static void shutdown(HBaseTestingUtility util) throws Exception { + private static void shutdown(HBaseTestingUtil util) throws Exception { if (util.getHBaseCluster() == null) { return; } @@ -158,7 +158,7 @@ public class SyncReplicationTestBase { ZK_UTIL.shutdownMiniZKCluster(); } - protected final void write(HBaseTestingUtility util, int start, int end) throws IOException { + protected final void write(HBaseTestingUtil util, int start, int end) throws IOException { try (Table table = util.getConnection().getTable(TABLE_NAME)) { for (int i = start; i < end; i++) { table.put(new Put(Bytes.toBytes(i)).addColumn(CF, CQ, Bytes.toBytes(i))); @@ -166,7 +166,7 @@ public class SyncReplicationTestBase { } } - protected final void verify(HBaseTestingUtility util, int start, int end) throws IOException { + protected final void verify(HBaseTestingUtil util, int start, int end) throws IOException { try (Table table = util.getConnection().getTable(TABLE_NAME)) { for (int i = start; i < end; i++) { assertEquals(i, Bytes.toInt(table.get(new Get(Bytes.toBytes(i))).getValue(CF, CQ))); @@ -174,7 +174,7 @@ public class SyncReplicationTestBase { } } - protected final void verifyThroughRegion(HBaseTestingUtility util, int start, int end) + protected final void verifyThroughRegion(HBaseTestingUtil util, int start, int end) throws IOException { HRegion region = util.getMiniHBaseCluster().getRegions(TABLE_NAME).get(0); for (int i = start; i < end; i++) { @@ -182,7 +182,7 @@ public class SyncReplicationTestBase { } } - protected final void verifyNotReplicatedThroughRegion(HBaseTestingUtility util, int start, + protected final void verifyNotReplicatedThroughRegion(HBaseTestingUtil util, int start, int end) throws IOException { HRegion region = util.getMiniHBaseCluster().getRegions(TABLE_NAME).get(0); for (int i = start; i < end; i++) { @@ -190,7 +190,7 @@ public class SyncReplicationTestBase { } } - protected final void waitUntilReplicationDone(HBaseTestingUtility util, int end) + protected final void waitUntilReplicationDone(HBaseTestingUtil util, int end) throws Exception { // The reject check is in RSRpcService so we can still read through HRegion HRegion region = util.getMiniHBaseCluster().getRegions(TABLE_NAME).get(0); @@ -208,8 +208,8 @@ public class SyncReplicationTestBase { }); } - protected final void writeAndVerifyReplication(HBaseTestingUtility util1, - HBaseTestingUtility util2, int start, int end) throws Exception { + protected final void writeAndVerifyReplication(HBaseTestingUtil util1, + HBaseTestingUtil util2, int start, int end) throws Exception { write(util1, start, end); waitUntilReplicationDone(util2, end); verifyThroughRegion(util2, start, end); @@ -229,7 +229,7 @@ public class SyncReplicationTestBase { } protected final void verifyRemovedPeer(String peerId, Path remoteWALDir, - HBaseTestingUtility utility) throws Exception { + HBaseTestingUtil utility) throws Exception { ReplicationPeerStorage rps = ReplicationStorageFactory .getReplicationPeerStorage(utility.getZooKeeperWatcher(), utility.getConfiguration()); try { @@ -256,7 +256,7 @@ public class SyncReplicationTestBase { assertTrue(error.getMessage().contains(TABLE_NAME.toString())); } - protected final void verifyReplicationRequestRejection(HBaseTestingUtility utility, + protected final void verifyReplicationRequestRejection(HBaseTestingUtil utility, boolean expectedRejection) throws Exception { HRegionServer regionServer = utility.getRSForFirstRegionInTable(TABLE_NAME); AsyncClusterConnection connection = regionServer.getAsyncClusterConnection(); @@ -283,7 +283,7 @@ public class SyncReplicationTestBase { } } - protected final void waitUntilDeleted(HBaseTestingUtility util, Path remoteWAL) throws Exception { + protected final void waitUntilDeleted(HBaseTestingUtil util, Path remoteWAL) throws Exception { MasterFileSystem mfs = util.getMiniHBaseCluster().getMaster().getMasterFileSystem(); util.waitFor(30000, new ExplainingPredicate() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestHBaseReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestHBaseReplicationEndpoint.java index 41601417a9d..6d4544fa363 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestHBaseReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestHBaseReplicationEndpoint.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.AsyncClusterConnection; import org.apache.hadoop.hbase.client.AsyncRegionServerAdmin; @@ -50,7 +50,7 @@ public class TestHBaseReplicationEndpoint { private static final Logger LOG = LoggerFactory.getLogger(TestHBaseReplicationEndpoint.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private HBaseReplicationEndpoint endpoint; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java index 9baa600ca10..502c6f24256 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java @@ -35,10 +35,10 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -89,7 +89,7 @@ public class TestMasterReplication { private Configuration baseConfiguration; - private HBaseTestingUtility[] utilities; + private HBaseTestingUtil[] utilities; private Configuration[] configurations; private MiniZooKeeperCluster miniZK; @@ -583,12 +583,12 @@ public class TestMasterReplication { @SuppressWarnings("resource") private void startMiniClusters(int numClusters) throws Exception { Random random = new Random(); - utilities = new HBaseTestingUtility[numClusters]; + utilities = new HBaseTestingUtil[numClusters]; configurations = new Configuration[numClusters]; for (int i = 0; i < numClusters; i++) { Configuration conf = new Configuration(baseConfiguration); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/" + i + random.nextInt()); - HBaseTestingUtility utility = new HBaseTestingUtility(conf); + HBaseTestingUtil utility = new HBaseTestingUtil(conf); if (i == 0) { utility.startMiniZKCluster(); miniZK = utility.getZkCluster(); @@ -613,7 +613,7 @@ public class TestMasterReplication { } private void createTableOnClusters(TableDescriptor table) throws Exception { - for (HBaseTestingUtility utility : utilities) { + for (HBaseTestingUtil utility : utilities) { utility.getAdmin().createTable(table); } } @@ -711,7 +711,7 @@ public class TestMasterReplication { private void loadAndValidateHFileReplication(String testName, int masterNumber, int[] slaveNumbers, byte[] row, byte[] fam, Table[] tables, byte[][][] hfileRanges, int numOfRows, int[] expectedCounts, boolean toValidate) throws Exception { - HBaseTestingUtility util = utilities[masterNumber]; + HBaseTestingUtil util = utilities[masterNumber]; Path dir = util.getDataTestDirOnTestFS(testName); FileSystem fs = util.getTestFileSystem(); @@ -779,10 +779,10 @@ public class TestMasterReplication { } } - private void rollWALAndWait(final HBaseTestingUtility utility, final TableName table, + private void rollWALAndWait(final HBaseTestingUtil utility, final TableName table, final byte[] row) throws IOException { final Admin admin = utility.getAdmin(); - final MiniHBaseCluster cluster = utility.getMiniHBaseCluster(); + final SingleProcessHBaseCluster cluster = utility.getMiniHBaseCluster(); // find the region that corresponds to the given row. HRegion region = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java index b3e4a1f4f5f..bbfbdde15c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java @@ -29,9 +29,9 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -72,9 +72,9 @@ public class TestMultiSlaveReplication { private static Configuration conf2; private static Configuration conf3; - private static HBaseTestingUtility utility1; - private static HBaseTestingUtility utility2; - private static HBaseTestingUtility utility3; + private static HBaseTestingUtil utility1; + private static HBaseTestingUtil utility2; + private static HBaseTestingUtil utility3; private static final long SLEEP_TIME = 500; private static final int NB_RETRIES = 100; @@ -104,7 +104,7 @@ public class TestMultiSlaveReplication { "org.apache.hadoop.hbase.replication.TestMasterReplication$CoprocessorCounter"); conf1.setInt("hbase.master.cleaner.interval", 5 * 1000); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); utility1.setZkCluster(miniZK); @@ -116,11 +116,11 @@ public class TestMultiSlaveReplication { conf3 = new Configuration(conf1); conf3.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/3"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); new ZKWatcher(conf2, "cluster2", null, true); - utility3 = new HBaseTestingUtility(conf3); + utility3 = new HBaseTestingUtil(conf3); utility3.setZkCluster(miniZK); new ZKWatcher(conf3, "cluster3", null, true); @@ -133,7 +133,7 @@ public class TestMultiSlaveReplication { @Test public void testMultiSlaveReplication() throws Exception { LOG.info("testCyclicReplication"); - MiniHBaseCluster master = utility1.startMiniCluster(); + SingleProcessHBaseCluster master = utility1.startMiniCluster(); utility2.startMiniCluster(); utility3.startMiniCluster(); try (Connection conn = ConnectionFactory.createConnection(conf1); @@ -205,10 +205,10 @@ public class TestMultiSlaveReplication { } } - private void rollWALAndWait(final HBaseTestingUtility utility, final TableName table, + private void rollWALAndWait(final HBaseTestingUtil utility, final TableName table, final byte[] row) throws IOException { final Admin admin = utility.getAdmin(); - final MiniHBaseCluster cluster = utility.getMiniHBaseCluster(); + final SingleProcessHBaseCluster cluster = utility.getMiniHBaseCluster(); // find the region that corresponds to the given row. HRegion region = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplicationWithBulkLoadedData.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplicationWithBulkLoadedData.java index 1fc7ca614df..db4286125b9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplicationWithBulkLoadedData.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplicationWithBulkLoadedData.java @@ -27,7 +27,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -68,7 +68,7 @@ public final class TestNamespaceReplicationWithBulkLoadedData extends TestBulkLo private static final Logger LOG = LoggerFactory.getLogger(TestNamespaceReplicationWithBulkLoadedData.class); - private static final HBaseTestingUtility UTIL4 = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL4 = new HBaseTestingUtil(); private static final String PEER4_CLUSTER_ID = "peer4"; private static final String PEER4_NS = "ns_peer1"; private static final String PEER4_NS_TABLE = "ns_peer2"; @@ -101,7 +101,7 @@ public final class TestNamespaceReplicationWithBulkLoadedData extends TestBulkLo Connection connection4 = ConnectionFactory.createConnection(CONF4); try (Admin admin4 = connection4.getAdmin()) { - admin4.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin4.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } UTIL4.waitUntilAllRegionsAssigned(tableName); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java index de399e16d10..f27e8e9067d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java @@ -33,7 +33,7 @@ import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -79,9 +79,9 @@ public class TestPerTableCFReplication { private static Configuration conf2; private static Configuration conf3; - private static HBaseTestingUtility utility1; - private static HBaseTestingUtility utility2; - private static HBaseTestingUtility utility3; + private static HBaseTestingUtil utility1; + private static HBaseTestingUtil utility2; + private static HBaseTestingUtil utility3; private static final long SLEEP_TIME = 500; private static final int NB_RETRIES = 100; @@ -121,7 +121,7 @@ public class TestPerTableCFReplication { conf1.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, "org.apache.hadoop.hbase.replication.TestMasterReplication$CoprocessorCounter"); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); new ZKWatcher(conf1, "cluster1", null, true); @@ -132,11 +132,11 @@ public class TestPerTableCFReplication { conf3 = new Configuration(conf1); conf3.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/3"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); new ZKWatcher(conf2, "cluster3", null, true); - utility3 = new HBaseTestingUtility(conf3); + utility3 = new HBaseTestingUtil(conf3); utility3.setZkCluster(miniZK); new ZKWatcher(conf3, "cluster3", null, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java index 4c442fb1ee0..e1228990a0b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -79,8 +79,8 @@ public class TestReplicationBase { protected static Table htable1; protected static Table htable2; - protected static final HBaseTestingUtility UTIL1 = new HBaseTestingUtility(); - protected static final HBaseTestingUtility UTIL2 = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL1 = new HBaseTestingUtil(); + protected static final HBaseTestingUtil UTIL2 = new HBaseTestingUtil(); protected static Configuration CONF1 = UTIL1.getConfiguration(); protected static Configuration CONF2 = UTIL2.getConfiguration(); @@ -186,7 +186,7 @@ public class TestReplicationBase { htable1.put(puts); } - protected static void setupConfig(HBaseTestingUtility util, String znodeParent) { + protected static void setupConfig(HBaseTestingUtil util, String znodeParent) { Configuration conf = util.getConfiguration(); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, znodeParent); // We don't want too many edits per batch sent to the ReplicationEndpoint to trigger @@ -209,8 +209,8 @@ public class TestReplicationBase { conf.setLong("hbase.serial.replication.waiting.ms", 100); } - static void configureClusters(HBaseTestingUtility util1, - HBaseTestingUtility util2) { + static void configureClusters(HBaseTestingUtil util1, + HBaseTestingUtil util2) { setupConfig(util1, "/1"); setupConfig(util2, "/2"); @@ -246,8 +246,8 @@ public class TestReplicationBase { .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(famName).setMaxVersions(100) .setScope(HConstants.REPLICATION_SCOPE_GLOBAL).build()) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(noRepfamName)).build(); - UTIL1.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); - UTIL2.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + UTIL1.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); + UTIL2.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); UTIL1.waitUntilAllRegionsAssigned(tableName); UTIL2.waitUntilAllRegionsAssigned(tableName); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java index 02ae90b284c..269af5c1540 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java @@ -23,7 +23,7 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -121,7 +121,7 @@ public class TestReplicationChangingPeerRegionservers extends TestReplicationBas @Test public void testChangingNumberOfPeerRegionServers() throws IOException, InterruptedException { LOG.info("testSimplePutDelete"); - MiniHBaseCluster peerCluster = UTIL2.getMiniHBaseCluster(); + SingleProcessHBaseCluster peerCluster = UTIL2.getMiniHBaseCluster(); // This test wants two RS's up. We only run one generally so add one. peerCluster.startRegionServer(); Waiter.waitFor(peerCluster.getConfiguration(), 30000, new Waiter.Predicate() { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDeletedTableCFs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDeletedTableCFs.java index 55ef82552c9..b7906ad47a7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDeletedTableCFs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDeletedTableCFs.java @@ -29,7 +29,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; import org.apache.hadoop.hbase.client.Admin; @@ -67,8 +67,8 @@ public class TestReplicationEditsDroppedWithDeletedTableCFs { private static Configuration conf1 = HBaseConfiguration.create(); private static Configuration conf2 = HBaseConfiguration.create(); - protected static HBaseTestingUtility utility1; - protected static HBaseTestingUtility utility2; + protected static HBaseTestingUtil utility1; + protected static HBaseTestingUtil utility2; private static Admin admin1; private static Admin admin2; @@ -91,14 +91,14 @@ public class TestReplicationEditsDroppedWithDeletedTableCFs { conf1.setBoolean(REPLICATION_DROP_ON_DELETED_COLUMN_FAMILY_KEY, true); conf1.set(ZOOKEEPER_ZNODE_PARENT, "/1"); conf1.setInt("replication.source.nb.capacity", 1); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); conf1 = utility1.getConfiguration(); conf2 = HBaseConfiguration.create(conf1); conf2.set(ZOOKEEPER_ZNODE_PARENT, "/2"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); utility1.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDroppedTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDroppedTable.java index 56eecacd99c..98a52be4183 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDroppedTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationEditsDroppedWithDroppedTable.java @@ -22,7 +22,7 @@ import static org.junit.Assert.fail; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -63,8 +63,8 @@ public class TestReplicationEditsDroppedWithDroppedTable { private static Configuration conf1 = HBaseConfiguration.create(); private static Configuration conf2 = HBaseConfiguration.create(); - protected static HBaseTestingUtility utility1; - protected static HBaseTestingUtility utility2; + protected static HBaseTestingUtil utility1; + protected static HBaseTestingUtil utility2; private static Admin admin1; private static Admin admin2; @@ -89,14 +89,14 @@ public class TestReplicationEditsDroppedWithDroppedTable { true); conf1.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1"); conf1.setInt("replication.source.nb.capacity", 1); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); conf1 = utility1.getConfiguration(); conf2 = HBaseConfiguration.create(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); utility1.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationKillRS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationKillRS.java index c1f0760e49c..47903c17ccf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationKillRS.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationKillRS.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.replication; import static org.junit.Assert.fail; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -39,7 +39,7 @@ public abstract class TestReplicationKillRS extends TestReplicationBase { * Load up 1 tables over 2 region servers and kill a source during the upload. The failover * happens internally. WARNING this test sometimes fails because of HBASE-3515 */ - protected void loadTableAndKillRS(HBaseTestingUtility util) throws Exception { + protected void loadTableAndKillRS(HBaseTestingUtil util) throws Exception { // killing the RS with hbase:meta can result into failed puts until we solve // IO fencing int rsToKill1 = util.getHBaseCluster().getServerWithMeta() == 0 ? 1 : 0; @@ -106,7 +106,7 @@ public abstract class TestReplicationKillRS extends TestReplicationBase { } } - private static Thread killARegionServer(final HBaseTestingUtility utility, final long timeout, + private static Thread killARegionServer(final HBaseTestingUtil utility, final long timeout, final int rs) { Thread killer = new Thread() { @Override diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationProcedureRetry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationProcedureRetry.java index 0cbb5cf0f41..cd6a3959618 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationProcedureRetry.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationProcedureRetry.java @@ -28,7 +28,7 @@ import static org.mockito.Mockito.spy; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.master.HMaster; @@ -53,7 +53,7 @@ public class TestReplicationProcedureRetry { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestReplicationProcedureRetry.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDeletedTableCFs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDeletedTableCFs.java index c6491e51e5b..f57306a1888 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDeletedTableCFs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDeletedTableCFs.java @@ -26,7 +26,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -65,8 +65,8 @@ public class TestReplicationStuckWithDeletedTableCFs { private static Configuration conf1 = HBaseConfiguration.create(); private static Configuration conf2 = HBaseConfiguration.create(); - protected static HBaseTestingUtility utility1; - protected static HBaseTestingUtility utility2; + protected static HBaseTestingUtil utility1; + protected static HBaseTestingUtil utility2; private static Admin admin1; private static Admin admin2; @@ -86,14 +86,14 @@ public class TestReplicationStuckWithDeletedTableCFs { public static void setUpBeforeClass() throws Exception { conf1.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/1"); conf1.setInt("replication.source.nb.capacity", 1); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); conf1 = utility1.getConfiguration(); conf2 = HBaseConfiguration.create(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); utility1.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDroppedTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDroppedTable.java index cebf7d81781..512bcdd9a1f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDroppedTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStuckWithDroppedTable.java @@ -24,7 +24,7 @@ import static org.junit.Assert.fail; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -62,8 +62,8 @@ public class TestReplicationStuckWithDroppedTable { private static Configuration conf1 = HBaseConfiguration.create(); private static Configuration conf2 = HBaseConfiguration.create(); - protected static HBaseTestingUtility utility1; - protected static HBaseTestingUtility utility2; + protected static HBaseTestingUtil utility1; + protected static HBaseTestingUtil utility2; private static Admin admin1; private static Admin admin2; @@ -83,14 +83,14 @@ public class TestReplicationStuckWithDroppedTable { public static void setUpBeforeClass() throws Exception { conf1.set(ZOOKEEPER_ZNODE_PARENT, "/1"); conf1.setInt("replication.source.nb.capacity", 1); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); conf1 = utility1.getConfiguration(); conf2 = HBaseConfiguration.create(conf1); conf2.set(ZOOKEEPER_ZNODE_PARENT, "/2"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); utility1.startMiniCluster(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java index fa6109a4270..b4b087cf75b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpTool.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.replication; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.apache.hadoop.hbase.replication.TestReplicationBase.NB_RETRIES; import static org.apache.hadoop.hbase.replication.TestReplicationBase.NB_ROWS_IN_BATCH; import static org.apache.hadoop.hbase.replication.TestReplicationBase.SLEEP_TIME; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolBase.java index 3a45c5bdb9e..a23aebb0311 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolBase.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.replication; import static org.apache.hadoop.hbase.HConstants.REPLICATION_SCOPE_GLOBAL; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -39,8 +39,8 @@ import org.apache.hbase.thirdparty.com.google.common.io.Closeables; public abstract class TestReplicationSyncUpToolBase { - protected static final HBaseTestingUtility UTIL1 = new HBaseTestingUtility(); - protected static final HBaseTestingUtility UTIL2 = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL1 = new HBaseTestingUtil(); + protected static final HBaseTestingUtil UTIL2 = new HBaseTestingUtil(); protected static final TableName TN1 = TableName.valueOf("t1_syncup"); protected static final TableName TN2 = TableName.valueOf("t2_syncup"); @@ -135,7 +135,7 @@ public abstract class TestReplicationSyncUpToolBase { admin1.addReplicationPeer("1", rpc); } - final void syncUp(HBaseTestingUtility util) throws Exception { + final void syncUp(HBaseTestingUtil util) throws Exception { ToolRunner.run(util.getConfiguration(), new ReplicationSyncUp(), new String[0]); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolWithBulkLoadedData.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolWithBulkLoadedData.java index 5c4fc9198cc..4e9f1ebc311 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolWithBulkLoadedData.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSyncUpToolWithBulkLoadedData.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.replication; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.apache.hadoop.hbase.replication.TestReplicationBase.NB_RETRIES; import static org.apache.hadoop.hbase.replication.TestReplicationBase.SLEEP_TIME; import static org.apache.hadoop.hbase.replication.TestReplicationBase.row; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java index d61966f70a7..efea969df16 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWithTags.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -90,8 +90,8 @@ public class TestReplicationWithTags { private static Table htable1; private static Table htable2; - private static HBaseTestingUtility utility1; - private static HBaseTestingUtility utility2; + private static HBaseTestingUtil utility1; + private static HBaseTestingUtil utility2; private static final long SLEEP_TIME = 500; private static final int NB_RETRIES = 10; @@ -116,7 +116,7 @@ public class TestReplicationWithTags { conf1.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, TestCoprocessorForTagsAtSource.class.getName()); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); // Have to reget conf1 in case zk cluster location different @@ -134,7 +134,7 @@ public class TestReplicationWithTags { conf2.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, TestCoprocessorForTagsAtSink.class.getName()); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); LOG.info("Setup second Zk"); @@ -153,11 +153,11 @@ public class TestReplicationWithTags { .build(); try (Connection conn = ConnectionFactory.createConnection(conf1); Admin admin = conn.getAdmin()) { - admin.createTable(tableDescriptor, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin.createTable(tableDescriptor, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } try (Connection conn = ConnectionFactory.createConnection(conf2); Admin admin = conn.getAdmin()) { - admin.createTable(tableDescriptor, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + admin.createTable(tableDescriptor, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); } htable1 = utility1.getConnection().getTable(TABLE_NAME); htable2 = utility2.getConnection().getTable(TABLE_NAME); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java index e87655309e7..51cfa2ee4d0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.AsyncConnection; import org.apache.hadoop.hbase.client.AsyncTable; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -117,7 +117,7 @@ public class TestSyncReplicationActive extends SyncReplicationTestBase { write(UTIL2, 200, 300); } - private void verifyNoClusterIdInRemoteLog(HBaseTestingUtility utility, Path remoteDir, + private void verifyNoClusterIdInRemoteLog(HBaseTestingUtil utility, Path remoteDir, String peerId) throws Exception { FileSystem fs2 = utility.getTestFileSystem(); FileStatus[] files = fs2.listStatus(new Path(remoteDir, peerId)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyCellsReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyCellsReplicationEndpoint.java index f1b1004076a..2f81d8e62b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyCellsReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestVerifyCellsReplicationEndpoint.java @@ -26,7 +26,7 @@ import java.util.concurrent.TimeoutException; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -56,7 +56,7 @@ public class TestVerifyCellsReplicationEndpoint { private static final Logger LOG = LoggerFactory.getLogger(TestVerifyCellsReplicationEndpoint.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("empty"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/master/TestRecoverStandbyProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/master/TestRecoverStandbyProcedure.java index 20281273821..bcf7e62bdbe 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/master/TestRecoverStandbyProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/master/TestRecoverStandbyProcedure.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -91,7 +91,7 @@ public class TestRecoverStandbyProcedure { private static final String PEER_ID = "1"; - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static SyncReplicationReplayWALManager syncReplicationReplayWALManager; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalReplicationThrottler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalReplicationThrottler.java index f528bdaad09..f6a31bba4d7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalReplicationThrottler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalReplicationThrottler.java @@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTestConst; import org.apache.hadoop.hbase.TableName; @@ -69,8 +69,8 @@ public class TestGlobalReplicationThrottler { private static Configuration conf1; private static Configuration conf2; - private static HBaseTestingUtility utility1; - private static HBaseTestingUtility utility2; + private static HBaseTestingUtil utility1; + private static HBaseTestingUtil utility2; private static final byte[] famName = Bytes.toBytes("f"); private static final byte[] VALUE = Bytes.toBytes("v"); @@ -89,7 +89,7 @@ public class TestGlobalReplicationThrottler { conf1.setInt(HConstants.REPLICATION_SOURCE_TOTAL_BUFFER_KEY, REPLICATION_SOURCE_QUOTA); conf1.setLong("replication.source.per.peer.node.bandwidth", 100L); - utility1 = new HBaseTestingUtility(conf1); + utility1 = new HBaseTestingUtil(conf1); utility1.startMiniZKCluster(); MiniZooKeeperCluster miniZK = utility1.getZkCluster(); new ZKWatcher(conf1, "cluster1", null, true); @@ -97,7 +97,7 @@ public class TestGlobalReplicationThrottler { conf2 = new Configuration(conf1); conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2"); - utility2 = new HBaseTestingUtility(conf2); + utility2 = new HBaseTestingUtil(conf2); utility2.setZkCluster(miniZK); new ZKWatcher(conf2, "cluster2", null, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestHBaseInterClusterReplicationEndpointFilterEdits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestHBaseInterClusterReplicationEndpointFilterEdits.java index b20b67f5ce1..c55aee3c1c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestHBaseInterClusterReplicationEndpointFilterEdits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestHBaseInterClusterReplicationEndpointFilterEdits.java @@ -28,7 +28,7 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.TableName; @@ -61,7 +61,7 @@ public class TestHBaseInterClusterReplicationEndpointFilterEdits { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHBaseInterClusterReplicationEndpointFilterEdits.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static HBaseInterClusterReplicationEndpoint endpoint; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplicationEndpoint.java index c68a7f1b1a7..5a06a110854 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplicationEndpoint.java @@ -34,11 +34,11 @@ import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ClientMetaTableAccessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MetaTableAccessor; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Connection; @@ -80,7 +80,7 @@ public class TestMetaRegionReplicaReplicationEndpoint { private static final Logger LOG = LoggerFactory.getLogger(TestMetaRegionReplicaReplicationEndpoint.class); private static final int NB_SERVERS = 4; - private final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private final HBaseTestingUtil HTU = new HBaseTestingUtil(); private int numOfMetaReplica = NB_SERVERS - 1; private static byte[] VALUE = Bytes.toBytes("value"); @@ -108,7 +108,7 @@ public class TestMetaRegionReplicaReplicationEndpoint { // conf.setInt(HConstants.META_REPLICAS_NUM, numOfMetaReplica); HTU.startMiniCluster(NB_SERVERS); // Enable hbase:meta replication. - HBaseTestingUtility.setReplicas(HTU.getAdmin(), TableName.META_TABLE_NAME, numOfMetaReplica); + HBaseTestingUtil.setReplicas(HTU.getAdmin(), TableName.META_TABLE_NAME, numOfMetaReplica); HTU.waitFor(30000, () -> HTU.getMiniHBaseCluster().getRegions(TableName.META_TABLE_NAME).size() @@ -125,7 +125,7 @@ public class TestMetaRegionReplicaReplicationEndpoint { */ @Test public void testHBaseMetaReplicationSourceCreatedOnOpen() throws Exception { - MiniHBaseCluster cluster = HTU.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = HTU.getMiniHBaseCluster(); HRegionServer hrs = cluster.getRegionServer(cluster.getServerHoldingMeta()); // Replicate a row to prove all working. testHBaseMetaReplicatesOneRow(0); @@ -192,12 +192,12 @@ public class TestMetaRegionReplicaReplicationEndpoint { public void testHBaseMetaReplicates() throws Exception { try (Table table = HTU .createTable(TableName.valueOf(this.name.getMethodName() + "_0"), HConstants.CATALOG_FAMILY, - Arrays.copyOfRange(HBaseTestingUtility.KEYS, 1, HBaseTestingUtility.KEYS.length))) { + Arrays.copyOfRange(HBaseTestingUtil.KEYS, 1, HBaseTestingUtil.KEYS.length))) { verifyReplication(TableName.META_TABLE_NAME, numOfMetaReplica, getMetaCells(table.getName())); } try (Table table = HTU .createTable(TableName.valueOf(this.name.getMethodName() + "_1"), HConstants.CATALOG_FAMILY, - Arrays.copyOfRange(HBaseTestingUtility.KEYS, 1, HBaseTestingUtility.KEYS.length))) { + Arrays.copyOfRange(HBaseTestingUtil.KEYS, 1, HBaseTestingUtil.KEYS.length))) { verifyReplication(TableName.META_TABLE_NAME, numOfMetaReplica, getMetaCells(table.getName())); // Try delete. HTU.deleteTableIfAny(table.getName()); @@ -232,7 +232,7 @@ public class TestMetaRegionReplicaReplicationEndpoint { @Test public void testCatalogReplicaReplicationWithReplicaMoved() throws Exception { - MiniHBaseCluster cluster = HTU.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = HTU.getMiniHBaseCluster(); HRegionServer hrs = cluster.getRegionServer(cluster.getServerHoldingMeta()); HRegionServer hrsMetaReplica = null; @@ -534,7 +534,7 @@ public class TestMetaRegionReplicaReplicationEndpoint { HRegionServer destRs = null; try (Table table = HTU.createTable(tn, HConstants.CATALOG_FAMILY, - Arrays.copyOfRange(HBaseTestingUtility.KEYS, 1, HBaseTestingUtility.KEYS.length))) { + Arrays.copyOfRange(HBaseTestingUtil.KEYS, 1, HBaseTestingUtil.KEYS.length))) { verifyReplication(TableName.META_TABLE_NAME, numOfMetaReplica, getMetaCells(table.getName())); // load different values HTU.loadTable(table, new byte[][] { HConstants.CATALOG_FAMILY }, VALUE); @@ -559,10 +559,10 @@ public class TestMetaRegionReplicaReplicationEndpoint { c.set(LOCATOR_META_REPLICAS_MODE, "LoadBalance"); Connection connection = ConnectionFactory.createConnection(c); Table tableForGet = connection.getTable(tn); - byte[][] getRows = new byte[HBaseTestingUtility.KEYS.length][]; + byte[][] getRows = new byte[HBaseTestingUtil.KEYS.length][]; int i = 0; - for (byte[] key : HBaseTestingUtility.KEYS) { + for (byte[] key : HBaseTestingUtil.KEYS) { getRows[i] = key; i++; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRaceWhenCreatingReplicationSource.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRaceWhenCreatingReplicationSource.java index 522fb20543b..b484b9db530 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRaceWhenCreatingReplicationSource.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRaceWhenCreatingReplicationSource.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; @@ -62,7 +62,7 @@ public class TestRaceWhenCreatingReplicationSource { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRaceWhenCreatingReplicationSource.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String PEER_ID = "1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java index 62989d3bf74..d238e09a7e1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ReplicationPeerNotFoundException; @@ -94,7 +94,7 @@ public class TestRegionReplicaReplicationEndpoint { private static final int NB_SERVERS = 2; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); @@ -236,7 +236,7 @@ public class TestRegionReplicaReplicationEndpoint { TableName tableNameNoReplicas = TableName.valueOf("testRegionReplicaReplicationWithReplicas_NO_REPLICAS"); HTU.deleteTableIfAny(tableNameNoReplicas); - HTU.createTable(tableNameNoReplicas, HBaseTestingUtility.fam1); + HTU.createTable(tableNameNoReplicas, HBaseTestingUtil.fam1); Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration()); Table table = connection.getTable(tableName); @@ -244,10 +244,10 @@ public class TestRegionReplicaReplicationEndpoint { try { // load some data to the non-replicated table - HTU.loadNumericRows(tableNoReplicas, HBaseTestingUtility.fam1, 6000, 7000); + HTU.loadNumericRows(tableNoReplicas, HBaseTestingUtil.fam1, 6000, 7000); // load the data to the table - HTU.loadNumericRows(table, HBaseTestingUtility.fam1, 0, 1000); + HTU.loadNumericRows(table, HBaseTestingUtil.fam1, 0, 1000); verifyReplication(tableName, regionReplication, 0, 1000); @@ -289,7 +289,7 @@ public class TestRegionReplicaReplicationEndpoint { public boolean evaluate() throws Exception { LOG.info("verifying replication for region replica:" + region.getRegionInfo()); try { - HTU.verifyNumericRows(region, HBaseTestingUtility.fam1, startRow, endRow, present); + HTU.verifyNumericRows(region, HBaseTestingUtil.fam1, startRow, endRow, present); } catch(Throwable ex) { LOG.warn("Verification from secondary region is not complete yet", ex); // still wait @@ -332,7 +332,7 @@ public class TestRegionReplicaReplicationEndpoint { final int startRow = i * STEP; final int endRow = (i + 1) * STEP; LOG.info("Writing data from " + startRow + " to " + endRow); - HTU.loadNumericRows(table, HBaseTestingUtility.fam1, startRow, endRow); + HTU.loadNumericRows(table, HBaseTestingUtil.fam1, startRow, endRow); verifyReplication(tableName, regionReplication, startRow, endRow, false); // Flush the table, now the data should show up in the replicas @@ -365,7 +365,7 @@ public class TestRegionReplicaReplicationEndpoint { for (int i = 0; i < 6000; i += 1000) { LOG.info("Writing data from " + i + " to " + (i+1000)); - HTU.loadNumericRows(table, HBaseTestingUtility.fam1, i, i+1000); + HTU.loadNumericRows(table, HBaseTestingUtil.fam1, i, i+1000); LOG.info("flushing table"); HTU.flush(tableName); LOG.info("compacting table"); @@ -427,7 +427,7 @@ public class TestRegionReplicaReplicationEndpoint { Table table = connection.getTable(tableName); Table tableToBeDisabled = connection.getTable(toBeDisabledTable); - HTU.loadNumericRows(tableToBeDisabled, HBaseTestingUtility.fam1, 6000, 7000); + HTU.loadNumericRows(tableToBeDisabled, HBaseTestingUtil.fam1, 6000, 7000); RegionLocator rl = connection.getRegionLocator(toBeDisabledTable); HRegionLocation hrl = rl.getRegionLocation(HConstants.EMPTY_BYTE_ARRAY); @@ -476,7 +476,7 @@ public class TestRegionReplicaReplicationEndpoint { try { // load some data to the to-be-dropped table // load the data to the table - HTU.loadNumericRows(table, HBaseTestingUtility.fam1, 0, 1000); + HTU.loadNumericRows(table, HBaseTestingUtil.fam1, 0, 1000); // now enable the replication HTU.getAdmin().enableReplicationPeer(ServerRegionReplicaUtil.REGION_REPLICA_REPLICATION_PEER); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java index ee1ae5f380d..74de90bb01c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java @@ -32,10 +32,10 @@ import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.RegionLocations; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.AsyncClusterConnection; import org.apache.hadoop.hbase.client.ClusterConnectionFactory; @@ -98,7 +98,7 @@ public class TestRegionReplicaReplicationEndpointNoMaster { private static RegionInfo hriPrimary; private static RegionInfo hriSecondary; - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); private static final byte[] f = HConstants.CATALOG_FAMILY; @BeforeClass @@ -116,8 +116,8 @@ public class TestRegionReplicaReplicationEndpointNoMaster { } HTU.getConfiguration().set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, walCoprocs); - StartMiniClusterOption option = StartMiniClusterOption.builder().numAlwaysStandByMasters(1). - numRegionServers(NB_SERVERS).numDataNodes(NB_SERVERS).build(); + StartTestingClusterOption option = StartTestingClusterOption.builder() + .numAlwaysStandByMasters(1).numRegionServers(NB_SERVERS).numDataNodes(NB_SERVERS).build(); HTU.startMiniCluster(option); // Create table then get the single region for our new table. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java index eb0cda20567..c964417147a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java @@ -37,7 +37,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Stoppable; @@ -88,7 +88,7 @@ public class TestReplicationSink { private static final Logger LOG = LoggerFactory.getLogger(TestReplicationSink.class); private static final int BATCH_SIZE = 10; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static ReplicationSink SINK; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java index f5d4f778294..0e3cc56c480 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java @@ -42,12 +42,12 @@ import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -86,10 +86,10 @@ public class TestReplicationSource { private static final Logger LOG = LoggerFactory.getLogger(TestReplicationSource.class); - private final static HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); - private final static HBaseTestingUtility TEST_UTIL_PEER = - new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); + private final static HBaseTestingUtil TEST_UTIL_PEER = + new HBaseTestingUtil(); private static FileSystem FS; private static Path oldLogDir; private static Path logDir; @@ -330,7 +330,7 @@ public class TestReplicationSource { conf.setInt("replication.sleep.before.failover", 2000); // Introduces a delay in regionserver shutdown to give the race condition a chance to kick in. conf.set(HConstants.REGION_SERVER_IMPL, ShutdownDelayRegionServer.class.getName()); - MiniHBaseCluster cluster = TEST_UTIL.startMiniCluster(2); + SingleProcessHBaseCluster cluster = TEST_UTIL.startMiniCluster(2); TEST_UTIL_PEER.startMiniCluster(1); HRegionServer serverA = cluster.getRegionServer(0); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java index d6dbaf46a56..a52615465ed 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java @@ -50,7 +50,7 @@ import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.ClusterId; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.Server; @@ -125,7 +125,7 @@ public abstract class TestReplicationSourceManager { protected static Configuration conf; - protected static HBaseTestingUtility utility; + protected static HBaseTestingUtil utility; protected static Replication replication; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerZkImpl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerZkImpl.java index 8e0ab0f1a0e..34ecf2217ee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerZkImpl.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerZkImpl.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.replication.ReplicationQueueInfo; @@ -55,7 +55,7 @@ public class TestReplicationSourceManagerZkImpl extends TestReplicationSourceMan ReplicationSourceDummy.class.getCanonicalName()); conf.setLong("replication.sleep.before.failover", 2000); conf.setInt("replication.source.maxretriesmultiplier", 10); - utility = new HBaseTestingUtility(conf); + utility = new HBaseTestingUtil(conf); utility.startMiniZKCluster(); setupZkAndReplication(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicator.java index ce47f0b7148..b32f43471fc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicator.java @@ -25,7 +25,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -165,7 +165,7 @@ public class TestReplicator extends TestReplicationBase { TestReplicationBase.tearDownAfterClass(); } - private void truncateTable(HBaseTestingUtility util, TableName tablename) throws IOException { + private void truncateTable(HBaseTestingUtil util, TableName tablename) throws IOException { Admin admin = util.getAdmin(); admin.disableTable(tableName); admin.truncateTable(tablename, false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationChecker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationChecker.java index eb445f4c1b2..37e315035d1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationChecker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationChecker.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.Cell.Type; import org.apache.hadoop.hbase.CellBuilderFactory; import org.apache.hadoop.hbase.CellBuilderType; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableName; @@ -74,7 +74,7 @@ public class TestSerialReplicationChecker { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSerialReplicationChecker.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String PEER_ID = "1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationEndpoint.java index 50fbe0e9953..865e1914a13 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationEndpoint.java @@ -28,7 +28,7 @@ import java.util.concurrent.LinkedBlockingQueue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; @@ -64,7 +64,7 @@ public class TestSerialReplicationEndpoint { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSerialReplicationEndpoint.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static Configuration CONF; private static Connection CONN; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStreamTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStreamTestBase.java index d232a6bd734..dab425395b1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStreamTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStreamTestBase.java @@ -25,7 +25,7 @@ import java.util.TreeMap; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -57,7 +57,7 @@ import org.apache.hbase.thirdparty.com.google.common.io.Closeables; public abstract class WALEntryStreamTestBase { protected static final long TEST_TIMEOUT_MS = 5000; - protected static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();; + protected static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();; protected static Configuration CONF; protected static FileSystem fs; protected static MiniDFSCluster cluster; @@ -125,7 +125,7 @@ public abstract class WALEntryStreamTestBase { protected final MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(); protected static void startCluster() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); CONF = TEST_UTIL.getConfiguration(); CONF.setLong("replication.source.sleepforretries", 10); TEST_UTIL.startMiniDFSCluster(3); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/EnableRSGroupsTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/EnableRSGroupsTestBase.java index 5c58a5df3ac..9611bafc2c9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/EnableRSGroupsTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/EnableRSGroupsTestBase.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.junit.AfterClass; @@ -35,7 +35,7 @@ public abstract class EnableRSGroupsTestBase { private static final Logger LOG = LoggerFactory.getLogger(TestEnableRSGroupsCompatibility.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMajorCompactionTTL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMajorCompactionTTL.java index 0594a6546ba..c267bdb55cf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMajorCompactionTTL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMajorCompactionTTL.java @@ -23,8 +23,8 @@ import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.master.HMaster; @@ -51,13 +51,13 @@ public class TestRSGroupMajorCompactionTTL extends TestMajorCompactorTTL { @Before @Override public void setUp() throws Exception { - utility = new HBaseTestingUtility(); + utility = new HBaseTestingUtil(); Configuration conf = utility.getConfiguration(); RSGroupUtil.enableRSGroup(conf); conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, NUM_SLAVES_BASE); conf.setInt("hbase.hfile.compaction.discharger.interval", 10); utility.startMiniCluster(NUM_SLAVES_BASE); - MiniHBaseCluster cluster = utility.getHBaseCluster(); + SingleProcessHBaseCluster cluster = utility.getHBaseCluster(); final HMaster master = cluster.getMaster(); //wait for balancer to come online diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMappingScript.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMappingScript.java index 3ce2a713f60..974b567fc2f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMappingScript.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupMappingScript.java @@ -25,7 +25,7 @@ import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.rsgroup.RSGroupInfoManagerImpl.RSGroupMappingScript; import org.apache.hadoop.hbase.testclassification.RSGroupTests; @@ -48,7 +48,7 @@ public class TestRSGroupMappingScript { HBaseClassTestRule.forClass(TestRSGroupMappingScript.class); private static final Logger LOG = LoggerFactory.getLogger(TestRSGroupMappingScript.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private File script; @BeforeClass diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java index fc5ae16a796..418aaf90513 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java @@ -34,11 +34,11 @@ import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.ClusterMetrics.Option; -import org.apache.hadoop.hbase.HBaseCluster; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseClusterInterface; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.AbstractTestUpdateConfiguration; @@ -72,9 +72,9 @@ public abstract class TestRSGroupsBase extends AbstractTestUpdateConfiguration { protected static final String TABLE_PREFIX = "Group"; // shared, cluster type specific - protected static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static Admin ADMIN; - protected static HBaseCluster CLUSTER; + protected static HBaseClusterInterface CLUSTER; protected static HMaster MASTER; protected boolean INIT = false; protected static CPMasterObserver OBSERVER; @@ -160,10 +160,10 @@ public abstract class TestRSGroupsBase extends AbstractTestUpdateConfiguration { int missing = NUM_SLAVES_BASE - getNumServers(); LOG.info("Restoring servers: " + missing); for (int i = 0; i < missing; i++) { - ((MiniHBaseCluster) CLUSTER).startRegionServer(); + ((SingleProcessHBaseCluster) CLUSTER).startRegionServer(); } ADMIN.addRSGroup("master"); - ServerName masterServerName = ((MiniHBaseCluster) CLUSTER).getMaster().getServerName(); + ServerName masterServerName = ((SingleProcessHBaseCluster) CLUSTER).getMaster().getServerName(); try { ADMIN.moveServersToRSGroup(Sets.newHashSet(masterServerName.getAddress()), "master"); } catch (Exception ex) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsCPHookCalled.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsCPHookCalled.java index 4322784fede..403045f22a6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsCPHookCalled.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsCPHookCalled.java @@ -20,8 +20,8 @@ package org.apache.hadoop.hbase.rsgroup; import static org.junit.Assert.assertTrue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.RSGroupTests; @@ -83,7 +83,7 @@ public class TestRSGroupsCPHookCalled extends TestRSGroupsBase { @Test public void testGetRSGroupInfoOfServerCPHookCalled() throws Exception { - ServerName masterServerName = ((MiniHBaseCluster) CLUSTER).getMaster().getServerName(); + ServerName masterServerName = ((SingleProcessHBaseCluster) CLUSTER).getMaster().getServerName(); ADMIN.getRSGroup(masterServerName.getAddress()); assertTrue(OBSERVER.preGetRSGroupInfoOfServerCalled); assertTrue(OBSERVER.postGetRSGroupInfoOfServerCalled); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsFallback.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsFallback.java index 478ffc65475..4478d37a5c9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsFallback.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsFallback.java @@ -24,7 +24,7 @@ import java.util.Collections; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -94,7 +94,7 @@ public class TestRSGroupsFallback extends TestRSGroupsBase { .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes("f")).build()) .setRegionServerGroup(groupName) .build(); - ADMIN.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + ADMIN.createTable(desc, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE); TEST_UTIL.waitUntilAllRegionsAssigned(tableName); // server of test group crash, regions move to default group crashRsInGroup(groupName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java index ae8177d7499..6ed2adecd14 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsOfflineMode.java @@ -21,10 +21,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCluster; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.HBaseClusterInterface; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.client.Admin; @@ -67,8 +67,8 @@ public class TestRSGroupsOfflineMode extends TestRSGroupsBase { private static final Logger LOG = LoggerFactory.getLogger(TestRSGroupsOfflineMode.class); private static HMaster master; private static Admin hbaseAdmin; - private static HBaseTestingUtility TEST_UTIL; - private static HBaseCluster cluster; + private static HBaseTestingUtil TEST_UTIL; + private static HBaseClusterInterface cluster; private final static long WAIT_TIMEOUT = 60000 * 5; @Rule @@ -76,14 +76,14 @@ public class TestRSGroupsOfflineMode extends TestRSGroupsBase { @BeforeClass public static void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); RSGroupUtil.enableRSGroup(TEST_UTIL.getConfiguration()); TEST_UTIL.getConfiguration().set(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, "1"); - StartMiniClusterOption option = - StartMiniClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); + StartTestingClusterOption option = + StartTestingClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build(); TEST_UTIL.startMiniCluster(option); cluster = TEST_UTIL.getHBaseCluster(); - master = ((MiniHBaseCluster) cluster).getMaster(); + master = ((SingleProcessHBaseCluster) cluster).getMaster(); master.balanceSwitch(false); hbaseAdmin = TEST_UTIL.getAdmin(); // wait till the balancer is in online mode @@ -107,9 +107,9 @@ public class TestRSGroupsOfflineMode extends TestRSGroupsBase { // Table should be after group table name so it gets assigned later. final TableName failoverTable = TableName.valueOf(getNameWithoutIndex(name.getMethodName())); TEST_UTIL.createTable(failoverTable, Bytes.toBytes("f")); - final HRegionServer killRS = ((MiniHBaseCluster) cluster).getRegionServer(0); - final HRegionServer groupRS = ((MiniHBaseCluster) cluster).getRegionServer(1); - final HRegionServer failoverRS = ((MiniHBaseCluster) cluster).getRegionServer(2); + final HRegionServer killRS = ((SingleProcessHBaseCluster) cluster).getRegionServer(0); + final HRegionServer groupRS = ((SingleProcessHBaseCluster) cluster).getRegionServer(1); + final HRegionServer failoverRS = ((SingleProcessHBaseCluster) cluster).getRegionServer(2); String newGroup = "my_group"; Admin admin = TEST_UTIL.getAdmin(); admin.addRSGroup(newGroup); @@ -162,7 +162,8 @@ public class TestRSGroupsOfflineMode extends TestRSGroupsBase { }); // Get groupInfoManager from the new active master. - RSGroupInfoManager groupMgr = ((MiniHBaseCluster) cluster).getMaster().getRSGroupInfoManager(); + RSGroupInfoManager groupMgr = + ((SingleProcessHBaseCluster) cluster).getMaster().getRSGroupInfoManager(); // Make sure balancer is in offline mode, since this is what we're testing. assertFalse(groupMgr.isOnline()); // Kill final regionserver to see the failover happens for all tables except GROUP table since diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java index 80bf0320994..fb6292c8a89 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.Optional; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -64,7 +64,7 @@ public class TestRSGroupsWithACL extends SecureTestUtil { private static final Logger LOG = LoggerFactory.getLogger(TestRSGroupsWithACL.class); private static TableName TEST_TABLE = TableName.valueOf("testtable1"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; private static Connection systemUserConnection; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureIPC.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureIPC.java index 09f21d7e650..ddeea8c7959 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureIPC.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureIPC.java @@ -45,7 +45,7 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ipc.BlockingRpcClient; import org.apache.hadoop.hbase.ipc.FifoRpcScheduler; @@ -98,7 +98,7 @@ public class TestSecureIPC { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSecureIPC.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final File KEYTAB_FILE = new File( TEST_UTIL.getDataTestDir("keytab").toUri().getPath()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java index d240f91786b..29b8c21a905 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java @@ -33,7 +33,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.SecurityTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.minikdc.MiniKdc; @@ -51,7 +51,7 @@ public class TestUsersOperationsWithSecureHadoop { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestUsersOperationsWithSecureHadoop.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final File KEYTAB_FILE = new File(TEST_UTIL.getDataTestDir("keytab").toUri() .getPath()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java index 6e0ef5411b1..02f23ed1cca 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/SecureTestUtil.java @@ -32,9 +32,9 @@ import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.Waiter.Predicate; @@ -280,7 +280,7 @@ public class SecureTestUtil { } } - private static List getAccessControllers(MiniHBaseCluster cluster) { + private static List getAccessControllers(SingleProcessHBaseCluster cluster) { List result = Lists.newArrayList(); for (RegionServerThread t: cluster.getLiveRegionServerThreads()) { for (HRegion region: t.getRegionServer().getOnlineRegionsLocalContext()) { @@ -293,16 +293,17 @@ public class SecureTestUtil { return result; } - private static Map getAuthManagerMTimes(MiniHBaseCluster cluster) { - Map result = Maps.newHashMap(); - for (AccessController ac: getAccessControllers(cluster)) { + private static Map + getAuthManagerMTimes(SingleProcessHBaseCluster cluster) { + Map result = Maps.newHashMap(); + for (AccessController ac : getAccessControllers(cluster)) { result.put(ac, ac.getAuthManager().getMTime()); } return result; } @SuppressWarnings("rawtypes") - private static void updateACLs(final HBaseTestingUtility util, Callable c) throws Exception { + private static void updateACLs(final HBaseTestingUtil util, Callable c) throws Exception { // Get the current mtimes for all access controllers final Map oldMTimes = getAuthManagerMTimes(util.getHBaseCluster()); @@ -340,7 +341,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantGlobal(final HBaseTestingUtility util, final String user, + public static void grantGlobal(final HBaseTestingUtil util, final String user, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -359,7 +360,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantGlobal(final User caller, final HBaseTestingUtility util, + public static void grantGlobal(final User caller, final HBaseTestingUtil util, final String user, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -379,7 +380,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeGlobal(final HBaseTestingUtility util, final String user, + public static void revokeGlobal(final HBaseTestingUtil util, final String user, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -398,7 +399,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeGlobal(final User caller, final HBaseTestingUtility util, + public static void revokeGlobal(final User caller, final HBaseTestingUtil util, final String user, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -418,7 +419,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantOnNamespace(final HBaseTestingUtility util, final String user, + public static void grantOnNamespace(final HBaseTestingUtil util, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -438,7 +439,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantOnNamespace(final User caller, final HBaseTestingUtility util, + public static void grantOnNamespace(final User caller, final HBaseTestingUtil util, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -460,7 +461,7 @@ public class SecureTestUtil { * Will wait until all active AccessController instances have updated their permissions caches * or will throw an exception upon timeout (10 seconds). */ - public static void grantOnNamespaceUsingAccessControlClient(final HBaseTestingUtility util, + public static void grantOnNamespaceUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -481,7 +482,7 @@ public class SecureTestUtil { * Will wait until all active AccessController instances have updated their permissions caches * or will throw an exception upon timeout (10 seconds). */ - public static void revokeFromNamespaceUsingAccessControlClient(final HBaseTestingUtility util, + public static void revokeFromNamespaceUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -502,7 +503,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeFromNamespace(final HBaseTestingUtility util, final String user, + public static void revokeFromNamespace(final HBaseTestingUtil util, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @Override @@ -521,7 +522,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeFromNamespace(final User caller, final HBaseTestingUtility util, + public static void revokeFromNamespace(final User caller, final HBaseTestingUtil util, final String user, final String namespace, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -542,7 +543,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantOnTable(final HBaseTestingUtility util, final String user, + public static void grantOnTable(final HBaseTestingUtil util, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -563,7 +564,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantOnTable(final User caller, final HBaseTestingUtility util, + public static void grantOnTable(final User caller, final HBaseTestingUtil util, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -585,7 +586,7 @@ public class SecureTestUtil { * active AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantOnTableUsingAccessControlClient(final HBaseTestingUtility util, + public static void grantOnTableUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -606,7 +607,7 @@ public class SecureTestUtil { * active AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void grantGlobalUsingAccessControlClient(final HBaseTestingUtility util, + public static void grantGlobalUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -627,7 +628,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeFromTable(final HBaseTestingUtility util, final String user, + public static void revokeFromTable(final HBaseTestingUtil util, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -647,7 +648,7 @@ public class SecureTestUtil { * AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeFromTable(final User caller, final HBaseTestingUtility util, + public static void revokeFromTable(final User caller, final HBaseTestingUtil util, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -668,7 +669,7 @@ public class SecureTestUtil { * all active AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeFromTableUsingAccessControlClient(final HBaseTestingUtility util, + public static void revokeFromTableUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user, final TableName table, final byte[] family, final byte[] qualifier, final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -689,7 +690,7 @@ public class SecureTestUtil { * all active AccessController instances have updated their permissions caches or will * throw an exception upon timeout (10 seconds). */ - public static void revokeGlobalUsingAccessControlClient(final HBaseTestingUtility util, + public static void revokeGlobalUsingAccessControlClient(final HBaseTestingUtil util, final Connection connection, final String user,final Permission.Action... actions) throws Exception { SecureTestUtil.updateACLs(util, new Callable() { @@ -737,7 +738,7 @@ public class SecureTestUtil { } } - public static Table createTable(HBaseTestingUtility testUtil, TableName tableName, + public static Table createTable(HBaseTestingUtil testUtil, TableName tableName, byte[][] families) throws Exception { TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); for (byte[] family : families) { @@ -747,22 +748,22 @@ public class SecureTestUtil { return testUtil.getConnection().getTable(tableName); } - public static void createTable(HBaseTestingUtility testUtil, TableDescriptor htd) + public static void createTable(HBaseTestingUtil testUtil, TableDescriptor htd) throws Exception { createTable(testUtil, testUtil.getAdmin(), htd); } - public static void createTable(HBaseTestingUtility testUtil, TableDescriptor htd, + public static void createTable(HBaseTestingUtil testUtil, TableDescriptor htd, byte[][] splitKeys) throws Exception { createTable(testUtil, testUtil.getAdmin(), htd, splitKeys); } - public static void createTable(HBaseTestingUtility testUtil, Admin admin, TableDescriptor htd) + public static void createTable(HBaseTestingUtil testUtil, Admin admin, TableDescriptor htd) throws Exception { createTable(testUtil, admin, htd, null); } - public static void createTable(HBaseTestingUtility testUtil, Admin admin, TableDescriptor htd, + public static void createTable(HBaseTestingUtil testUtil, Admin admin, TableDescriptor htd, byte[][] splitKeys) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. @@ -779,34 +780,34 @@ public class SecureTestUtil { testUtil.waitUntilAllRegionsAssigned(htd.getTableName()); } - public static void createTable(HBaseTestingUtility testUtil, User user, TableDescriptor htd) + public static void createTable(HBaseTestingUtil testUtil, User user, TableDescriptor htd) throws Exception { createTable(testUtil, user, htd, null); } - public static void createTable(HBaseTestingUtility testUtil, User user, TableDescriptor htd, + public static void createTable(HBaseTestingUtil testUtil, User user, TableDescriptor htd, byte[][] splitKeys) throws Exception { try (Connection con = testUtil.getConnection(user); Admin admin = con.getAdmin()) { createTable(testUtil, admin, htd, splitKeys); } } - public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName) + public static void deleteTable(HBaseTestingUtil testUtil, TableName tableName) throws Exception { deleteTable(testUtil, testUtil.getAdmin(), tableName); } - public static void createNamespace(HBaseTestingUtility testUtil, NamespaceDescriptor nsDesc) + public static void createNamespace(HBaseTestingUtil testUtil, NamespaceDescriptor nsDesc) throws Exception { testUtil.getAdmin().createNamespace(nsDesc); } - public static void deleteNamespace(HBaseTestingUtility testUtil, String namespace) + public static void deleteNamespace(HBaseTestingUtil testUtil, String namespace) throws Exception { testUtil.getAdmin().deleteNamespace(namespace); } - public static void deleteTable(HBaseTestingUtility testUtil, Admin admin, TableName tableName) + public static void deleteTable(HBaseTestingUtil testUtil, Admin admin, TableName tableName) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. @@ -827,7 +828,7 @@ public class SecureTestUtil { return PermissionStorage.NAMESPACE_PREFIX + namespace; } - public static void checkGlobalPerms(HBaseTestingUtility testUtil, Permission.Action... actions) + public static void checkGlobalPerms(HBaseTestingUtil testUtil, Permission.Action... actions) throws IOException { Permission[] perms = new Permission[actions.length]; for (int i = 0; i < actions.length; i++) { @@ -836,7 +837,7 @@ public class SecureTestUtil { checkPermissions(testUtil.getConfiguration(), perms); } - public static void checkTablePerms(HBaseTestingUtility testUtil, TableName table, byte[] family, + public static void checkTablePerms(HBaseTestingUtil testUtil, TableName table, byte[] family, byte[] column, Permission.Action... actions) throws IOException { Permission[] perms = new Permission[actions.length]; for (int i = 0; i < actions.length; i++) { @@ -846,7 +847,7 @@ public class SecureTestUtil { checkTablePerms(testUtil, perms); } - public static void checkTablePerms(HBaseTestingUtility testUtil, Permission... perms) + public static void checkTablePerms(HBaseTestingUtil testUtil, Permission... perms) throws IOException { checkPermissions(testUtil.getConfiguration(), perms); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java index 12135033755..5ab0c3a922e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -57,7 +57,7 @@ public class TestAccessControlFilter extends SecureTestUtil { HBaseClassTestRule.forClass(TestAccessControlFilter.class); @Rule public TestName name = new TestName(); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static User READER; private static User LIMITED; @@ -75,7 +75,7 @@ public class TestAccessControlFilter extends SecureTestUtil { @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); Configuration conf = TEST_UTIL.getConfiguration(); // Up the handlers; this test needs more than usual. conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java index 4b0d73ac13a..5f2c6ac2af8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java @@ -45,13 +45,13 @@ import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseIOException; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.Admin; @@ -169,7 +169,7 @@ public class TestAccessController extends SecureTestUtil { private static final FsPermission FS_PERMISSION_ALL = FsPermission.valueOf("-rwxrwxrwx"); private static final Logger LOG = LoggerFactory.getLogger(TestAccessController.class); private static TableName TEST_TABLE = TableName.valueOf("testtable1"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; /** The systemUserConnection created here is tied to the system user. In case, you are planning @@ -2168,7 +2168,7 @@ public class TestAccessController extends SecureTestUtil { @Test public void testGlobalAuthorizationForNewRegisteredRS() throws Exception { LOG.debug("Test for global authorization for a new registered RegionServer."); - MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster(); final Admin admin = TEST_UTIL.getAdmin(); TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(TEST_TABLE2) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java index ac52bef9f60..9b474a774d0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java @@ -28,7 +28,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -81,7 +81,7 @@ public class TestAccessController2 extends SecureTestUtil { private static final byte[] TEST_QUALIFIER = Bytes.toBytes("q"); private static final byte[] TEST_VALUE = Bytes.toBytes("value"); - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; /** The systemUserConnection created here is tied to the system user. In case, you are planning diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController3.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController3.java index 8860d5f0658..9f2202f4d20 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController3.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController3.java @@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -72,7 +72,7 @@ public class TestAccessController3 extends SecureTestUtil { private static final Logger LOG = LoggerFactory.getLogger(TestAccessController.class); private static TableName TEST_TABLE = TableName.valueOf("testtable1"); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; /** The systemUserConnection created here is tied to the system user. In case, you are planning diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java index 0bd1e7485ab..0af18a5b15e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLWithMultipleVersions.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -72,7 +72,7 @@ public class TestCellACLWithMultipleVersions extends SecureTestUtil { @Rule public TableNameTestRule testTable = new TableNameTestRule(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] TEST_FAMILY1 = Bytes.toBytes("f1"); private static final byte[] TEST_FAMILY2 = Bytes.toBytes("f2"); private static final byte[] TEST_ROW = Bytes.toBytes("cellpermtest"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java index 6d238284cdd..5d9c31e5cb6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCellACLs.java @@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.TableNotFoundException; @@ -76,7 +76,7 @@ public class TestCellACLs extends SecureTestUtil { @Rule public TableNameTestRule testTable = new TableNameTestRule(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] TEST_FAMILY = Bytes.toBytes("f1"); private static final byte[] TEST_ROW = Bytes.toBytes("cellpermtest"); private static final byte[] TEST_Q1 = Bytes.toBytes("q1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java index fef51418571..cb3c7d3ff65 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java @@ -27,7 +27,7 @@ import java.util.regex.Pattern; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.TableNotFoundException; @@ -64,7 +64,7 @@ public class TestCoprocessorWhitelistMasterObserver extends SecureTestUtil { private static final Logger LOG = LoggerFactory.getLogger(TestCoprocessorWhitelistMasterObserver.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TEST_TABLE = TableName.valueOf("testTable"); private static final byte[] TEST_FAMILY = Bytes.toBytes("fam1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestHDFSAclHelper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestHDFSAclHelper.java index e4e37e08ba7..340c1bde2f4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestHDFSAclHelper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestHDFSAclHelper.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.security.access; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.*; @@ -44,12 +44,12 @@ final class TestHDFSAclHelper { private TestHDFSAclHelper() { } - static void grantOnTable(HBaseTestingUtility util, String user, TableName tableName, + static void grantOnTable(HBaseTestingUtil util, String user, TableName tableName, Permission.Action... actions) throws Exception { SecureTestUtil.grantOnTable(util, user, tableName, null, null, actions); } - static void createNamespace(HBaseTestingUtility util, String namespace) throws IOException { + static void createNamespace(HBaseTestingUtil util, String namespace) throws IOException { if (Arrays.stream(util.getAdmin().listNamespaceDescriptors()) .noneMatch(ns -> ns.getName().equals(namespace))) { NamespaceDescriptor namespaceDescriptor = NamespaceDescriptor.create(namespace).build(); @@ -57,7 +57,7 @@ final class TestHDFSAclHelper { } } - static Table createTable(HBaseTestingUtility util, TableName tableName) throws Exception { + static Table createTable(HBaseTestingUtil util, TableName tableName) throws Exception { createNamespace(util, tableName.getNamespaceAsString()); TableDescriptor td = getTableDescriptorBuilder(util, tableName) .setValue(SnapshotScannerHDFSAclHelper.ACL_SYNC_TO_HDFS_ENABLE, "true").build(); @@ -68,7 +68,7 @@ final class TestHDFSAclHelper { return util.getConnection().getTable(tableName); } - static Table createMobTable(HBaseTestingUtility util, TableName tableName) throws Exception { + static Table createMobTable(HBaseTestingUtil util, TableName tableName) throws Exception { createNamespace(util, tableName.getNamespaceAsString()); TableDescriptor td = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(COLUMN1).setMobEnabled(true) @@ -83,7 +83,7 @@ final class TestHDFSAclHelper { return util.getConnection().getTable(tableName); } - static TableDescriptor createUserScanSnapshotDisabledTable(HBaseTestingUtility util, + static TableDescriptor createUserScanSnapshotDisabledTable(HBaseTestingUtil util, TableName tableName) throws Exception { createNamespace(util, tableName.getNamespaceAsString()); TableDescriptor td = getTableDescriptorBuilder(util, tableName).build(); @@ -97,14 +97,14 @@ final class TestHDFSAclHelper { return td; } - static TableDescriptorBuilder getTableDescriptorBuilder(HBaseTestingUtility util, + static TableDescriptorBuilder getTableDescriptorBuilder(HBaseTestingUtil util, TableName tableName) { return TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(COLUMN1).build()) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(COLUMN2).build()); } - static void createTableAndPut(HBaseTestingUtility util, TableName tableNam) throws Exception { + static void createTableAndPut(HBaseTestingUtil util, TableName tableNam) throws Exception { try (Table t = createTable(util, tableNam)) { put(t); } @@ -147,7 +147,7 @@ final class TestHDFSAclHelper { * @throws IOException user scan snapshot error * @throws InterruptedException user scan snapshot error */ - static void canUserScanSnapshot(HBaseTestingUtility util, User user, String snapshot, + static void canUserScanSnapshot(HBaseTestingUtil util, User user, String snapshot, int expectedRowCount) throws IOException, InterruptedException { PrivilegedExceptionAction action = getScanSnapshotAction(util.getConfiguration(), snapshot, expectedRowCount); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java index a03340ed3a0..bb2f4d422b7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Objects; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -69,7 +69,7 @@ public class TestNamespaceCommands extends SecureTestUtil { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestNamespaceCommands.class); - private static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestNamespaceCommands.class); private static String TEST_NAMESPACE = "ns1"; private static String TEST_NAMESPACE2 = "ns2"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestRpcAccessChecks.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestRpcAccessChecks.java index 93f0ee34ed9..cb7ea3125fd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestRpcAccessChecks.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestRpcAccessChecks.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.AuthUtil; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -99,7 +99,7 @@ public class TestRpcAccessChecks { @Rule public final TestName TEST_NAME = new TestName(); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; // user granted with all global permission diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java index aade90ca615..c7c4aee37cc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.TableNotFoundException; @@ -66,7 +66,7 @@ public class TestScanEarlyTermination extends SecureTestUtil { @Rule public TableNameTestRule testTable = new TableNameTestRule(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] TEST_FAMILY1 = Bytes.toBytes("f1"); private static final byte[] TEST_FAMILY2 = Bytes.toBytes("f2"); private static final byte[] TEST_ROW = Bytes.toBytes("testrow"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController.java index 6de8b378d59..5bf726d7fbd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController.java @@ -35,7 +35,7 @@ import org.apache.hadoop.fs.permission.AclEntry; import org.apache.hadoop.fs.permission.AclEntryScope; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -72,7 +72,7 @@ public class TestSnapshotScannerHDFSAclController { LoggerFactory.getLogger(TestSnapshotScannerHDFSAclController.class); private static final String UN_GRANT_USER = "un_grant_user"; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static Admin admin = null; private static FileSystem FS = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController2.java index 7ef8e3e8dda..6edf2eab6ce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestSnapshotScannerHDFSAclController2.java @@ -27,7 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Table; @@ -61,7 +61,7 @@ public class TestSnapshotScannerHDFSAclController2 { LoggerFactory.getLogger(TestSnapshotScannerHDFSAclController2.class); private static final String UN_GRANT_USER = "un_grant_user"; - private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf = TEST_UTIL.getConfiguration(); private static Admin admin = null; private static SnapshotScannerHDFSAclHelper helper; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java index 79436d3aee1..5261d862d79 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java @@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; @@ -66,7 +66,7 @@ public class TestTablePermissions { HBaseClassTestRule.forClass(TestTablePermissions.class); private static final Logger LOG = LoggerFactory.getLogger(TestTablePermissions.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static ZKWatcher ZKW; private final static Abortable ABORTABLE = new Abortable() { private final AtomicBoolean abort = new AtomicBoolean(false); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestUnloadAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestUnloadAccessController.java index 2c9b3c10759..1d34e517bbd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestUnloadAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestUnloadAccessController.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.testclassification.SecurityTests; @@ -41,7 +41,7 @@ public class TestUnloadAccessController extends SecureTestUtil { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestUnloadAccessController.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static TableName TEST_TABLE = TableName.valueOf("TestUnloadAccessController"); private static Permission permission = Permission.newBuilder(TEST_TABLE).withActions(Permission.Action.READ).build(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java index a08456a8917..2b50ea4878a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestWithDisabledAuthorization.java @@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.ServerName; @@ -89,7 +89,7 @@ public class TestWithDisabledAuthorization extends SecureTestUtil { HBaseClassTestRule.forClass(TestWithDisabledAuthorization.class); private static final Logger LOG = LoggerFactory.getLogger(TestWithDisabledAuthorization.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] TEST_FAMILY = Bytes.toBytes("f1"); private static final byte[] TEST_FAMILY2 = Bytes.toBytes("f2"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java index f5a07b02c1e..2019bb1ea37 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; import org.apache.hadoop.hbase.security.User; @@ -55,7 +55,7 @@ public class TestZKPermissionWatcher { HBaseClassTestRule.forClass(TestZKPermissionWatcher.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKPermissionWatcher.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static AuthManager AUTH_A; private static AuthManager AUTH_B; private static ZKPermissionWatcher WATCHER_A; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/provider/CustomSaslAuthenticationProviderTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/provider/CustomSaslAuthenticationProviderTestBase.java index 2327031edc8..15f969ab9f9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/provider/CustomSaslAuthenticationProviderTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/provider/CustomSaslAuthenticationProviderTestBase.java @@ -51,7 +51,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.TableName; @@ -402,7 +402,7 @@ public abstract class CustomSaslAuthenticationProviderTestBase { } } - private static void createBaseCluster(HBaseTestingUtility util, File keytabFile, MiniKdc kdc) + private static void createBaseCluster(HBaseTestingUtil util, File keytabFile, MiniKdc kdc) throws Exception { String servicePrincipal = "hbase/localhost"; String spnegoPrincipal = "HTTP/localhost"; @@ -420,7 +420,7 @@ public abstract class CustomSaslAuthenticationProviderTestBase { CommonFSUtils.setRootDir(util.getConfiguration(), rootdir); } - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Configuration CONF = UTIL.getConfiguration(); private static LocalHBaseCluster CLUSTER; private static File KEYTAB_FILE; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/SecureTestCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/SecureTestCluster.java index 4a36b5d2a92..29dad832972 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/SecureTestCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/SecureTestCluster.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.security.token; import java.io.File; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.master.ServerManager; @@ -35,7 +35,7 @@ import org.junit.BeforeClass; * The class for set up a security cluster with kerberos, hdfs, hbase. */ public class SecureTestCluster { - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static String USERNAME; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java index bb37bcc98e9..f35c9bb8c47 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.ChoreService; import org.apache.hadoop.hbase.ClusterId; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; @@ -127,7 +127,7 @@ public class TestTokenAuthentication { AuthenticationProtos.AuthenticationService.BlockingInterface, Runnable, Server { private static final Logger LOG = LoggerFactory.getLogger(TokenServer.class); private Configuration conf; - private HBaseTestingUtility TEST_UTIL; + private HBaseTestingUtil TEST_UTIL; private RpcServerInterface rpcServer; private InetSocketAddress isa; private ZKWatcher zookeeper; @@ -137,7 +137,7 @@ public class TestTokenAuthentication { private boolean stopped = false; private long startcode; - public TokenServer(Configuration conf, HBaseTestingUtility TEST_UTIL) throws IOException { + public TokenServer(Configuration conf, HBaseTestingUtil TEST_UTIL) throws IOException { this.conf = conf; this.TEST_UTIL = TEST_UTIL; this.startcode = EnvironmentEdgeManager.currentTime(); @@ -372,7 +372,7 @@ public class TestTokenAuthentication { @Parameter(0) public String rpcServerImpl; - private HBaseTestingUtility TEST_UTIL; + private HBaseTestingUtil TEST_UTIL; private TokenServer server; private Thread serverThread; private AuthenticationTokenSecretManager secretManager; @@ -380,7 +380,7 @@ public class TestTokenAuthentication { @Before public void setUp() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); // Override the connection registry to avoid spinning up a mini cluster for the connection below // to go through. TEST_UTIL.getConfiguration().set(HConstants.CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcher.java index 50258615c9a..6fab5e15f36 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcher.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcher.java @@ -28,7 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.SecurityTests; @@ -54,7 +54,7 @@ public class TestZKSecretWatcher { HBaseClassTestRule.forClass(TestZKSecretWatcher.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKSecretWatcher.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static AuthenticationTokenSecretManager KEY_MASTER; private static AuthenticationTokenSecretManagerForTest KEY_SLAVE; private static AuthenticationTokenSecretManager KEY_SLAVE2; @@ -102,7 +102,7 @@ public class TestZKSecretWatcher { @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniZKCluster(); Configuration conf = TEST_UTIL.getConfiguration(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcherRefreshKeys.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcherRefreshKeys.java index 780233e80e7..d7081e7604e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcherRefreshKeys.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestZKSecretWatcherRefreshKeys.java @@ -21,7 +21,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.SecurityTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -49,7 +49,7 @@ public class TestZKSecretWatcherRefreshKeys { HBaseClassTestRule.forClass(TestZKSecretWatcherRefreshKeys.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKSecretWatcherRefreshKeys.class); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static class MockAbortable implements Abortable { private boolean abort; @@ -67,7 +67,7 @@ public class TestZKSecretWatcherRefreshKeys { @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); TEST_UTIL.startMiniZKCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java index 322c1c07564..501fd5471bf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestDefaultScanLabelGeneratorStack.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -58,7 +58,7 @@ public class TestDefaultScanLabelGeneratorStack { public static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW_1 = Bytes.toBytes("row1"); private final static byte[] CF = Bytes.toBytes("f"); private final static byte[] Q1 = Bytes.toBytes("q1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java index 0d2b466f3f1..cbbdd4fde45 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestEnforcingScanLabelGenerator.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.security.PrivilegedExceptionAction; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -55,7 +55,7 @@ public class TestEnforcingScanLabelGenerator { public static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW_1 = Bytes.toBytes("row1"); private final static byte[] CF = Bytes.toBytes("f"); private final static byte[] Q1 = Bytes.toBytes("q1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java index 31f219c36c1..06d79f868e7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelReplicationWithExpAsString.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Tag; import org.apache.hadoop.hbase.client.Admin; @@ -112,7 +112,7 @@ public class TestVisibilityLabelReplicationWithExpAsString extends TestVisibilit User.createUserForTesting(conf, User.getCurrent().getShortName(), new String[] { "supergroup" }); USER1 = User.createUserForTesting(conf, "user1", new String[] {}); - TEST_UTIL = new HBaseTestingUtility(conf); + TEST_UTIL = new HBaseTestingUtil(conf); TEST_UTIL.startMiniZKCluster(); MiniZooKeeperCluster miniZK = TEST_UTIL.getZkCluster(); zkw1 = new ZKWatcher(conf, "cluster1", null, true); @@ -127,7 +127,7 @@ public class TestVisibilityLabelReplicationWithExpAsString extends TestVisibilit conf1.setStrings(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY, TestCoprocessorForTagsAtSink.class.getName()); setVisibilityLabelServiceImpl(conf1, ExpAsStringVisibilityLabelServiceImpl.class); - TEST_UTIL1 = new HBaseTestingUtility(conf1); + TEST_UTIL1 = new HBaseTestingUtil(conf1); TEST_UTIL1.setZkCluster(miniZK); zkw2 = new ZKWatcher(conf1, "cluster2", null, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java index 2ec5ec85c8e..3fcf7d53fbb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java @@ -35,7 +35,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -91,7 +91,7 @@ public abstract class TestVisibilityLabels { + "\u0027&\\"; public static final String UC1 = "\u0027\"\u002b"; public static final String UC2 = "\u002d\u003f"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); public static final byte[] row1 = Bytes.toBytes("row1"); public static final byte[] row2 = Bytes.toBytes("row2"); public static final byte[] row3 = Bytes.toBytes("row3"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsOpWithDifferentUsersNoACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsOpWithDifferentUsersNoACL.java index 5209c56c7db..02393d7cbde 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsOpWithDifferentUsersNoACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsOpWithDifferentUsersNoACL.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.security.User; @@ -57,7 +57,7 @@ public class TestVisibilityLabelsOpWithDifferentUsersNoACL { private static final String PRIVATE = "private"; private static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java index b843f6e3bff..4b31f836c55 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsReplication.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; @@ -107,8 +107,8 @@ public class TestVisibilityLabelsReplication { public static final String SECRET = "secret"; public static final String UNICODE_VIS_TAG = COPYRIGHT + "\"" + ACCENT + "\\" + SECRET + "\"" + "\u0027&\\"; - public static HBaseTestingUtility TEST_UTIL; - public static HBaseTestingUtility TEST_UTIL1; + public static HBaseTestingUtil TEST_UTIL; + public static HBaseTestingUtil TEST_UTIL1; public static final byte[] row1 = Bytes.toBytes("row1"); public static final byte[] row2 = Bytes.toBytes("row2"); public static final byte[] row3 = Bytes.toBytes("row3"); @@ -164,7 +164,7 @@ public class TestVisibilityLabelsReplication { // User.createUserForTesting(conf, User.getCurrent().getShortName(), new // String[] { "supergroup" }); USER1 = User.createUserForTesting(conf, "user1", new String[] {}); - TEST_UTIL = new HBaseTestingUtility(conf); + TEST_UTIL = new HBaseTestingUtil(conf); TEST_UTIL.startMiniZKCluster(); MiniZooKeeperCluster miniZK = TEST_UTIL.getZkCluster(); zkw1 = new ZKWatcher(conf, "cluster1", null, true); @@ -180,7 +180,7 @@ public class TestVisibilityLabelsReplication { TestCoprocessorForTagsAtSink.class.getName()); // setVisibilityLabelServiceImpl(conf1); USER1 = User.createUserForTesting(conf1, "user1", new String[] {}); - TEST_UTIL1 = new HBaseTestingUtility(conf1); + TEST_UTIL1 = new HBaseTestingUtil(conf1); TEST_UTIL1.setZkCluster(miniZK); zkw2 = new ZKWatcher(conf1, "cluster2", null, true); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java index d1cd917907e..ebecd8eaa7c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithACL.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -70,7 +70,7 @@ public class TestVisibilityLabelsWithACL { private static final String PRIVATE = "private"; private static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] row1 = Bytes.toBytes("row1"); private final static byte[] fam = Bytes.toBytes("info"); private final static byte[] qual = Bytes.toBytes("qual"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java index ca1fe8bc2b3..a37e82c929a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithSLGStack.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.security.PrivilegedExceptionAction; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -58,7 +58,7 @@ public class TestVisibilityLabelsWithSLGStack { public static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW_1 = Bytes.toBytes("row1"); private final static byte[] CF = Bytes.toBytes("f"); private final static byte[] Q1 = Bytes.toBytes("q1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java index a18bdee6b66..634b36dbc8e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLablesWithGroups.java @@ -31,7 +31,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -67,7 +67,7 @@ public class TestVisibilityLablesWithGroups { public static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] ROW_1 = Bytes.toBytes("row1"); private final static byte[] CF = Bytes.toBytes("f"); private final static byte[] Q1 = Bytes.toBytes("q1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java index 2ec1a91dd76..1d0c6e60a98 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.security.PrivilegedExceptionAction; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -63,7 +63,7 @@ public class TestVisibilityWithCheckAuths { private static final String TOPSECRET = "TOPSECRET"; private static final String PUBLIC = "PUBLIC"; - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] row1 = Bytes.toBytes("row1"); private final static byte[] fam = Bytes.toBytes("info"); private final static byte[] qual = Bytes.toBytes("qual"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestWithDisabledAuthorization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestWithDisabledAuthorization.java index 15ca1d302c8..3a97a239b25 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestWithDisabledAuthorization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestWithDisabledAuthorization.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -61,7 +61,7 @@ public class TestWithDisabledAuthorization { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWithDisabledAuthorization.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String CONFIDENTIAL = "confidential"; private static final String SECRET = "secret"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelsWithDeletesTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelsWithDeletesTestBase.java index ec3b9057625..387becbdae7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelsWithDeletesTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelsWithDeletesTestBase.java @@ -27,7 +27,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -58,7 +58,7 @@ public abstract class VisibilityLabelsWithDeletesTestBase { protected static final String PRIVATE = "PRIVATE"; protected static final String CONFIDENTIAL = "CONFIDENTIAL"; protected static final String SECRET = "SECRET"; - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static final byte[] row1 = Bytes.toBytes("row1"); protected static final byte[] row2 = Bytes.toBytes("row2"); protected final static byte[] fam = Bytes.toBytes("info"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java index 9ee43363121..fea4fb4ba58 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -45,27 +45,27 @@ public class MobSnapshotTestingUtils { /** * Create the Mob Table. */ - public static void createMobTable(final HBaseTestingUtility util, + public static void createMobTable(final HBaseTestingUtil util, final TableName tableName, int regionReplication, final byte[]... families) throws IOException, InterruptedException { createMobTable(util, tableName, SnapshotTestingUtils.getSplitKeys(), regionReplication, families); } - public static void createPreSplitMobTable(final HBaseTestingUtility util, + public static void createPreSplitMobTable(final HBaseTestingUtil util, final TableName tableName, int nRegions, final byte[]... families) throws IOException, InterruptedException { createMobTable(util, tableName, SnapshotTestingUtils.getSplitKeys(nRegions), 1, families); } - public static void createMobTable(final HBaseTestingUtility util, final TableName tableName, + public static void createMobTable(final HBaseTestingUtil util, final TableName tableName, final byte[][] splitKeys, int regionReplication, final byte[]... families) throws IOException, InterruptedException { createMobTable(util, tableName, splitKeys, regionReplication, null, families); } - public static void createMobTable(HBaseTestingUtility util, TableName tableName, + public static void createMobTable(HBaseTestingUtil util, TableName tableName, byte[][] splitKeys, int regionReplication, String cpClassName, byte[]... families) throws IOException, InterruptedException { TableDescriptorBuilder builder = @@ -92,7 +92,7 @@ public class MobSnapshotTestingUtils { * @return An Table instance for the created table. * @throws IOException */ - public static Table createMobTable(final HBaseTestingUtility util, + public static Table createMobTable(final HBaseTestingUtil util, final TableName tableName, final byte[]... families) throws IOException { TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName); for (byte[] family : families) { @@ -135,7 +135,7 @@ public class MobSnapshotTestingUtils { } } - public static void verifyMobRowCount(final HBaseTestingUtility util, + public static void verifyMobRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { Table table = ConnectionFactory.createConnection(util.getConfiguration()).getTable(tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java index 2e69ac2f2ce..d8d2a5eed0b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java @@ -36,7 +36,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotEnabledException; @@ -158,7 +158,7 @@ public final class SnapshotTestingUtils { tableName); } - public static void confirmSnapshotValid(HBaseTestingUtility testUtil, + public static void confirmSnapshotValid(HBaseTestingUtil testUtil, SnapshotProtos.SnapshotDescription snapshotDescriptor, TableName tableName, byte[] family) throws IOException { MasterFileSystem mfs = testUtil.getHBaseCluster().getMaster().getMasterFileSystem(); @@ -399,12 +399,12 @@ public final class SnapshotTestingUtils { /** * Corrupt the specified snapshot by deleting some files. * - * @param util {@link HBaseTestingUtility} + * @param util {@link HBaseTestingUtil} * @param snapshotName name of the snapshot to corrupt * @return array of the corrupted HFiles * @throws IOException on unexecpted error reading the FS */ - public static ArrayList corruptSnapshot(final HBaseTestingUtility util, final String snapshotName) + public static ArrayList corruptSnapshot(final HBaseTestingUtil util, final String snapshotName) throws IOException { final MasterFileSystem mfs = util.getHBaseCluster().getMaster().getMasterFileSystem(); final FileSystem fs = mfs.getFileSystem(); @@ -750,7 +750,7 @@ public final class SnapshotTestingUtils { // ========================================================================== // Table Helpers // ========================================================================== - public static void waitForTableToBeOnline(final HBaseTestingUtility util, + public static void waitForTableToBeOnline(final HBaseTestingUtil util, final TableName tableName) throws IOException, InterruptedException { HRegionServer rs = util.getRSForFirstRegionInTable(tableName); @@ -762,7 +762,7 @@ public final class SnapshotTestingUtils { util.waitFor(60000, util.predicateTableAvailable(tableName)); } - public static void createTable(final HBaseTestingUtility util, final TableName tableName, + public static void createTable(final HBaseTestingUtil util, final TableName tableName, int regionReplication, int nRegions, final byte[]... families) throws IOException, InterruptedException { TableDescriptorBuilder builder @@ -794,28 +794,28 @@ public final class SnapshotTestingUtils { return splitKeys; } - public static void createTable(final HBaseTestingUtility util, final TableName tableName, + public static void createTable(final HBaseTestingUtil util, final TableName tableName, final byte[]... families) throws IOException, InterruptedException { createTable(util, tableName, 1, families); } - public static void createTable(final HBaseTestingUtility util, final TableName tableName, + public static void createTable(final HBaseTestingUtil util, final TableName tableName, final int regionReplication, final byte[]... families) throws IOException, InterruptedException { createTable(util, tableName, regionReplication, KEYS.length, families); } - public static void createPreSplitTable(final HBaseTestingUtility util, final TableName tableName, + public static void createPreSplitTable(final HBaseTestingUtil util, final TableName tableName, final int nRegions, final byte[]... families) throws IOException, InterruptedException { createTable(util, tableName, 1, nRegions, families); } - public static void loadData(final HBaseTestingUtility util, final TableName tableName, int rows, + public static void loadData(final HBaseTestingUtil util, final TableName tableName, int rows, byte[]... families) throws IOException, InterruptedException { BufferedMutator mutator = util.getConnection().getBufferedMutator(tableName); loadData(util, mutator, rows, families); } - public static void loadData(final HBaseTestingUtility util, final BufferedMutator mutator, + public static void loadData(final HBaseTestingUtil util, final BufferedMutator mutator, int rows, byte[]... families) throws IOException, InterruptedException { // Ensure one row per region assertTrue(rows >= KEYS.length); @@ -864,7 +864,7 @@ public final class SnapshotTestingUtils { SnapshotTestingUtils.assertNoSnapshots(admin); } - public static void deleteArchiveDirectory(final HBaseTestingUtility util) + public static void deleteArchiveDirectory(final HBaseTestingUtil util) throws IOException { // Ensure the archiver to be empty MasterFileSystem mfs = util.getMiniHBaseCluster().getMaster().getMasterFileSystem(); @@ -872,7 +872,7 @@ public final class SnapshotTestingUtils { mfs.getFileSystem().delete(archiveDir, true); } - public static void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + public static void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { Table table = util.getConnection().getTable(tableName); try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java index 5c50d042b8b..b7a99d40dbc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -82,7 +82,7 @@ public class TestFlushSnapshotFromClient { private static final Logger LOG = LoggerFactory.getLogger(TestFlushSnapshotFromClient.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static final int NUM_RS = 2; protected static final byte[] TEST_FAM = Bytes.toBytes("fam"); protected static final TableName TABLE_NAME = TableName.valueOf("test"); @@ -454,7 +454,7 @@ public class TestFlushSnapshotFromClient { SnapshotTestingUtils.waitForTableToBeOnline(UTIL, TABLE_NAME); } - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobFlushSnapshotFromClient.java index cb478d6a495..431672ae19d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobFlushSnapshotFromClient.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.snapshot; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.mob.MobConstants; @@ -66,7 +66,7 @@ public class TestMobFlushSnapshotFromClient extends TestFlushSnapshotFromClient } @Override - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobRestoreFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobRestoreFlushSnapshotFromClient.java index 20d0da6df2f..e9dced61aa6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobRestoreFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestMobRestoreFlushSnapshotFromClient.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.snapshot; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.mob.MobConstants; @@ -64,7 +64,7 @@ public class TestMobRestoreFlushSnapshotFromClient extends TestRestoreFlushSnaps } @Override - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { MobSnapshotTestingUtils.verifyMobRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRegionSnapshotTask.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRegionSnapshotTask.java index 9ab58155843..fd1cc535e21 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRegionSnapshotTask.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRegionSnapshotTask.java @@ -32,7 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.TableDescriptor; @@ -69,14 +69,14 @@ public class TestRegionSnapshotTask { private final Logger LOG = LoggerFactory.getLogger(getClass()); - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private static Configuration conf; private static FileSystem fs; private static Path rootDir; @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); conf = TEST_UTIL.getConfiguration(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java index 22a17da2cac..3e9e8462ad1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.snapshot; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -58,7 +58,7 @@ public class TestRestoreFlushSnapshotFromClient { private static final Logger LOG = LoggerFactory.getLogger(TestRestoreFlushSnapshotFromClient.class); - protected final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected final byte[] FAMILY = Bytes.toBytes("cf"); @@ -217,7 +217,7 @@ public class TestRestoreFlushSnapshotFromClient { UTIL.getMiniHBaseCluster().getMaster().getMasterFileSystem().logFileSystemState(LOG); } - protected void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, + protected void verifyRowCount(final HBaseTestingUtil util, final TableName tableName, long expectedRows) throws IOException { SnapshotTestingUtils.verifyRowCount(util, tableName, expectedRows); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java index 14e290c16d0..58023e139c4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -73,7 +73,7 @@ public class TestRestoreSnapshotHelper { private static final Logger LOG = LoggerFactory.getLogger(TestRestoreSnapshotHelper.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final static String TEST_HFILE = "abc"; protected Configuration conf; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java index b99abe5d6b4..a2d6501cbc3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotClientRetries.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.client.SnapshotDescription; @@ -50,7 +50,7 @@ public class TestSnapshotClientRetries { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotClientRetries.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotClientRetries.class); @Rule public TableNameTestRule testTable = new TableNameTestRule(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotDescriptionUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotDescriptionUtils.java index b3e1d9640f3..a7b8c8e7269 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotDescriptionUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotDescriptionUtils.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -50,7 +50,7 @@ public class TestSnapshotDescriptionUtils { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotDescriptionUtils.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static FileSystem fs; private static Path root; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotManifest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotManifest.java index 84e5157d1f0..775728f4d02 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotManifest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotManifest.java @@ -25,7 +25,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.RegionInfo; @@ -62,7 +62,7 @@ public class TestSnapshotManifest { private static final int TEST_NUM_REGIONS = 16000; private static final int TEST_NUM_REGIONFILES = 1000000; - private static HBaseTestingUtility TEST_UTIL; + private static HBaseTestingUtil TEST_UTIL; private Configuration conf; private FileSystem fs; private Path rootDir; @@ -72,7 +72,7 @@ public class TestSnapshotManifest { @Before public void setup() throws Exception { - TEST_UTIL = new HBaseTestingUtility(); + TEST_UTIL = new HBaseTestingUtil(); rootDir = TEST_UTIL.getDataTestDir(TABLE_NAME_STR); fs = TEST_UTIL.getTestFileSystem(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotStoreFileSize.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotStoreFileSize.java index f49ff4a407e..8f8905fdf4a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotStoreFileSize.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotStoreFileSize.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.RegionInfo; @@ -58,7 +58,7 @@ public class TestSnapshotStoreFileSize { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotStoreFileSize.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final TableName TABLE_NAME = TableName.valueOf("t1"); private static final String SNAPSHOT_NAME = "s1"; private static final String FAMILY_NAME = "cf"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotWhenChoreCleaning.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotWhenChoreCleaning.java index ac489407922..6414b9803fe 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotWhenChoreCleaning.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotWhenChoreCleaning.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNameTestRule; import org.apache.hadoop.hbase.client.Put; @@ -63,7 +63,7 @@ public class TestSnapshotWhenChoreCleaning { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSnapshotWhenChoreCleaning.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final Configuration CONF = TEST_UTIL.getConfiguration(); private static final Logger LOG = LoggerFactory.getLogger(TestSnapshotClientRetries.class); private static final TableName TABLE_NAME = TableName.valueOf("testTable"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFiles.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFiles.java index d90d75fc5ed..b421dc5f566 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFiles.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFiles.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.tool; -import static org.apache.hadoop.hbase.HBaseTestingUtility.countRows; +import static org.apache.hadoop.hbase.HBaseTestingUtil.countRows; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -39,7 +39,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -96,7 +96,7 @@ public class TestBulkLoadHFiles { private static final byte[][] SPLIT_KEYS = new byte[][] { Bytes.toBytes("ddd"), Bytes.toBytes("ppp") }; - static HBaseTestingUtility util = new HBaseTestingUtility(); + static HBaseTestingUtil util = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -292,7 +292,7 @@ public class TestBulkLoadHFiles { runTest(testName, htd, preCreateTable, tableSplitKeys, hfileRanges, useMap, false, depth); } - public static int loadHFiles(String testName, TableDescriptor htd, HBaseTestingUtility util, + public static int loadHFiles(String testName, TableDescriptor htd, HBaseTestingUtil util, byte[] fam, byte[] qual, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean deleteFile, boolean copyFiles, int initRowCount, int factor) throws Exception { @@ -300,7 +300,7 @@ public class TestBulkLoadHFiles { useMap, deleteFile, copyFiles, initRowCount, factor, 2); } - public static int loadHFiles(String testName, TableDescriptor htd, HBaseTestingUtility util, + public static int loadHFiles(String testName, TableDescriptor htd, HBaseTestingUtil util, byte[] fam, byte[] qual, boolean preCreateTable, byte[][] tableSplitKeys, byte[][][] hfileRanges, boolean useMap, boolean deleteFile, boolean copyFiles, int initRowCount, int factor, int depth) throws Exception { @@ -774,7 +774,7 @@ public class TestBulkLoadHFiles { try { loader.bulkLoad(table.getName(), dir); assertEquals(families.length, attmptedCalls.get()); - assertEquals(1000 * families.length, HBaseTestingUtility.countRows(table)); + assertEquals(1000 * families.length, HBaseTestingUtil.countRows(table)); } finally { if (null != table) { table.close(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFilesSplitRecovery.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFilesSplitRecovery.java index ac0338aa54b..7c5f1139ff0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFilesSplitRecovery.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFilesSplitRecovery.java @@ -41,7 +41,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableExistsException; import org.apache.hadoop.hbase.TableName; @@ -90,7 +90,7 @@ public class TestBulkLoadHFilesSplitRecovery { private static final Logger LOG = LoggerFactory.getLogger(TestHRegionServerBulkLoad.class); - static HBaseTestingUtility util; + static HBaseTestingUtil util; // used by secure subclass static boolean useSecure = false; @@ -227,7 +227,7 @@ public class TestBulkLoadHFilesSplitRecovery { @BeforeClass public static void setupCluster() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, ""); util.startMiniCluster(1); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java index 6d5e81ab3fb..2de5575f8d2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java @@ -41,7 +41,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -68,7 +68,7 @@ public class TestCanaryTool { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCanaryTool.class); - private HBaseTestingUtility testingUtility; + private HBaseTestingUtil testingUtility; private static final byte[] FAMILY = Bytes.toBytes("f"); private static final byte[] COLUMN = Bytes.toBytes("col"); @@ -79,7 +79,7 @@ public class TestCanaryTool { @Before public void setUp() throws Exception { - testingUtility = new HBaseTestingUtility(); + testingUtility = new HBaseTestingUtil(); testingUtility.startMiniCluster(); mockAppender = mock(org.apache.logging.log4j.core.Appender.class); when(mockAppender.getName()).thenReturn("mockAppender"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestSecureBulkLoadHFilesSplitRecovery.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestSecureBulkLoadHFilesSplitRecovery.java index 5943b0dde69..94bb925563b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestSecureBulkLoadHFilesSplitRecovery.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestSecureBulkLoadHFilesSplitRecovery.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.tool; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.security.HadoopSecurityEnabledUserProviderForTesting; import org.apache.hadoop.hbase.security.UserProvider; import org.apache.hadoop.hbase.security.access.PermissionStorage; @@ -50,7 +50,7 @@ public class TestSecureBulkLoadHFilesSplitRecovery extends TestBulkLoadHFilesSpl // make sure they are in sync @BeforeClass public static void setupCluster() throws Exception { - util = new HBaseTestingUtility(); + util = new HBaseTestingUtil(); // set the always on security provider UserProvider.setUserProviderForTesting(util.getConfiguration(), HadoopSecurityEnabledUserProviderForTesting.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java index 456e48c81c5..db7c89ca384 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java @@ -38,7 +38,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ClusterMetrics; import org.apache.hadoop.hbase.ClusterMetrics.Option; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; @@ -83,7 +83,7 @@ import org.slf4j.LoggerFactory; public class BaseTestHBaseFsck { static final int POOL_SIZE = 7; protected static final Logger LOG = LoggerFactory.getLogger(BaseTestHBaseFsck.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final static Configuration conf = TEST_UTIL.getConfiguration(); protected final static String FAM_STR = "fam"; protected final static byte[] FAM = Bytes.toBytes(FAM_STR); @@ -608,7 +608,7 @@ public class BaseTestHBaseFsck { } } - public static void createTable(HBaseTestingUtility testUtil, TableDescriptor tableDescriptor, + public static void createTable(HBaseTestingUtil testUtil, TableDescriptor tableDescriptor, byte[][] splitKeys) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. @@ -625,7 +625,7 @@ public class BaseTestHBaseFsck { testUtil.waitUntilAllRegionsAssigned(tableDescriptor.getTableName()); } - public static void deleteTable(HBaseTestingUtility testUtil, TableName tableName) + public static void deleteTable(HBaseTestingUtil testUtil, TableName tableName) throws Exception { // NOTE: We need a latch because admin is not sync, // so the postOp coprocessor method may be called after the admin operation returned. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java index 1956f5a2694..4835d2f12b0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.Store; import org.slf4j.Logger; @@ -227,7 +227,7 @@ public class HFileArchiveTestingUtil { region.getRegionFileSystem().getTableDir(), store.getColumnFamilyDescriptor().getName()); } - public static Path getStoreArchivePath(HBaseTestingUtility util, String tableName, + public static Path getStoreArchivePath(HBaseTestingUtil util, String tableName, byte[] storeName) throws IOException { byte[] table = Bytes.toBytes(tableName); // get the RS and region serving our table diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java index 85d59ac0172..19461434e89 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java @@ -78,8 +78,9 @@ public abstract class MultiThreadedAction { * Default implementation of LoadTestDataGenerator that uses LoadTestKVGenerator, fixed * set of column families, and random number of columns in range. The table for it can * be created manually or, for example, via - * {@link org.apache.hadoop.hbase.HBaseTestingUtility#createPreSplitLoadTestTable(Configuration, TableName, byte[], - * org.apache.hadoop.hbase.io.compress.Compression.Algorithm, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding)} + * {@link org.apache.hadoop.hbase.HBaseTestingUtil#createPreSplitLoadTestTable(Configuration, + * TableName, byte[], org.apache.hadoop.hbase.io.compress.Compression.Algorithm, + * org.apache.hadoop.hbase.io.encoding.DataBlockEncoding)} */ public static class DefaultDataGenerator extends LoadTestDataGenerator { private byte[][] columnFamilies = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java index 5b969e329ef..cef59dc3a09 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java @@ -37,27 +37,22 @@ import java.util.Set; import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; - import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.testclassification.LargeTests; -import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hdfs.MiniDFSCluster; -import org.junit.experimental.categories.Category; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A helper class for process-based mini-cluster tests. Unlike - * {@link MiniHBaseCluster}, starts daemons as separate processes, allowing to + * {@link SingleProcessHBaseCluster}, starts daemons as separate processes, allowing to * do real kill testing. */ -@Category({MiscTests.class, LargeTests.class}) public class ProcessBasedLocalHBaseCluster { private final String hbaseHome, workDir; @@ -81,7 +76,7 @@ public class ProcessBasedLocalHBaseCluster { private MiniDFSCluster dfsCluster; - private HBaseTestingUtility testUtil; + private HBaseTestingUtil testUtil; private Thread logTailerThread; @@ -115,7 +110,7 @@ public class ProcessBasedLocalHBaseCluster { this.numDataNodes = numDataNodes; hbaseDaemonScript = hbaseHome + "/bin/hbase-daemon.sh"; - zkClientPort = HBaseTestingUtility.randomFreePort(); + zkClientPort = HBaseTestingUtil.randomFreePort(); this.rsPorts = sortedPorts(numRegionServers); this.masterPorts = sortedPorts(numMasters); @@ -131,7 +126,7 @@ public class ProcessBasedLocalHBaseCluster { */ public void startMiniDFS() throws Exception { if (testUtil == null) { - testUtil = new HBaseTestingUtility(conf); + testUtil = new HBaseTestingUtil(conf); } dfsCluster = testUtil.startMiniDFSCluster(numDataNodes); } @@ -144,7 +139,7 @@ public class ProcessBasedLocalHBaseCluster { private static List sortedPorts(int n) { List ports = new ArrayList<>(n); for (int i = 0; i < n; ++i) { - ports.add(HBaseTestingUtility.randomFreePort()); + ports.add(HBaseTestingUtil.randomFreePort()); } Collections.sort(ports); return ports; @@ -158,7 +153,7 @@ public class ProcessBasedLocalHBaseCluster { LOG.info("Starting ZooKeeper on port " + zkClientPort); startZK(); - HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, zkClientPort); + HBaseTestingUtil.waitForHostPort(HConstants.LOCALHOST, zkClientPort); for (int masterPort : masterPorts) { startMaster(masterPort); @@ -386,13 +381,13 @@ public class ProcessBasedLocalHBaseCluster { if (serverType == ServerType.MASTER) { confMap.put(HConstants.MASTER_PORT, rpcPort); - int masterInfoPort = HBaseTestingUtility.randomFreePort(); + int masterInfoPort = HBaseTestingUtil.randomFreePort(); reportWebUIPort("master", masterInfoPort); confMap.put(HConstants.MASTER_INFO_PORT, masterInfoPort); } else if (serverType == ServerType.RS) { confMap.put(HConstants.REGIONSERVER_PORT, rpcPort); - int rsInfoPort = HBaseTestingUtility.randomFreePort(); + int rsInfoPort = HBaseTestingUtil.randomFreePort(); reportWebUIPort("region server", rsInfoPort); confMap.put(HConstants.REGIONSERVER_INFO_PORT, rsInfoPort); } else { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/RestartMetaTest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/RestartMetaTest.java index b3dce20fa48..ddd29fbc556 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/RestartMetaTest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/RestartMetaTest.java @@ -17,8 +17,7 @@ package org.apache.hadoop.hbase.util; import java.io.IOException; - -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; @@ -100,7 +99,7 @@ public class RestartMetaTest extends AbstractHBaseTool { hbaseCluster.startHBase(); // create tables if needed - HBaseTestingUtility.createPreSplitLoadTestTable(conf, TABLE_NAME, + HBaseTestingUtil.createPreSplitLoadTestTable(conf, TABLE_NAME, HFileTestUtil.DEFAULT_COLUMN_FAMILY, Compression.Algorithm.NONE, DataBlockEncoding.NONE); @@ -113,7 +112,7 @@ public class RestartMetaTest extends AbstractHBaseTool { Connection connection = ConnectionFactory.createConnection(conf); - int metaRSPort = HBaseTestingUtility.getMetaRSPort(connection); + int metaRSPort = HBaseTestingUtil.getMetaRSPort(connection); LOG.debug("Killing hbase:meta region server running on port " + metaRSPort); hbaseCluster.killRegionServer(metaRSPort); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestConnectionCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestConnectionCache.java index bb74b296758..b01ca220474 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestConnectionCache.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestConnectionCache.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.util; import junit.framework.TestCase; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.security.UserProvider; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; @@ -34,7 +34,7 @@ public class TestConnectionCache extends TestCase { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestConnectionCache.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); /** * test for ConnectionCache cleaning expired Connection diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java index 568a1ba4e55..d5c31236d11 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorScanPolicy.java @@ -18,6 +18,8 @@ package org.apache.hadoop.hbase.util; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.junit.ClassRule; // this is deliberately not in the o.a.h.h.regionserver package @@ -37,8 +39,6 @@ import java.util.function.Predicate; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; -import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Get; @@ -80,7 +80,7 @@ public class TestCoprocessorScanPolicy { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCoprocessorScanPolicy.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final byte[] F = Bytes.toBytes("fam"); private static final byte[] Q = Bytes.toBytes("qual"); private static final byte[] R = Bytes.toBytes("row"); @@ -99,7 +99,7 @@ public class TestCoprocessorScanPolicy { @Parameters public static Collection parameters() { - return HBaseCommonTestingUtility.BOOLEAN_PARAMETERIZED; + return HBaseCommonTestingUtil.BOOLEAN_PARAMETERIZED; } public TestCoprocessorScanPolicy(boolean parallelSeekEnable) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java index c66e88c24bb..b9742757a9b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java @@ -34,7 +34,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableDescriptors; import org.apache.hadoop.hbase.TableName; @@ -63,7 +63,7 @@ public class TestFSTableDescriptors { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFSTableDescriptors.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestFSTableDescriptors.class); @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java index 1e5dbf2108a..16d4456fc18 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java @@ -39,7 +39,7 @@ import org.apache.hadoop.fs.StreamCapabilities; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.client.RegionInfoBuilder; @@ -72,13 +72,13 @@ public class TestFSUtils { private static final Logger LOG = LoggerFactory.getLogger(TestFSUtils.class); - private HBaseTestingUtility htu; + private HBaseTestingUtil htu; private FileSystem fs; private Configuration conf; @Before public void setUp() throws IOException { - htu = new HBaseTestingUtility(); + htu = new HBaseTestingUtil(); fs = htu.getTestFileSystem(); conf = htu.getConfiguration(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java index 7cb3fd4ff7b..a3c06259e15 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java @@ -25,7 +25,7 @@ import java.util.Set; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.After; @@ -48,7 +48,7 @@ public class TestFSVisitor { private static final Logger LOG = LoggerFactory.getLogger(TestFSVisitor.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private final String TABLE_NAME = "testtb"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckCleanReplicationBarriers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckCleanReplicationBarriers.java index 497b94580c8..c55b4db5076 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckCleanReplicationBarriers.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckCleanReplicationBarriers.java @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.ClientMetaTableAccessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.TableName; @@ -56,7 +56,7 @@ public class TestHBaseFsckCleanReplicationBarriers { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHBaseFsckCleanReplicationBarriers.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String PEER_1 = "1", PEER_2 = "2"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java index 8afc1f1ddd9..90fe71eb502 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckEncryption.java @@ -29,7 +29,7 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -66,7 +66,7 @@ public class TestHBaseFsckEncryption { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHBaseFsckEncryption.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Configuration conf; private TableDescriptor tableDescriptor; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java index 316a321f2b7..193f9a248ff 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals; import java.util.List; import java.util.stream.Stream; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; import org.apache.hadoop.hbase.replication.ReplicationPeerStorage; @@ -46,7 +46,7 @@ public class TestHBaseFsckReplication { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHBaseFsckReplication.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java index 4dd4105eeb1..f5669ba012a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java @@ -27,7 +27,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterMetrics.Option; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException; @@ -73,8 +73,8 @@ public class TestMiniClusterLoadSequential { protected static final int NUM_THREADS = 8; protected static final int NUM_RS = 2; protected static final int TIMEOUT_MS = 180000; - protected static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); protected final Configuration conf = TEST_UTIL.getConfiguration(); protected final boolean isMultiPut; @@ -153,7 +153,7 @@ public class TestMiniClusterLoadSequential { protected void createPreSplitLoadTestTable(TableDescriptor tableDescriptor, ColumnFamilyDescriptor familyDescriptor) throws IOException { - HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableDescriptor, familyDescriptor); + HBaseTestingUtil.createPreSplitLoadTestTable(conf, tableDescriptor, familyDescriptor); TEST_UTIL.waitUntilAllRegionsAssigned(tableDescriptor.getTableName()); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover1.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover1.java index 8138f6b964b..165fc67b29e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover1.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover1.java @@ -29,10 +29,10 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.Predicate; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -72,7 +72,7 @@ public class TestRegionMover1 { private static final Logger LOG = LoggerFactory.getLogger(TestRegionMover1.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -104,7 +104,7 @@ public class TestRegionMover1 { @Test public void testWithAck() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HRegionServer regionServer = cluster.getRegionServer(0); String rsName = regionServer.getServerName().getAddress().toString(); int numRegions = regionServer.getNumberOfOnlineRegions(); @@ -127,7 +127,7 @@ public class TestRegionMover1 { */ @Test public void testWithoutAck() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HRegionServer regionServer = cluster.getRegionServer(0); String rsName = regionServer.getServerName().getAddress().toString(); int numRegions = regionServer.getNumberOfOnlineRegions(); @@ -161,7 +161,7 @@ public class TestRegionMover1 { */ @Test public void testExclude() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); File excludeFile = new File(TEST_UTIL.getDataTestDir().toUri().getPath(), "exclude_file"); FileWriter fos = new FileWriter(excludeFile); HRegionServer excludeServer = cluster.getRegionServer(1); @@ -189,7 +189,7 @@ public class TestRegionMover1 { @Test public void testDesignatedFile() throws Exception{ - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); File designatedFile = new File(TEST_UTIL.getDataTestDir().toUri().getPath(), "designated_file"); HRegionServer designatedServer = cluster.getRegionServer(0); @@ -220,7 +220,7 @@ public class TestRegionMover1 { @Test public void testExcludeAndDesignated() throws Exception{ - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); // create designated file File designatedFile = new File(TEST_UTIL.getDataTestDir().toUri().getPath(), "designated_file"); @@ -268,7 +268,7 @@ public class TestRegionMover1 { @Test public void testRegionServerPort() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HRegionServer regionServer = cluster.getRegionServer(0); String rsName = regionServer.getServerName().getHostname(); @@ -334,7 +334,7 @@ public class TestRegionMover1 { @Test public void testDecomServerExclusionWithAck() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HRegionServer excludeServer = cluster.getRegionServer(1); List regions = excludeServer.getRegions(); int regionsExcludeServer = excludeServer.getNumberOfOnlineRegions(); @@ -390,7 +390,7 @@ public class TestRegionMover1 { @Test public void testDecomServerExclusion() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HRegionServer excludeServer = cluster.getRegionServer(0); List regions = excludeServer.getRegions(); int regionsExcludeServer = excludeServer.getNumberOfOnlineRegions(); @@ -432,7 +432,7 @@ public class TestRegionMover1 { @Test public void testExcludeAndDecomServers() throws Exception { - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); File excludeFile = new File(TEST_UTIL.getDataTestDir().toUri().getPath(), "exclude_file"); FileWriter fos = new FileWriter(excludeFile); HRegionServer excludeServer = cluster.getRegionServer(1); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover2.java index 6007fd7b88b..ecf3ef56cd8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover2.java @@ -19,8 +19,8 @@ package org.apache.hadoop.hbase.util; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -65,7 +65,7 @@ public class TestRegionMover2 { private static final Logger LOG = LoggerFactory.getLogger(TestRegionMover2.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -98,7 +98,7 @@ public class TestRegionMover2 { @Test public void testWithMergedRegions() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); Admin admin = TEST_UTIL.getAdmin(); Table table = TEST_UTIL.getConnection().getTable(tableName); List puts = new ArrayList<>(); @@ -133,7 +133,7 @@ public class TestRegionMover2 { @Test public void testWithSplitRegions() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); Admin admin = TEST_UTIL.getAdmin(); Table table = TEST_UTIL.getConnection().getTable(tableName); List puts = new ArrayList<>(); @@ -182,7 +182,7 @@ public class TestRegionMover2 { @Test public void testFailedRegionMove() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); Admin admin = TEST_UTIL.getAdmin(); Table table = TEST_UTIL.getConnection().getTable(tableName); List puts = new ArrayList<>(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover3.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover3.java index 1903fa6bf5b..aa9fbe49b85 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover3.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMover3.java @@ -19,9 +19,9 @@ package org.apache.hadoop.hbase.util; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -59,7 +59,7 @@ public class TestRegionMover3 { @Rule public TestName name = new TestName(); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static ServerName rs0; private static ServerName rs1; private static ServerName rs2; @@ -67,7 +67,7 @@ public class TestRegionMover3 { @BeforeClass public static void setUpBeforeClass() throws Exception { TEST_UTIL.startMiniCluster(3); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); rs0 = cluster.getRegionServer(0).getServerName(); rs1 = cluster.getRegionServer(1).getServerName(); rs2 = cluster.getRegionServer(2).getServerName(); @@ -92,7 +92,7 @@ public class TestRegionMover3 { @Test public void testRegionUnloadWithRack() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); Admin admin = TEST_UTIL.getAdmin(); Table table = TEST_UTIL.getConnection().getTable(tableName); List puts = IntStream.range(10, 50000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMoverWithRSGroupEnable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMoverWithRSGroupEnable.java index 3d3cdb2b105..50b96e82c69 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMoverWithRSGroupEnable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionMoverWithRSGroupEnable.java @@ -23,7 +23,7 @@ import java.util.HashSet; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -59,7 +59,7 @@ public class TestRegionMoverWithRSGroupEnable { HBaseClassTestRule.forClass(TestRegionMoverWithRSGroupEnable.class); private static final Logger LOG = LoggerFactory.getLogger(TestRegionMoverWithRSGroupEnable.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static final String TEST_RSGROUP = "test"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitCalculator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitCalculator.java index 2ecc70db769..e9e51672997 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitCalculator.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitCalculator.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.SortedSet; import java.util.UUID; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.MiscTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -47,7 +47,7 @@ public class TestRegionSplitCalculator { HBaseClassTestRule.forClass(TestRegionSplitCalculator.class); private static final Logger LOG = LoggerFactory.getLogger(TestRegionSplitCalculator.class); - public static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + public static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); /** * This is range uses a user specified start and end keys. It also has an * extra tiebreaker so that different ranges with the same start/end key pair diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java index a9c59197266..72b2bd804df 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java @@ -28,7 +28,7 @@ import java.util.List; import org.apache.commons.lang3.ArrayUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfo; @@ -59,29 +59,29 @@ public class TestRegionSplitter { @ClassRule public static final HBaseClassTestRule CLASS_RULE = - HBaseClassTestRule.forClass(TestRegionSplitter.class); + HBaseClassTestRule.forClass(TestRegionSplitter.class); - private final static Logger LOG = LoggerFactory.getLogger(TestRegionSplitter.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); - private final static String CF_NAME = "SPLIT_TEST_CF"; - private final static byte xFF = (byte) 0xff; + private final static Logger LOG = LoggerFactory.getLogger(TestRegionSplitter.class); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); + private final static String CF_NAME = "SPLIT_TEST_CF"; + private final static byte xFF = (byte) 0xff; - @Rule - public TestName name = new TestName(); + @Rule + public TestName name = new TestName(); - @BeforeClass - public static void setup() throws Exception { - UTIL.startMiniCluster(); - } + @BeforeClass + public static void setup() throws Exception { + UTIL.startMiniCluster(); + } - @AfterClass - public static void teardown() throws Exception { - UTIL.shutdownMiniCluster(); - } + @AfterClass + public static void teardown() throws Exception { + UTIL.shutdownMiniCluster(); + } - /** - * Test creating a pre-split table using the HexStringSplit algorithm. - */ + /** + * Test creating a pre-split table using the HexStringSplit algorithm. + */ @Test public void testCreatePresplitTableHex() throws Exception { final List expectedBounds = new ArrayList<>(17); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactionRequest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactionRequest.java index c125c6e9889..fc098a84e59 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactionRequest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactionRequest.java @@ -41,7 +41,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.RegionInfo; @@ -66,7 +66,7 @@ public class TestMajorCompactionRequest { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestMajorCompactionRequest.class); - protected static final HBaseTestingUtility UTILITY = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTILITY = new HBaseTestingUtil(); protected static final String FAMILY = "a"; protected Path rootRegionDir; protected Path regionStoreDir; @@ -98,7 +98,7 @@ public class TestMajorCompactionRequest { TableDescriptor htd = UTILITY.createTableDescriptor(table, Bytes.toBytes(FAMILY)); RegionInfo hri = RegionInfoBuilder.newBuilder(htd.getTableName()).build(); HRegion region = - HBaseTestingUtility.createRegionAndWAL(hri, rootRegionDir, UTILITY.getConfiguration(), htd); + HBaseTestingUtil.createRegionAndWAL(hri, rootRegionDir, UTILITY.getConfiguration(), htd); Configuration configuration = mock(Configuration.class); // the reference file timestamp is newer diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactor.java index 3d44a6f2133..b5d72cc86c2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactor.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.util.compaction; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; @@ -44,11 +44,11 @@ public class TestMajorCompactor { HBaseClassTestRule.forClass(TestMajorCompactor.class); public static final byte[] FAMILY = Bytes.toBytes("a"); - protected HBaseTestingUtility utility; + protected HBaseTestingUtil utility; protected Admin admin; @Before public void setUp() throws Exception { - utility = new HBaseTestingUtility(); + utility = new HBaseTestingUtil(); utility.getConfiguration().setInt("hbase.hfile.compaction.discharger.interval", 10); utility.startMiniCluster(); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactorTTL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactorTTL.java index 44abda61a6e..c12b38e6faa 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactorTTL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/compaction/TestMajorCompactorTTL.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; @@ -52,7 +52,7 @@ public class TestMajorCompactorTTL extends TestMajorCompactor { @Before @Override public void setUp() throws Exception { - utility = new HBaseTestingUtility(); + utility = new HBaseTestingUtil(); utility.getConfiguration().setInt("hbase.hfile.compaction.discharger.interval", 10); utility.startMiniCluster(); admin = utility.getAdmin(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestBoundedRegionGroupingStrategy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestBoundedRegionGroupingStrategy.java index f090b1a50f8..01a2f1ec2ac 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestBoundedRegionGroupingStrategy.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestBoundedRegionGroupingStrategy.java @@ -33,7 +33,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.RegionInfoBuilder; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -65,7 +65,7 @@ public class TestBoundedRegionGroupingStrategy { private static final Logger LOG = LoggerFactory.getLogger(TestBoundedRegionGroupingStrategy.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration CONF; private static DistributedFileSystem FS; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java index 8e660b67193..ffb7efd30d4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -63,7 +63,7 @@ public class TestCompressedWAL { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCompressedWAL.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestDisabledWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestDisabledWAL.java index bee76c6d8ad..5e91f9a339b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestDisabledWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestDisabledWAL.java @@ -24,7 +24,7 @@ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; @@ -57,7 +57,7 @@ public class TestDisabledWAL { public TestName name = new TestName(); private static final Logger LOG = LoggerFactory.getLogger(TestDisabledWAL.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Table table; private TableName tableName; private byte[] fam = Bytes.toBytes("f1"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java index 32c2de96408..c67ff32507b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java @@ -33,7 +33,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -71,7 +71,7 @@ public class TestFSHLogProvider { private static Configuration conf; private static FileSystem fs; - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private MultiVersionConcurrencyControl mvcc; @Rule diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestReadWriteSeqIdFiles.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestReadWriteSeqIdFiles.java index 6c49967d4d9..b987f7c0081 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestReadWriteSeqIdFiles.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestReadWriteSeqIdFiles.java @@ -26,7 +26,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseCommonTestingUtility; +import org.apache.hadoop.hbase.HBaseCommonTestingUtil; import org.apache.hadoop.hbase.testclassification.RegionServerTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.CommonFSUtils; @@ -47,7 +47,7 @@ public class TestReadWriteSeqIdFiles { private static final Logger LOG = LoggerFactory.getLogger(TestReadWriteSeqIdFiles.class); - private static final HBaseCommonTestingUtility UTIL = new HBaseCommonTestingUtility(); + private static final HBaseCommonTestingUtil UTIL = new HBaseCommonTestingUtil(); private static FileSystem walFS; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSecureWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSecureWAL.java index f317e90e9d5..fc45a140ba2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSecureWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSecureWAL.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -69,7 +69,7 @@ public class TestSecureWAL { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSecureWAL.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Rule public TestName name = new TestName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSyncReplicationWALProvider.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSyncReplicationWALProvider.java index b66bc44466b..d9493feace4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSyncReplicationWALProvider.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestSyncReplicationWALProvider.java @@ -27,7 +27,7 @@ import java.util.Optional; import java.util.function.BiPredicate; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.client.RegionInfo; @@ -57,7 +57,7 @@ public class TestSyncReplicationWALProvider { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestSyncReplicationWALProvider.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static String PEER_ID = "1"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java index 07dd18228ed..5e6f6f9d485 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java @@ -46,7 +46,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -101,7 +101,7 @@ public class TestWALFactory { protected static Configuration conf; private static MiniDFSCluster cluster; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static Path hbaseDir; protected static Path hbaseWALDir; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFiltering.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFiltering.java index 740a989a0b6..b1042e257f0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFiltering.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFiltering.java @@ -25,7 +25,7 @@ import java.util.Random; import java.util.SortedMap; import java.util.TreeMap; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Put; @@ -64,7 +64,7 @@ public class TestWALFiltering { private static final byte[] CF2 = Bytes.toBytes("MyCF2"); private static final byte[][] FAMILIES = { CF1, CF2 }; - private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @Before public void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java index 3da83871246..68bf5d04344 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALMethods.java @@ -30,7 +30,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValueTestUtil; import org.apache.hadoop.hbase.ServerName; @@ -59,7 +59,7 @@ public class TestWALMethods { private static final TableName TEST_TABLE = TableName.valueOf("test_table"); - private final HBaseTestingUtility util = new HBaseTestingUtility(); + private final HBaseTestingUtil util = new HBaseTestingUtil(); @Test public void testServerNameFromWAL() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALOpenAfterDNRollingStart.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALOpenAfterDNRollingStart.java index f958747b3b2..5fa16bc7924 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALOpenAfterDNRollingStart.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALOpenAfterDNRollingStart.java @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL; @@ -49,7 +49,7 @@ public class TestWALOpenAfterDNRollingStart { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWALOpenAfterDNRollingStart.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); // Sleep time before restart next dn, we need to wait the current dn to finish start up private static long DN_RESTART_INTERVAL = 15000; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALReaderOnSecureWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALReaderOnSecureWAL.java index 5471dedb500..924b21a02a0 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALReaderOnSecureWAL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALReaderOnSecureWAL.java @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.ByteBufferKeyValue; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -71,7 +71,7 @@ public class TestWALReaderOnSecureWAL { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWALReaderOnSecureWAL.class); - static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); final byte[] value = Bytes.toBytes("Test value"); private static final String WAL_ENCRYPTION = "hbase.regionserver.wal.encryption"; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALRootDir.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALRootDir.java index 62b17fe4eb3..dc7df65266a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALRootDir.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALRootDir.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -56,7 +56,7 @@ public class TestWALRootDir { HBaseClassTestRule.forClass(TestWALRootDir.class); private static final Logger LOG = LoggerFactory.getLogger(TestWALRootDir.class); - private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private static Configuration conf; private static FileSystem fs; private static FileSystem walFs; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java index fb278fd0e4c..8bfd4dd9530 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java @@ -50,7 +50,7 @@ import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; @@ -111,7 +111,7 @@ public class TestWALSplit { private static Configuration conf; private FileSystem fs; - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); private Path HBASEDIR; private Path HBASELOGDIR; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitToHFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitToHFile.java index 3017e9f2352..8df034cee74 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitToHFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitToHFile.java @@ -40,7 +40,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -90,7 +90,7 @@ public class TestWALSplitToHFile { HBaseClassTestRule.forClass(TestWALSplitToHFile.class); private static final Logger LOG = LoggerFactory.getLogger(AbstractTestWALReplay.class); - static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private final EnvironmentEdge ee = EnvironmentEdgeManager.getDelegate(); private Path rootDir = null; private String logName; @@ -189,8 +189,8 @@ public class TestWALSplitToHFile { final Path tableDir = CommonFSUtils.getTableDir(this.rootDir, tableName); deleteDir(tableDir); FSTableDescriptors.createTableDescriptorForTableDirectory(fs, tableDir, td, false); - HRegion region = HBaseTestingUtility.createRegionAndWAL(ri, rootDir, this.conf, td); - HBaseTestingUtility.closeRegionAndWAL(region); + HRegion region = HBaseTestingUtil.createRegionAndWAL(ri, rootDir, this.conf, td); + HBaseTestingUtil.closeRegionAndWAL(region); return new Pair<>(td, ri); } @@ -430,7 +430,7 @@ public class TestWALSplitToHFile { assertEquals(2 * result.size(), result2.size()); wal2.sync(); final Configuration newConf = HBaseConfiguration.create(this.conf); - User user = HBaseTestingUtility.getDifferentUser(newConf, td.getTableName().getNameAsString()); + User user = HBaseTestingUtil.getDifferentUser(newConf, td.getTableName().getNameAsString()); user.runAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitWithDeletedTableData.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitWithDeletedTableData.java index ce9e653ad4d..123538bb11b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitWithDeletedTableData.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitWithDeletedTableData.java @@ -29,9 +29,9 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Get; @@ -55,7 +55,7 @@ public class TestWALSplitWithDeletedTableData { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule .forClass(TestWALSplitWithDeletedTableData.class); - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setup() throws Exception { @@ -90,7 +90,7 @@ public class TestWALSplitWithDeletedTableData { } tab1.put(puts); tab2.put(puts); - MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); + SingleProcessHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster(); TEST_UTIL.deleteTable(t1); Path tableDir = CommonFSUtils.getWALTableDir(TEST_UTIL.getConfiguration(), t1); // Dropping table 't1' removed the table directory from the WAL FS completely diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWrongMetaWALFileName.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWrongMetaWALFileName.java index f16d2215a07..45f46bb7b32 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWrongMetaWALFileName.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWrongMetaWALFileName.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -44,7 +44,7 @@ public class TestWrongMetaWALFileName { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestWrongMetaWALFileName.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUp() throws Exception { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALCorruptionDueToDanglingByteBufferTestBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALCorruptionDueToDanglingByteBufferTestBase.java index 127ed86f323..57d6e863749 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALCorruptionDueToDanglingByteBufferTestBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALCorruptionDueToDanglingByteBufferTestBase.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.concurrent.CountDownLatch; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Get; @@ -41,7 +41,7 @@ public abstract class WALCorruptionDueToDanglingByteBufferTestBase { private static final Logger LOG = LoggerFactory.getLogger(TestAsyncFSWALCorruptionDueToDanglingByteBuffer.class); - protected static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); protected static CountDownLatch ARRIVE; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java index 6b6175115be..4c34bf0d6b1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java @@ -43,7 +43,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MockRegionServerServices; import org.apache.hadoop.hbase.TableName; @@ -99,7 +99,7 @@ public final class WALPerformanceEvaluation extends Configured implements Tool { private final MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(); - private HBaseTestingUtility TEST_UTIL; + private HBaseTestingUtil TEST_UTIL; static final String TABLE_NAME = "WALPerformanceEvaluation"; static final String QUALIFIER_PREFIX = "q"; @@ -278,7 +278,7 @@ public final class WALPerformanceEvaluation extends Configured implements Tool { getConf().setInt(HConstants.REGION_SERVER_HANDLER_COUNT, numThreads); if (rootRegionDir == null) { - TEST_UTIL = new HBaseTestingUtility(getConf()); + TEST_UTIL = new HBaseTestingUtil(getConf()); rootRegionDir = TEST_UTIL.getDataTestDirOnTestFS("WALPerformanceEvaluation"); } // Run WAL Performance Evaluation diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java index c9cca855748..8fab071defb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java @@ -32,7 +32,7 @@ import javax.security.auth.login.AppConfigurationEntry; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TestZooKeeper; @@ -58,8 +58,8 @@ public class TestZooKeeperACL { HBaseClassTestRule.forClass(TestZooKeeperACL.class); private final static Logger LOG = LoggerFactory.getLogger(TestZooKeeperACL.class); - private final static HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + private final static HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); private static ZKWatcher zkw; private static boolean secureZKAvailable; diff --git a/hbase-shaded/hbase-shaded-testing-util-tester/src/test/java/org/apache/hbase/shaded/TestShadedHBaseTestingUtility.java b/hbase-shaded/hbase-shaded-testing-util-tester/src/test/java/org/apache/hbase/shaded/TestShadedHBaseTestingUtility.java index b18352eb45c..4100e50b519 100644 --- a/hbase-shaded/hbase-shaded-testing-util-tester/src/test/java/org/apache/hbase/shaded/TestShadedHBaseTestingUtility.java +++ b/hbase-shaded/hbase-shaded-testing-util-tester/src/test/java/org/apache/hbase/shaded/TestShadedHBaseTestingUtility.java @@ -21,7 +21,7 @@ package org.apache.hbase.shaded; import static org.junit.Assert.assertEquals; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; @@ -36,7 +36,7 @@ import org.junit.experimental.categories.Category; @Category({ ClientTests.class, MediumTests.class }) public class TestShadedHBaseTestingUtility { - private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @ClassRule public static final HBaseClassTestRule CLASS_RULE = diff --git a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java index a66142ab8ce..e947e03306a 100644 --- a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java +++ b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.security.access.SecureTestUtil; @@ -39,7 +39,7 @@ public abstract class AbstractTestShell { private static final Logger LOG = LoggerFactory.getLogger(AbstractTestShell.class); - protected final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected final static ScriptingContainer jruby = new ScriptingContainer(); protected static void setUpConfig() throws IOException { diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml index 7a96862add7..304d7b8e69e 100644 --- a/hbase-testing-util/pom.xml +++ b/hbase-testing-util/pom.xml @@ -112,6 +112,12 @@ test-jar compile + + com.github.stephenc.findbugs + findbugs-annotations + compile + true + org.slf4j jcl-over-slf4j @@ -186,9 +192,38 @@ + + org.apache.hadoop + hadoop-hdfs + test-jar + compile + + + org.apache.hadoop + hadoop-mapreduce-client-jobclient + test-jar + compile + org.apache.hadoop hadoop-minikdc + compile + + + bouncycastle + bcprov-jdk15 + + + + + org.apache.kerby + kerb-client + compile + + + org.apache.kerby + kerb-simplekdc + compile diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCluster.java similarity index 98% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCluster.java index 2b8602d4ab3..a98bd6e00f5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCluster.java @@ -51,8 +51,11 @@ import org.slf4j.LoggerFactory; * cases from unit tests, or if more control is needed, you can use the subclasses directly. * In that sense, this class does not abstract away every interface that * MiniHBaseCluster or DistributedHBaseCluster provide. + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public +@Deprecated public abstract class HBaseCluster implements Closeable, Configurable { // Log is being used in DistributedHBaseCluster class, hence keeping it as package scope static final Logger LOG = LoggerFactory.getLogger(HBaseCluster.class.getName()); diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java similarity index 97% rename from hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java index 487c926a1bc..7421f3eeff4 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java @@ -38,9 +38,12 @@ import org.slf4j.LoggerFactory; /** * Common helpers for testing HBase that do not depend on specific server/etc. things. - * @see org.apache.hadoop.hbase.HBaseCommonTestingUtility + * @see org.apache.hadoop.hbase.HBaseCommonTestingUtil + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public +@Deprecated public class HBaseCommonTestingUtility { protected static final Logger LOG = LoggerFactory.getLogger(HBaseCommonTestingUtility.class); @@ -197,7 +200,7 @@ public class HBaseCommonTestingUtility { * @param subdir Test subdir name. * @return True if we removed the test dir */ - boolean cleanupTestDir(final String subdir) { + public boolean cleanupTestDir(final String subdir) { if (this.dataTestDir == null) { return false; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java similarity index 98% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 249d33775fe..24ef9389cc8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -17,11 +17,6 @@ */ package org.apache.hadoop.hbase; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import edu.umd.cs.findbugs.annotations.Nullable; import java.io.File; import java.io.IOException; import java.io.OutputStream; @@ -80,11 +75,11 @@ import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.Scan.ReadType; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import org.apache.hadoop.hbase.client.TableState; +import org.apache.hadoop.hbase.client.Scan.ReadType; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; @@ -170,9 +165,11 @@ import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; * avoiding port contention if another local HBase instance is already running). *

To preserve test data directories, pass the system property "hbase.testing.preserve.testdir" * setting it to true. + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public -@SuppressWarnings("deprecation") +@Deprecated public class HBaseTestingUtility extends HBaseZKTestingUtility { /** @@ -316,7 +313,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { * * @param conf The configuration to use for further operations */ - public HBaseTestingUtility(@Nullable Configuration conf) { + public HBaseTestingUtility(Configuration conf) { super(conf); // a hbase checksum verification failure will cause unit tests to fail @@ -2289,12 +2286,15 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { get.setReplicaId(replicaId); get.setConsistency(Consistency.TIMELINE); Result result = table.get(get); - assertTrue(failMsg, result.containsColumn(f, null)); + if (!result.containsColumn(f, null)) { + throw new AssertionError(failMsg); + } assertEquals(failMsg, 1, result.getColumnCells(f, null).size()); Cell cell = result.getColumnLatestCell(f, null); - assertTrue(failMsg, - Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), - cell.getValueLength())); + if (!Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), + cell.getValueLength())) { + throw new AssertionError(failMsg); + } } } @@ -2321,15 +2321,21 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { Result result = region.get(new Get(data)); boolean hasResult = result != null && !result.isEmpty(); - assertEquals(failMsg + result, present, hasResult); + if (present != hasResult) { + throw new AssertionError( + failMsg + result + " expected:<" + present + "> but was:<" + hasResult + ">"); + } if (!present) continue; - assertTrue(failMsg, result.containsColumn(f, null)); + if (!result.containsColumn(f, null)) { + throw new AssertionError(failMsg); + } assertEquals(failMsg, 1, result.getColumnCells(f, null).size()); Cell cell = result.getColumnLatestCell(f, null); - assertTrue(failMsg, - Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), - cell.getValueLength())); + if (!Bytes.equals(data, 0, data.length, cell.getValueArray(), cell.getValueOffset(), + cell.getValueLength())) { + throw new AssertionError(failMsg); + } } } @@ -3050,7 +3056,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { * Returns an Admin instance which is shared between HBaseTestingUtility instance users. * Closing it has no effect, it will be closed automatically when the cluster shutdowns */ - public synchronized Admin getAdmin() throws IOException { + public Admin getAdmin() throws IOException { if (hbaseAdmin == null){ this.hbaseAdmin = getConnection().getAdmin(); } @@ -3201,7 +3207,8 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { } public String explainTableAvailability(TableName tableName) throws IOException { - String msg = explainTableState(tableName, TableState.State.ENABLED) + ", "; + StringBuilder msg = + new StringBuilder(explainTableState(tableName, TableState.State.ENABLED)).append(", "); if (getHBaseCluster().getMaster().isAlive()) { Map assignments = getHBaseCluster().getMaster().getAssignmentManager() .getRegionStates().getRegionAssignments(); @@ -3211,17 +3218,18 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { RegionInfo hri = metaLocation.getFirst(); ServerName sn = metaLocation.getSecond(); if (!assignments.containsKey(hri)) { - msg += ", region " + hri + " not assigned, but found in meta, it expected to be on " + sn; - + msg.append(", region ").append(hri) + .append(" not assigned, but found in meta, it expected to be on ").append(sn); } else if (sn == null) { - msg += ", region " + hri + " assigned, but has no server in meta"; + msg.append(", region ").append(hri).append(" assigned, but has no server in meta"); } else if (!sn.equals(assignments.get(hri))) { - msg += ", region " + hri + " assigned, but has different servers in meta and AM ( " + - sn + " <> " + assignments.get(hri); + msg.append(", region ").append(hri) + .append(" assigned, but has different servers in meta and AM ( ").append(sn) + .append(" <> ").append(assignments.get(hri)); } } } - return msg; + return msg.toString(); } public String explainTableState(final TableName table, TableState.State state) @@ -3237,7 +3245,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { } } - @Nullable public TableState findLastTableState(final TableName table) throws IOException { final AtomicReference lastTableState = new AtomicReference<>(null); ClientMetaTableAccessor.Visitor visitor = new ClientMetaTableAccessor.Visitor() { @@ -3640,7 +3647,9 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { * @return resulting split keys */ public byte[][] getRegionSplitStartKeys(byte[] startKey, byte[] endKey, int numRegions){ - assertTrue(numRegions>3); + if (numRegions <= 3) { + throw new AssertionError(); + } byte [][] tmpSplitKeys = Bytes.split(startKey, endKey, numRegions - 3); byte [][] result = new byte[tmpSplitKeys.length+1][]; System.arraycopy(tmpSplitKeys, 0, result, 1, tmpSplitKeys.length); @@ -3966,14 +3975,11 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { } /** - * Due to async racing issue, a region may not be in - * the online region list of a region server yet, after - * the assignment znode is deleted and the new assignment - * is recorded in master. + * Due to async racing issue, a region may not be in the online region list of a region server + * yet, after the assignment znode is deleted and the new assignment is recorded in master. */ - public void assertRegionOnServer( - final RegionInfo hri, final ServerName server, - final long timeout) throws IOException, InterruptedException { + public void assertRegionOnServer(final RegionInfo hri, final ServerName server, + final long timeout) throws IOException, InterruptedException { long timeoutTime = EnvironmentEdgeManager.currentTime() + timeout; while (true) { List regions = getAdmin().getRegions(server); @@ -3982,8 +3988,8 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { if (now > timeoutTime) break; Thread.sleep(10); } - fail("Could not find region " + hri.getRegionNameAsString() - + " on server " + server); + throw new AssertionError( + "Could not find region " + hri.getRegionNameAsString() + " on server " + server); } /** @@ -4006,8 +4012,9 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { } Collection hrs = rs.getOnlineRegionsLocalContext(); for (HRegion r: hrs) { - assertTrue("Region should not be double assigned", - r.getRegionInfo().getRegionId() != hri.getRegionId()); + if (r.getRegionInfo().getRegionId() == hri.getRegionId()) { + throw new AssertionError("Region should not be double assigned"); + } } } return; // good, we are happy @@ -4016,8 +4023,8 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { if (now > timeoutTime) break; Thread.sleep(10); } - fail("Could not find region " + hri.getRegionNameAsString() - + " on server " + server); + throw new AssertionError( + "Could not find region " + hri.getRegionNameAsString() + " on server " + server); } public HRegion createTestRegion(String tableName, ColumnFamilyDescriptor cd) throws IOException { @@ -4035,7 +4042,7 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { return createRegionAndWAL(info, getDataTestDir(), getConfiguration(), td, blockCache); } - public void setFileSystemURI(String fsURI) { + public static void setFileSystemURI(String fsURI) { FS_URI = fsURI; } @@ -4313,15 +4320,28 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { return numHFiles; } + private void assertEquals(String message, int expected, int actual) { + if (expected == actual) { + return; + } + String formatted = ""; + if (message != null && !"".equals(message)) { + formatted = message + " "; + } + throw new AssertionError(formatted + "expected:<" + expected + "> but was:<" + actual + ">"); + } + public void verifyTableDescriptorIgnoreTableName(TableDescriptor ltd, TableDescriptor rtd) { - assertEquals(ltd.getValues().hashCode(), rtd.getValues().hashCode()); + if (ltd.getValues().hashCode() != rtd.getValues().hashCode()) { + throw new AssertionError(); + } + assertEquals("", ltd.getValues().hashCode(), rtd.getValues().hashCode()); Collection ltdFamilies = Arrays.asList(ltd.getColumnFamilies()); Collection rtdFamilies = Arrays.asList(rtd.getColumnFamilies()); - assertEquals(ltdFamilies.size(), rtdFamilies.size()); - for (Iterator it = ltdFamilies.iterator(), it2 = - rtdFamilies.iterator(); it.hasNext();) { - assertEquals(0, - ColumnFamilyDescriptor.COMPARATOR.compare(it.next(), it2.next())); + assertEquals("", ltdFamilies.size(), rtdFamilies.size()); + for (Iterator it = ltdFamilies.iterator(), + it2 = rtdFamilies.iterator(); it.hasNext();) { + assertEquals("", 0, ColumnFamilyDescriptor.COMPARATOR.compare(it.next(), it2.next())); } } diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java similarity index 97% rename from hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java index dd8b3909d6d..7d81278000a 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseZKTestingUtility.java @@ -19,7 +19,6 @@ package org.apache.hadoop.hbase; import java.io.File; import java.io.IOException; - import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster; @@ -29,8 +28,11 @@ import org.apache.yetus.audience.InterfaceAudience; /** * Helpers for testing HBase that do not depend on specific server/etc. things. The main difference * from {@link HBaseCommonTestingUtility} is that we can start a zookeeper cluster. + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public +@Deprecated public class HBaseZKTestingUtility extends HBaseCommonTestingUtility { private MiniZooKeeperCluster zkCluster; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/MiniHBaseCluster.java similarity index 99% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/MiniHBaseCluster.java index 990867eadb2..f8dce256386 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -50,8 +50,11 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProto * each server. The master uses the 'default' FileSystem. The RegionServers, * if we are running on DistributedFilesystem, create a FileSystem instance * each and will close down their instance on the way out. + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public +@Deprecated public class MiniHBaseCluster extends HBaseCluster { private static final Logger LOG = LoggerFactory.getLogger(MiniHBaseCluster.class.getName()); public LocalHBaseCluster hbaseCluster; @@ -504,7 +507,6 @@ public class MiniHBaseCluster extends HBaseCluster { /** * Suspend the specified region server * @param serverNumber Used as index into a list. - * @return */ public JVMClusterUtil.RegionServerThread suspendRegionServer(int serverNumber) { JVMClusterUtil.RegionServerThread server = @@ -517,7 +519,6 @@ public class MiniHBaseCluster extends HBaseCluster { /** * Resume the specified region server * @param serverNumber Used as index into a list. - * @return */ public JVMClusterUtil.RegionServerThread resumeRegionServer(int serverNumber) { JVMClusterUtil.RegionServerThread server = @@ -543,6 +544,9 @@ public class MiniHBaseCluster extends HBaseCluster { * * @return New RegionServerThread */ + @edu.umd.cs.findbugs.annotations.SuppressWarnings( + value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", + justification = "Testing only, not a big deal") public JVMClusterUtil.MasterThread startMaster() throws IOException { Configuration c = HBaseConfiguration.create(conf); User user = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/StartMiniClusterOption.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/StartMiniClusterOption.java similarity index 98% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/StartMiniClusterOption.java rename to hbase-testing-util/src/main/java/org/apache/hadoop/hbase/StartMiniClusterOption.java index 7a9bd68c6d8..2d839958c74 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/StartMiniClusterOption.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/StartMiniClusterOption.java @@ -20,7 +20,6 @@ package org.apache.hadoop.hbase; import java.util.Arrays; import java.util.List; - import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.master.HMaster; import org.apache.yetus.audience.InterfaceAudience; @@ -38,8 +37,11 @@ import org.apache.yetus.audience.InterfaceAudience; * * * Default values can be found in {@link Builder}. + * @deprecated since 3.0.0, will be removed in 4.0.0. Use + * {@link org.apache.hadoop.hbase.testing.TestingHBaseCluster} instead. */ @InterfaceAudience.Public +@Deprecated public final class StartMiniClusterOption { /** * Number of masters to start up. We'll start this many hbase masters. If numMasters > 1, you diff --git a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java index 591aaa82325..e2c42616091 100644 --- a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java @@ -22,9 +22,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; import org.apache.yetus.audience.InterfaceAudience; @@ -35,9 +35,9 @@ import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFacto @InterfaceAudience.Private class TestingHBaseClusterImpl implements TestingHBaseCluster { - private final HBaseTestingUtility util = new HBaseTestingUtility(); + private final HBaseTestingUtil util = new HBaseTestingUtil(); - private final StartMiniClusterOption option; + private final StartTestingClusterOption option; private final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder() .setNameFormat(getClass().getSuperclass() + "-%d").setDaemon(true).build()); diff --git a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterOption.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterOption.java index ce7daac2d19..6ca36e8b63b 100644 --- a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterOption.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterOption.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.testing; import java.util.Arrays; import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.apache.hadoop.hbase.StartMiniClusterOption; +import org.apache.hadoop.hbase.StartTestingClusterOption; import org.apache.yetus.audience.InterfaceAudience; /** @@ -156,8 +156,8 @@ public final class TestingHBaseClusterOption { /** * Convert to the internal option. Not for public use so package private. */ - StartMiniClusterOption convert() { - return StartMiniClusterOption.builder().numMasters(numMasters) + StartTestingClusterOption convert() { + return StartTestingClusterOption.builder().numMasters(numMasters) .numAlwaysStandByMasters(numAlwaysStandByMasters).numRegionServers(numRegionServers) .rsPorts(rsPorts).numDataNodes(numDataNodes).dataNodeHosts(dataNodeHosts) .numZkServers(numZkServers).createRootDir(createRootDir).createWALDir(createWALDir).build(); diff --git a/hbase-testing-util/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtilSpinup.java b/hbase-testing-util/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtilSpinup.java index 4ea4fc54cff..dc3ac4699c0 100644 --- a/hbase-testing-util/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtilSpinup.java +++ b/hbase-testing-util/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtilSpinup.java @@ -23,7 +23,6 @@ import java.util.List; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MiscTests; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -43,7 +42,7 @@ public class TestHBaseTestingUtilSpinup { HBaseClassTestRule.forClass(TestHBaseTestingUtilSpinup.class); private static final Logger LOG = LoggerFactory.getLogger(TestHBaseTestingUtilSpinup.class); - private final static HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private final static HBaseTestingUtil UTIL = new HBaseTestingUtil(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java index 49bbf8c6111..c34cf7e5c6d 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.thrift.ThriftMetrics.ThriftServerType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,11 +49,11 @@ public class HBaseThriftTestingUtility { */ public void startThriftServer(Configuration conf, ThriftServerType type) throws Exception { List args = new ArrayList<>(); - port = HBaseTestingUtility.randomFreePort(); + port = HBaseTestingUtil.randomFreePort(); args.add("-" + Constants.PORT_OPTION); args.add(String.valueOf(port)); args.add("-" + INFOPORT_OPTION); - int infoPort = HBaseTestingUtility.randomFreePort(); + int infoPort = HBaseTestingUtil.randomFreePort(); args.add(String.valueOf(infoPort)); LOG.info("Starting Thrift Server {} on port: {} ", type, port); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java index f5bc2141b5f..e28929675ba 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestBindExceptionHandling.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.thrift; import static org.junit.Assert.assertNotNull; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.junit.ClassRule; @@ -33,7 +33,7 @@ public class TestBindExceptionHandling { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestBindExceptionHandling.class); - private static final HBaseTestingUtility HTU = new HBaseTestingUtility(); + private static final HBaseTestingUtil HTU = new HBaseTestingUtil(); /** * See if random port choosing works around protocol port clashes diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestCallQueue.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestCallQueue.java index 955b4ca9c99..da84bffe16d 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestCallQueue.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestCallQueue.java @@ -23,7 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.test.MetricsAssertHelper; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.SmallTests; @@ -49,7 +49,7 @@ public class TestCallQueue { HBaseClassTestRule.forClass(TestCallQueue.class); private static final Logger LOG = LoggerFactory.getLogger(TestCallQueue.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final MetricsAssertHelper metricsHelper = CompatibilitySingletonFactory.getInstance(MetricsAssertHelper.class); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java index c2911719597..b426cd15b2c 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java @@ -27,7 +27,7 @@ import java.net.URL; import java.util.function.Supplier; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -66,7 +66,7 @@ public class TestThriftHttpServer { private static final Logger LOG = LoggerFactory.getLogger(TestThriftHttpServer.class); - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java index 9b3182a09b9..a6049af3e6b 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java @@ -36,7 +36,7 @@ import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -93,7 +93,7 @@ public class TestThriftServer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestThriftServer.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); private static final Logger LOG = LoggerFactory.getLogger(TestThriftServer.class); private static final MetricsAssertHelper metricsHelper = CompatibilityFactory .getInstance(MetricsAssertHelper.class); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java index d9bcc869777..43b630ed950 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java @@ -32,7 +32,7 @@ import java.util.Collection; import java.util.List; import java.util.function.Supplier; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.net.BoundSocketMaker; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -81,8 +81,8 @@ public class TestThriftServerCmdLine { protected boolean specifyBindIP; protected boolean specifyCompact; - protected static final HBaseTestingUtility TEST_UTIL = - new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = + new HBaseTestingUtil(); @Parameters public static Collection getParameters() { @@ -145,7 +145,7 @@ public class TestThriftServerCmdLine { } static int getRandomPort() { - return HBaseTestingUtility.randomFreePort(); + return HBaseTestingUtil.randomFreePort(); } protected Supplier getThriftServerSupplier() { diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpFallbackServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpFallbackServer.java index 8da3c6869b3..20470f9d39a 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpFallbackServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpFallbackServer.java @@ -31,7 +31,7 @@ import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.security.HBaseKerberosUtils; import org.apache.hadoop.hbase.testclassification.ClientTests; @@ -114,7 +114,7 @@ public class TestThriftSpnegoHttpFallbackServer extends TestThriftHttpServer { public static void setUpBeforeClass() throws Exception { kdc = SimpleKdcServerUtil. getRunningSimpleKdcServer(new File(TEST_UTIL.getDataTestDir().toString()), - HBaseTestingUtility::randomFreePort); + HBaseTestingUtil::randomFreePort); File keytabDir = Paths.get(TEST_UTIL.getRandomDir().toString()).toAbsolutePath().toFile(); assertTrue(keytabDir.mkdirs()); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpServer.java index 9b54244157f..2ec903df6df 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftSpnegoHttpServer.java @@ -34,7 +34,7 @@ import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.security.HBaseKerberosUtils; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; @@ -115,7 +115,7 @@ public class TestThriftSpnegoHttpServer extends TestThriftHttpServer { public static void setUpBeforeClass() throws Exception { kdc = SimpleKdcServerUtil. getRunningSimpleKdcServer(new File(TEST_UTIL.getDataTestDir().toString()), - HBaseTestingUtility::randomFreePort); + HBaseTestingUtil::randomFreePort); File keytabDir = Paths.get(TEST_UTIL.getRandomDir().toString()).toAbsolutePath().toFile(); Assert.assertTrue(keytabDir.mkdirs()); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java index 0accb6bc21f..2eb1e4c8fbb 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.TableName; @@ -104,7 +104,7 @@ public class TestThriftConnection { private static final long TS_1 = TS_2 - ONE_HOUR; - protected static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); + protected static final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); protected static ThriftServer thriftServer; @@ -165,8 +165,8 @@ public class TestThriftConnection { // Do not start info server TEST_UTIL.getConfiguration().setInt(THRIFT_INFO_SERVER_PORT , -1); TEST_UTIL.startMiniCluster(); - thriftPort = HBaseTestingUtility.randomFreePort(); - httpPort = HBaseTestingUtility.randomFreePort(); + thriftPort = HBaseTestingUtil.randomFreePort(); + httpPort = HBaseTestingUtil.randomFreePort(); // Start a thrift server thriftServer = startThriftServer(thriftPort, false); // Start an HTTP thrift server diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java index 4544894a657..7ca00f122eb 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java @@ -53,7 +53,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -149,7 +149,7 @@ public class TestThriftHBaseServiceHandler { HBaseClassTestRule.forClass(TestThriftHBaseServiceHandler.class); private static final Logger LOG = LoggerFactory.getLogger(TestThriftHBaseServiceHandler.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // Static names for tables, columns, rows, and values private static byte[] tableAname = Bytes.toBytes("tableA"); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java index 0d6b6eb18a0..eceaf482b7e 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithLabels.java @@ -33,7 +33,7 @@ import java.util.Comparator; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -86,7 +86,7 @@ public class TestThriftHBaseServiceHandlerWithLabels { private static final Logger LOG = LoggerFactory .getLogger(TestThriftHBaseServiceHandlerWithLabels.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // Static names for tables, columns, rows, and values private static byte[] tableAname = Bytes.toBytes("tableA"); diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithReadOnly.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithReadOnly.java index 0aee78b27a0..7fa905d3557 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithReadOnly.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandlerWithReadOnly.java @@ -30,7 +30,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HBaseTestingUtil; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; @@ -68,7 +68,7 @@ public class TestThriftHBaseServiceHandlerWithReadOnly { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestThriftHBaseServiceHandlerWithReadOnly.class); - private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final HBaseTestingUtil UTIL = new HBaseTestingUtil(); // Static names for tables, columns, rows, and values private static byte[] tableAname = Bytes.toBytes("tableA"); diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtil.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtil.java new file mode 100644 index 00000000000..acc5f144bec --- /dev/null +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/HBaseZKTestingUtil.java @@ -0,0 +1,211 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase; + +import java.io.File; +import java.io.IOException; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster; +import org.apache.hadoop.hbase.zookeeper.ZKWatcher; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.yetus.audience.InterfaceStability; + +/** + * Helpers for testing HBase that do not depend on specific server/etc. things. The main difference + * from {@link HBaseCommonTestingUtil} is that we can start a zookeeper cluster. + */ +@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX) +@InterfaceStability.Evolving +public class HBaseZKTestingUtil extends HBaseCommonTestingUtil { + private MiniZooKeeperCluster zkCluster; + + /** + * Set if we were passed a zkCluster. If so, we won't shutdown zk as part of general shutdown. + */ + private boolean passedZkCluster; + + protected ZKWatcher zooKeeperWatcher; + + /** Directory (a subdirectory of dataTestDir) used by the dfs cluster if any */ + protected File clusterTestDir; + + public HBaseZKTestingUtil() { + this(HBaseConfiguration.create()); + } + + public HBaseZKTestingUtil(Configuration conf) { + super(conf); + } + + /** + * @return Where the cluster will write data on the local subsystem. Creates it if it does not + * exist already. A subdir of {@code HBaseCommonTestingUtility#getBaseTestDir()} + */ + Path getClusterTestDir() { + if (clusterTestDir == null) { + setupClusterTestDir(); + } + return new Path(clusterTestDir.getAbsolutePath()); + } + + /** + * Creates a directory for the cluster, under the test data + */ + protected void setupClusterTestDir() { + if (clusterTestDir != null) { + return; + } + + // Using randomUUID ensures that multiple clusters can be launched by + // a same test, if it stops & starts them + Path testDir = getDataTestDir("cluster_" + getRandomUUID().toString()); + clusterTestDir = new File(testDir.toString()).getAbsoluteFile(); + // Have it cleaned up on exit + boolean b = deleteOnExit(); + if (b) { + clusterTestDir.deleteOnExit(); + } + LOG.info("Created new mini-cluster data directory: " + clusterTestDir + ", deleteOnExit=" + b); + } + + /** + * Call this if you only want a zk cluster. + * @see #shutdownMiniZKCluster() + * @return zk cluster started. + */ + public MiniZooKeeperCluster startMiniZKCluster() throws Exception { + return startMiniZKCluster(1); + } + + /** + * Call this if you only want a zk cluster. + * @see #shutdownMiniZKCluster() + * @return zk cluster started. + */ + public MiniZooKeeperCluster startMiniZKCluster(int zooKeeperServerNum, int... clientPortList) + throws Exception { + setupClusterTestDir(); + return startMiniZKCluster(clusterTestDir, zooKeeperServerNum, clientPortList); + } + + /** + * Start a mini ZK cluster. If the property "test.hbase.zookeeper.property.clientPort" is set the + * port mentioned is used as the default port for ZooKeeper. + */ + private MiniZooKeeperCluster startMiniZKCluster(File dir, int zooKeeperServerNum, + int[] clientPortList) throws Exception { + if (this.zkCluster != null) { + throw new IOException("Cluster already running at " + dir); + } + this.passedZkCluster = false; + this.zkCluster = new MiniZooKeeperCluster(this.getConfiguration()); + int defPort = this.conf.getInt("test.hbase.zookeeper.property.clientPort", 0); + if (defPort > 0) { + // If there is a port in the config file, we use it. + this.zkCluster.setDefaultClientPort(defPort); + } + + if (clientPortList != null) { + // Ignore extra client ports + int clientPortListSize = Math.min(clientPortList.length, zooKeeperServerNum); + for (int i = 0; i < clientPortListSize; i++) { + this.zkCluster.addClientPort(clientPortList[i]); + } + } + int clientPort = this.zkCluster.startup(dir, zooKeeperServerNum); + this.conf.set(HConstants.ZOOKEEPER_CLIENT_PORT, Integer.toString(clientPort)); + return this.zkCluster; + } + + public MiniZooKeeperCluster getZkCluster() { + return zkCluster; + } + + public void setZkCluster(MiniZooKeeperCluster zkCluster) { + this.passedZkCluster = true; + this.zkCluster = zkCluster; + conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkCluster.getClientPort()); + } + + /** + * Shuts down zk cluster created by call to {@link #startMiniZKCluster()} or does nothing. + * @see #startMiniZKCluster() + */ + public void shutdownMiniZKCluster() throws IOException { + if (!passedZkCluster && this.zkCluster != null) { + this.zkCluster.shutdown(); + this.zkCluster = null; + } + } + + /** + * Returns a ZKWatcher instance. This instance is shared between HBaseTestingUtility instance + * users. Don't close it, it will be closed automatically when the cluster shutdowns + * @return The ZKWatcher instance. + */ + public synchronized ZKWatcher getZooKeeperWatcher() throws IOException { + if (zooKeeperWatcher == null) { + zooKeeperWatcher = new ZKWatcher(conf, "testing utility", new Abortable() { + @Override + public void abort(String why, Throwable e) { + throw new RuntimeException("Unexpected abort in HBaseZKTestingUtility:" + why, e); + } + + @Override + public boolean isAborted() { + return false; + } + }); + } + return zooKeeperWatcher; + } + + /** + * Gets a ZKWatcher. + */ + public static ZKWatcher getZooKeeperWatcher(HBaseZKTestingUtil testUtil) throws IOException { + return new ZKWatcher(testUtil.getConfiguration(), "unittest", new Abortable() { + boolean aborted = false; + + @Override + public void abort(String why, Throwable e) { + aborted = true; + throw new RuntimeException("Fatal ZK error, why=" + why, e); + } + + @Override + public boolean isAborted() { + return aborted; + } + }); + } + + /** + * @return True if we removed the test dirs + */ + @Override + public boolean cleanupTestDir() { + boolean ret = super.cleanupTestDir(); + if (deleteDir(this.clusterTestDir)) { + this.clusterTestDir = null; + return ret; + } + return false; + } +} diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java index c98e532bdec..97e1279af13 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.testclassification.ZKTests; @@ -46,7 +46,7 @@ public class TestHQuorumPeer { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestHQuorumPeer.class); - private static final HBaseZKTestingUtility TEST_UTIL = new HBaseZKTestingUtility(); + private static final HBaseZKTestingUtil TEST_UTIL = new HBaseZKTestingUtil(); private static int PORT_NO = 21818; private Path dataDir; diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestReadOnlyZKClient.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestReadOnlyZKClient.java index a6d9c0f4732..108fdf887f4 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestReadOnlyZKClient.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestReadOnlyZKClient.java @@ -46,7 +46,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -70,7 +70,7 @@ public class TestReadOnlyZKClient { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestReadOnlyZKClient.class); - private static HBaseZKTestingUtility UTIL = new HBaseZKTestingUtility(); + private static HBaseZKTestingUtil UTIL = new HBaseZKTestingUtil(); private static String PATH = "/test"; diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestRecoverableZooKeeper.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestRecoverableZooKeeper.java index 781de88831a..7e0a4132954 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestRecoverableZooKeeper.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestRecoverableZooKeeper.java @@ -24,7 +24,7 @@ import java.lang.reflect.Field; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.ZKTests; @@ -47,7 +47,7 @@ public class TestRecoverableZooKeeper { public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestRecoverableZooKeeper.class); - private final static HBaseZKTestingUtility TEST_UTIL = new HBaseZKTestingUtility(); + private final static HBaseZKTestingUtil TEST_UTIL = new HBaseZKTestingUtil(); private Abortable abortable = new Abortable() { @Override diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java index eef310b77bc..08f12481d01 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKLeaderManager.java @@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.log.HBaseMarkers; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -132,12 +132,12 @@ public class TestZKLeaderManager { } } - private static HBaseZKTestingUtility TEST_UTIL; + private static HBaseZKTestingUtil TEST_UTIL; private static MockLeader[] CANDIDATES; @BeforeClass public static void setupBeforeClass() throws Exception { - TEST_UTIL = new HBaseZKTestingUtility(); + TEST_UTIL = new HBaseZKTestingUtil(); TEST_UTIL.startMiniZKCluster(); Configuration conf = TEST_UTIL.getConfiguration(); diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMainServer.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMainServer.java index 0fda614e624..ad69c85cf73 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMainServer.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMainServer.java @@ -23,7 +23,7 @@ import java.security.Permission; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.testclassification.ZKTests; @@ -72,7 +72,7 @@ public class TestZKMainServer { @Test public void testCommandLineWorks() throws Exception { System.setSecurityManager(new NoExitSecurityManager()); - HBaseZKTestingUtility htu = new HBaseZKTestingUtility(); + HBaseZKTestingUtil htu = new HBaseZKTestingUtil(); // Make it long so for sure succeeds. htu.getConfiguration().setInt(HConstants.ZK_SESSION_TIMEOUT, 30000); htu.startMiniZKCluster(); diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMulti.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMulti.java index 602eff87acd..83e11ae16aa 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMulti.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMulti.java @@ -30,7 +30,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.ZKTests; import org.apache.hadoop.hbase.util.Bytes; @@ -57,7 +57,7 @@ public class TestZKMulti { HBaseClassTestRule.forClass(TestZKMulti.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKMulti.class); - private final static HBaseZKTestingUtility TEST_UTIL = new HBaseZKTestingUtility(); + private final static HBaseZKTestingUtil TEST_UTIL = new HBaseZKTestingUtil(); private static ZKWatcher zkw = null; private static class ZKMultiAbortable implements Abortable { diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKNodeTracker.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKNodeTracker.java index d8cf3c93a50..48c42f5b4c4 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKNodeTracker.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKNodeTracker.java @@ -28,7 +28,7 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.ThreadLocalRandom; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.testclassification.MediumTests; @@ -53,7 +53,7 @@ public class TestZKNodeTracker { HBaseClassTestRule.forClass(TestZKNodeTracker.class); private static final Logger LOG = LoggerFactory.getLogger(TestZKNodeTracker.class); - private final static HBaseZKTestingUtility TEST_UTIL = new HBaseZKTestingUtility(); + private final static HBaseZKTestingUtil TEST_UTIL = new HBaseZKTestingUtil(); @BeforeClass public static void setUpBeforeClass() throws Exception { diff --git a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKUtil.java b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKUtil.java index cbdd0182bf2..21b4b64f61b 100644 --- a/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKUtil.java +++ b/hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKUtil.java @@ -28,7 +28,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseZKTestingUtility; +import org.apache.hadoop.hbase.HBaseZKTestingUtil; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.ZKTests; import org.apache.hadoop.hbase.util.Bytes; @@ -59,7 +59,7 @@ public class TestZKUtil { private static final Logger LOG = LoggerFactory.getLogger(TestZKUtil.class); - private static HBaseZKTestingUtility UTIL = new HBaseZKTestingUtility(); + private static HBaseZKTestingUtil UTIL = new HBaseZKTestingUtil(); private static ZKWatcher ZKW;