HBASE-22102 Remove AsyncAdmin.isTableAvailable(TableName, byte[][])
Signed-off-by: zhangduo <zhangduo@apache.org>
This commit is contained in:
parent
7b3ff56202
commit
56dd309b21
|
@ -221,18 +221,6 @@ public interface AsyncAdmin {
|
|||
*/
|
||||
CompletableFuture<Boolean> isTableAvailable(TableName tableName);
|
||||
|
||||
/**
|
||||
* Use this api to check if the table has been created with the specified number of splitkeys
|
||||
* which was used while creating the given table. Note : If this api is used after a table's
|
||||
* region gets splitted, the api may return false. The return value will be wrapped by a
|
||||
* {@link CompletableFuture}.
|
||||
* @param tableName name of table to check
|
||||
* @param splitKeys keys to check if the table has been created with all split keys
|
||||
* @deprecated Since 2.2.0. Will be removed in 3.0.0. Use {@link #isTableAvailable(TableName)}
|
||||
*/
|
||||
@Deprecated
|
||||
CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys);
|
||||
|
||||
/**
|
||||
* Add a column family to an existing table.
|
||||
* @param tableName name of the table to add column family to
|
||||
|
|
|
@ -176,11 +176,6 @@ class AsyncHBaseAdmin implements AsyncAdmin {
|
|||
return wrap(rawAdmin.isTableAvailable(tableName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys) {
|
||||
return wrap(rawAdmin.isTableAvailable(tableName, splitKeys));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> addColumnFamily(TableName tableName,
|
||||
ColumnFamilyDescriptor columnFamily) {
|
||||
|
|
|
@ -687,13 +687,6 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
|
|||
return isTableAvailable(tableName, Optional.empty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys) {
|
||||
Preconditions.checkNotNull(splitKeys, "splitKeys is null. If you don't specify splitKeys,"
|
||||
+ " use isTableAvailable(TableName) instead");
|
||||
return isTableAvailable(tableName, Optional.of(splitKeys));
|
||||
}
|
||||
|
||||
private CompletableFuture<Boolean> isTableAvailable(TableName tableName,
|
||||
Optional<byte[][]> splitKeys) {
|
||||
if (TableName.isMetaTableName(tableName)) {
|
||||
|
|
|
@ -133,7 +133,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
|
|||
boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(TEST_UTIL.getConfiguration());
|
||||
createTableWithDefaultConf(tableName, splitKeys);
|
||||
|
||||
boolean tableAvailable = admin.isTableAvailable(tableName, splitKeys).get();
|
||||
boolean tableAvailable = admin.isTableAvailable(tableName).get();
|
||||
assertTrue("Table should be created with splitKyes + 1 rows in META", tableAvailable);
|
||||
|
||||
AsyncTable<AdvancedScanResultConsumer> metaTable = ASYNC_CONN.getTable(META_TABLE_NAME);
|
||||
|
@ -406,7 +406,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
|
|||
|
||||
assertEquals(NUM_REGIONS, TEST_UTIL.getHBaseCluster().getRegions(tableName).size());
|
||||
assertTrue("Table should be created with splitKyes + 1 rows in META",
|
||||
admin.isTableAvailable(tableName, splitKeys).get());
|
||||
admin.isTableAvailable(tableName).get());
|
||||
|
||||
// Clone & Verify
|
||||
admin.cloneTableSchema(tableName, newTableName, preserveSplits).join();
|
||||
|
@ -421,7 +421,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
|
|||
if (preserveSplits) {
|
||||
assertEquals(NUM_REGIONS, TEST_UTIL.getHBaseCluster().getRegions(newTableName).size());
|
||||
assertTrue("New table should be created with splitKyes + 1 rows in META",
|
||||
admin.isTableAvailable(newTableName, splitKeys).get());
|
||||
admin.isTableAvailable(newTableName).get());
|
||||
} else {
|
||||
assertEquals(1, TEST_UTIL.getHBaseCluster().getRegions(newTableName).size());
|
||||
}
|
||||
|
|
|
@ -209,16 +209,6 @@ public class TestAsyncTableAdminApi2 extends TestAsyncAdminBase {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testTableAvailableWithRandomSplitKeys() throws Exception {
|
||||
createTableWithDefaultConf(tableName);
|
||||
byte[][] splitKeys = new byte[1][];
|
||||
splitKeys = new byte[][] { new byte[] { 1, 1, 1 }, new byte[] { 2, 2, 2 } };
|
||||
boolean tableAvailable = admin.isTableAvailable(tableName, splitKeys).get();
|
||||
assertFalse("Table should be created with 1 row in META", tableAvailable);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompactionTimestamps() throws Exception {
|
||||
createTableWithDefaultConf(tableName);
|
||||
|
|
Loading…
Reference in New Issue