diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMobCompaction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMobCompaction.java index 093f9e49816..5fb9bb0a4c4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMobCompaction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestMobCompaction.java @@ -124,7 +124,7 @@ public class IntegrationTestMobCompaction extends IntegrationTestBase { private void createTestTable() throws IOException { // Create test table - hdt = util.createTableDescriptor("testMobCompactTable"); + hdt = util.createTableDescriptor(TableName.valueOf("testMobCompactTable")); hcd = new HColumnDescriptor(fam); hcd.setMobEnabled(true); hcd.setMobThreshold(mobLen); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 3f2e8c73c1b..c1b4db2a3b2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -1893,21 +1893,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { 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); - /** - * Create a table of name name. - * @param name Name to give table. - * @return Column descriptor. - * @deprecated since 2.0.0 and will be removed in 3.0.0. Use - * {@link #createTableDescriptor(TableName, int, int, int, KeepDeletedCells)} instead. - * @see #createTableDescriptor(TableName, int, int, int, KeepDeletedCells) - * @see HBASE-13893 - */ - @Deprecated - public HTableDescriptor createTableDescriptor(final String name) { - return createTableDescriptor(TableName.valueOf(name), HColumnDescriptor.DEFAULT_MIN_VERSIONS, - MAXVERSIONS, HConstants.FOREVER, HColumnDescriptor.DEFAULT_KEEP_DELETED); - } - public HTableDescriptor createTableDescriptor(final TableName name, final int minVersions, final int versions, final int ttl, KeepDeletedCells keepDeleted) { HTableDescriptor htd = new HTableDescriptor(name); 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 674d3351015..6941d0490a1 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 @@ -237,7 +237,9 @@ public class TestFromClientSide { */ @Test public void testDuplicateAppend() throws Exception { - HTableDescriptor hdt = TEST_UTIL.createTableDescriptor(name.getTableName()); + HTableDescriptor hdt = TEST_UTIL.createTableDescriptor(name.getTableName(), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); Map kvs = new HashMap<>(); kvs.put(SleepAtFirstRpcCall.SLEEP_TIME_CONF_KEY, "2000"); hdt.addCoprocessor(SleepAtFirstRpcCall.class.getName(), null, 1, kvs); 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 c1625faae6d..47326e9f542 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 @@ -278,7 +278,9 @@ public class TestReplicaWithCluster { @Test public void testCreateDeleteTable() throws IOException { // Create table then get the single region for our new table. - HTableDescriptor hdt = HTU.createTableDescriptor("testCreateDeleteTable"); + HTableDescriptor hdt = HTU.createTableDescriptor(TableName.valueOf("testCreateDeleteTable"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); hdt.addCoprocessor(SlowMeCopro.class.getName()); Table table = HTU.createTable(hdt, new byte[][]{f}, null); @@ -370,7 +372,9 @@ public class TestReplicaWithCluster { @SuppressWarnings("deprecation") @Test public void testReplicaAndReplication() throws Exception { - HTableDescriptor hdt = HTU.createTableDescriptor("testReplicaAndReplication"); + HTableDescriptor hdt = HTU.createTableDescriptor(TableName.valueOf("testReplicaAndReplication"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); HColumnDescriptor fam = new HColumnDescriptor(row); @@ -456,7 +460,9 @@ public class TestReplicaWithCluster { public void testBulkLoad() throws IOException { // Create table then get the single region for our new table. LOG.debug("Creating test table"); - HTableDescriptor hdt = HTU.createTableDescriptor("testBulkLoad"); + HTableDescriptor hdt = HTU.createTableDescriptor(TableName.valueOf("testBulkLoad"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); hdt.addCoprocessor(SlowMeCopro.class.getName()); Table table = HTU.createTable(hdt, new byte[][]{f}, null); @@ -512,7 +518,9 @@ public class TestReplicaWithCluster { @Test public void testReplicaGetWithPrimaryDown() throws IOException { // Create table then get the single region for our new table. - HTableDescriptor hdt = HTU.createTableDescriptor("testCreateDeleteTable"); + HTableDescriptor hdt = HTU.createTableDescriptor(TableName.valueOf("testCreateDeleteTable"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); hdt.addCoprocessor(RegionServerStoppedCopro.class.getName()); try { @@ -546,7 +554,9 @@ public class TestReplicaWithCluster { @Test public void testReplicaScanWithPrimaryDown() throws IOException { // Create table then get the single region for our new table. - HTableDescriptor hdt = HTU.createTableDescriptor("testCreateDeleteTable"); + HTableDescriptor hdt = HTU.createTableDescriptor(TableName.valueOf("testCreateDeleteTable"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); hdt.addCoprocessor(RegionServerStoppedCopro.class.getName()); @@ -593,7 +603,10 @@ public class TestReplicaWithCluster { HTU.getConfiguration().set( "hbase.rpc.client.impl", "org.apache.hadoop.hbase.ipc.AsyncRpcClient"); // Create table then get the single region for our new table. - HTableDescriptor hdt = HTU.createTableDescriptor("testReplicaGetWithAsyncRpcClientImpl"); + HTableDescriptor hdt = HTU.createTableDescriptor( + TableName.valueOf("testReplicaGetWithAsyncRpcClientImpl"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.setRegionReplication(NB_SERVERS); hdt.addCoprocessor(SlowMeCopro.class.getName()); 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 d77be249f74..28e2ec60405 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 @@ -31,6 +31,7 @@ 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.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; @@ -196,7 +197,10 @@ public class TestReplicasClient { HTU.startMiniCluster(option); // Create table then get the single region for our new table. - HTableDescriptor hdt = HTU.createTableDescriptor(TestReplicasClient.class.getSimpleName()); + HTableDescriptor hdt = HTU.createTableDescriptor( + TableName.valueOf(TestReplicasClient.class.getSimpleName()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hdt.addCoprocessor(SlowMeCopro.class.getName()); HTU.createTable(hdt, new byte[][]{f}, null); TABLE_NAME = hdt.getTableName(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionBase.java index 2d9268c17de..f58e7f76e9a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionBase.java @@ -94,7 +94,7 @@ public abstract class TestMobCompactionBase { @Before public void setUp() throws Exception { HTU = new HBaseTestingUtility(); - hdt = HTU.createTableDescriptor(getClass().getName()); + hdt = HTU.createTableDescriptor(TableName.valueOf(getClass().getName())); conf = HTU.getConfiguration(); initConf(); 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 7e18f45bea3..d83bbb63a65 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 @@ -28,6 +28,8 @@ 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.HColumnDescriptor; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; @@ -88,7 +90,9 @@ public class TestMobFileCache { conf = UTIL.getConfiguration(); conf.set(MobConstants.MOB_FILE_CACHE_SIZE_KEY, TEST_CACHE_SIZE); TableDescriptorBuilder tableDescriptorBuilder = - TableDescriptorBuilder.newBuilder(UTIL.createTableDescriptor("testMobFileCache")); + TableDescriptorBuilder.newBuilder(UTIL.createTableDescriptor( + TableName.valueOf("testMobFileCache"), HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, + HConstants.FOREVER, HColumnDescriptor.DEFAULT_KEEP_DELETED)); ColumnFamilyDescriptor columnFamilyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(FAMILY1)) .setMobEnabled(true) 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 9e9970dfb19..59de79b3ffa 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 @@ -91,7 +91,7 @@ public class TestMobFileCleanerChore { @Before public void setUp() throws Exception { HTU = new HBaseTestingUtility(); - hdt = HTU.createTableDescriptor("testMobCompactTable"); + hdt = HTU.createTableDescriptor(TableName.valueOf("testMobCompactTable")); conf = HTU.getConfiguration(); initConf(); 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 99dd65312d2..91faeee224b 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 @@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Delete; @@ -115,7 +116,9 @@ public class TestMobStoreCompaction { HBaseTestingUtility UTIL = new HBaseTestingUtility(conf); compactionThreshold = conf.getInt("hbase.hstore.compactionThreshold", 3); - htd = UTIL.createTableDescriptor(name.getMethodName()); + htd = UTIL.createTableDescriptor(TableName.valueOf(name.getMethodName()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); hcd = new HColumnDescriptor(COLUMN_FAMILY); hcd.setMobEnabled(true); hcd.setMobThreshold(mobThreshold); 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 fa3e884c9f7..da94e966dab 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 @@ -51,6 +51,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.client.Put; @@ -126,7 +127,9 @@ public class TestCompaction { @Before public void setUp() throws Exception { - this.htd = UTIL.createTableDescriptor(name.getMethodName()); + this.htd = UTIL.createTableDescriptor(TableName.valueOf(name.getMethodName()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); if (name.getMethodName().equals("testCompactionSeqId")) { UTIL.getConfiguration().set("hbase.hstore.compaction.kv.max", "10"); UTIL.getConfiguration().set( 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 a89981f1b74..7db7741ce2f 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 @@ -39,9 +39,11 @@ import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeepDeletedCells; +import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Result; @@ -120,7 +122,10 @@ public class TestMajorCompaction { @Before public void setUp() throws Exception { - this.htd = UTIL.createTableDescriptor(name.getMethodName().replace('[','i').replace(']','i')); + this.htd = UTIL.createTableDescriptor( + TableName.valueOf(name.getMethodName().replace('[','i').replace(']','i')), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); this.r = UTIL.createLocalHRegion(htd, null, null); } 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 f08b7a99acc..2c3c010806d 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 @@ -26,8 +26,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Result; @@ -89,7 +91,9 @@ public class TestMinorCompaction { @Before public void setUp() throws Exception { - this.htd = UTIL.createTableDescriptor(name.getMethodName()); + this.htd = UTIL.createTableDescriptor(TableName.valueOf(name.getMethodName()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); this.r = UTIL.createLocalHRegion(htd, null, null); } 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 5cf19795c24..8907c8c98df 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,6 +26,7 @@ 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.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; @@ -93,7 +94,9 @@ public class TestRegionReplicaFailover { HTU.startMiniCluster(NB_SERVERS); htd = HTU.createTableDescriptor( - name.getMethodName().substring(0, name.getMethodName().length()-3)); + TableName.valueOf(name.getMethodName().substring(0, name.getMethodName().length()-3)), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(3); HTU.getAdmin().createTable(htd); } @@ -327,7 +330,9 @@ public class TestRegionReplicaFailover { int numRegions = NB_SERVERS * 20; int regionReplication = 10; String tableName = htd.getTableName().getNameAsString() + "2"; - htd = HTU.createTableDescriptor(tableName); + htd = HTU.createTableDescriptor(TableName.valueOf(tableName), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(regionReplication); // dont care about splits themselves too much 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 11139e59803..7fd6ac74842 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 @@ -503,7 +503,9 @@ public class TestScanner { @Test @SuppressWarnings("deprecation") public void testScanAndConcurrentMajorCompact() throws Exception { - HTableDescriptor htd = TEST_UTIL.createTableDescriptor(name.getMethodName()); + HTableDescriptor htd = TEST_UTIL.createTableDescriptor(TableName.valueOf(name.getMethodName()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); this.region = TEST_UTIL.createLocalHRegion(htd, null, null); Table hri = new RegionAsTable(region); 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 ecb31061c3f..9601538935a 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 @@ -44,6 +44,7 @@ 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.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MasterNotRunningException; @@ -567,7 +568,9 @@ public class TestSplitTransactionOnCluster { @Test public void testSplitWithRegionReplicas() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); - HTableDescriptor htd = TESTING_UTIL.createTableDescriptor(name.getMethodName()); + HTableDescriptor htd = TESTING_UTIL.createTableDescriptor( + TableName.valueOf(name.getMethodName()), HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, + HConstants.FOREVER, HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(2); htd.addCoprocessor(SlowMeCopro.class.getName()); // 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/TestRegionReplicaReplicationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpoint.java index b0e0a4e792b..c29149da89c 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,6 +37,7 @@ 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.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; @@ -140,7 +141,9 @@ public class TestRegionReplicaReplicationEndpoint { } HTableDescriptor htd = HTU.createTableDescriptor( - "testReplicationPeerIsCreated_no_region_replicas"); + TableName.valueOf("testReplicationPeerIsCreated_no_region_replicas"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); HTU.getAdmin().createTable(htd); try { peerConfig = admin.getReplicationPeerConfig(peerId); @@ -150,7 +153,9 @@ public class TestRegionReplicaReplicationEndpoint { } assertNull(peerConfig); - htd = HTU.createTableDescriptor("testReplicationPeerIsCreated"); + htd = HTU.createTableDescriptor(TableName.valueOf("testReplicationPeerIsCreated"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(2); HTU.getAdmin().createTable(htd); @@ -183,8 +188,10 @@ public class TestRegionReplicaReplicationEndpoint { peerConfig = null; } - HTableDescriptor htd - = HTU.createTableDescriptor("testRegionReplicaReplicationPeerIsCreatedForModifyTable"); + HTableDescriptor htd = HTU.createTableDescriptor( + TableName.valueOf("testRegionReplicaReplicationPeerIsCreatedForModifyTable"), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); HTU.getAdmin().createTable(htd); // assert that replication peer is not created yet @@ -216,7 +223,9 @@ public class TestRegionReplicaReplicationEndpoint { // ensure that data is replicated to the secondary region TableName tableName = TableName.valueOf("testRegionReplicaReplicationWithReplicas_" + regionReplication); - HTableDescriptor htd = HTU.createTableDescriptor(tableName.toString()); + HTableDescriptor htd = HTU.createTableDescriptor(TableName.valueOf(tableName.toString()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(regionReplication); HTU.getAdmin().createTable(htd); TableName tableNameNoReplicas = @@ -399,7 +408,9 @@ public class TestRegionReplicaReplicationEndpoint { TableName toBeDisabledTable = TableName.valueOf( dropTable ? "droppedTable" : (disableReplication ? "disableReplication" : "disabledTable")); HTU.deleteTableIfAny(toBeDisabledTable); - htd = HTU.createTableDescriptor(toBeDisabledTable.toString()); + htd = HTU.createTableDescriptor(TableName.valueOf(toBeDisabledTable.toString()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); htd.setRegionReplication(regionReplication); HTU.getAdmin().createTable(htd); 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 af41e0578e2..9975c96c17f 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 @@ -33,6 +33,7 @@ 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.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; @@ -120,7 +121,9 @@ public class TestRegionReplicaReplicationEndpointNoMaster { HTU.startMiniCluster(option); // Create table then get the single region for our new table. - HTableDescriptor htd = HTU.createTableDescriptor(tableName.getNameAsString()); + HTableDescriptor htd = HTU.createTableDescriptor(TableName.valueOf(tableName.getNameAsString()), + HColumnDescriptor.DEFAULT_MIN_VERSIONS, 3, HConstants.FOREVER, + HColumnDescriptor.DEFAULT_KEEP_DELETED); table = HTU.createTable(htd, new byte[][]{f}, null); try (RegionLocator locator = HTU.getConnection().getRegionLocator(tableName)) {