HBASE-14998 Unify synchronous and asynchronous methods in Admin and cleanup
This is based on patch sent me by Balazs Meszaros. The good stuff in here is from him. This patch does less than his ambition. It changes Admin class only. Can work on making AsyncAdmin cohere in a follow-on. * Deprecates getAlterStatus. Everywhere else we talk of 'modify' rather 'alter' and should use Future returned from async instead. * isTableAvailable(TableName, byte [][]) has been deprecated to be removed; use the overrie instead. This is a weird method. * Changed listTableDescriptor to getDescriptor. * Renamed other like methods to have same pattern (deprecating the old): balancer => balance setBalancerRunning => balancerSwitch setNormalizerRunning => normalizerSwitch enableCatalogJanitor => catalogJanitorSwitch setCleanerChoreRunning => cleanerChoreSwitch setSplitOrMergeEnabled => splitOrMergeEnabledSwitch * Renamed (with deprecation of old) runCatalogScan => runCatalogJanitor. * Reviewed generated javadoc and made some edits; purged reference to hbase issues from our API, fixed param names, etc. * Made all the enable services methods have same pattern. * Renamed takeSnapshotAsync as snapshotAsync (with deprecation of old) * Renamed execProcedureWithRet as execProcedureWithReturn (with deprecation) Signed-off-by: Michael Stack <st...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/780be085 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/780be085 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/780be085 Branch: refs/heads/HBASE-18467 Commit: 780be085eded5d26bff5150362f33f4d4dfa159e Parents: 8bbfc83 Author: Michael Stack <st...@apache.org> Authored: Tue Sep 12 18:36:17 2017 -0700 Committer: Michael Stack <st...@apache.org> Committed: Wed Sep 13 17:19:25 2017 -0700 ---------------------------------------------------------------------- .../hadoop/hbase/backup/util/RestoreTool.java | 2 +- .../org/apache/hadoop/hbase/client/Admin.java | 803 ++++++++++++------- .../apache/hadoop/hbase/client/HBaseAdmin.java | 26 +- .../hbase/IntegrationTestDDLMasterFailover.java | 14 +- .../hadoop/hbase/chaos/actions/Action.java | 2 +- .../hbase/chaos/actions/RemoveColumnAction.java | 2 +- .../hadoop/hbase/mapreduce/CopyTable.java | 2 +- .../hadoop/hbase/mob/ExpiredMobFileCleaner.java | 2 +- .../TestHColumnDescriptorDefaultVersions.java | 2 +- .../hbase/client/TestReplicaWithCluster.java | 6 +- 10 files changed, 522 insertions(+), 339 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/780be085/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java ---------------------------------------------------------------------- diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java index c2f1939..ca0d026 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java @@ -177,7 +177,7 @@ public class RestoreTool { LOG.debug("Found descriptor " + tableDescriptor + " through " + incrBackupId); TableName newTableName = newTableNames[i]; - TableDescriptor newTableDescriptor = admin.listTableDescriptor(newTableName); + TableDescriptor newTableDescriptor = admin.getDescriptor(newTableName); List<ColumnFamilyDescriptor> families = Arrays.asList(tableDescriptor.getColumnFamilies()); List<ColumnFamilyDescriptor> existingFamilies = Arrays.asList(newTableDescriptor.getColumnFamilies());