001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.client;
019
020import java.util.EnumSet;
021import java.util.List;
022import java.util.Map;
023import java.util.Optional;
024import java.util.Set;
025import java.util.concurrent.CompletableFuture;
026import java.util.concurrent.ExecutorService;
027import java.util.function.Function;
028import java.util.regex.Pattern;
029import org.apache.hadoop.hbase.CacheEvictionStats;
030import org.apache.hadoop.hbase.ClusterMetrics;
031import org.apache.hadoop.hbase.ClusterMetrics.Option;
032import org.apache.hadoop.hbase.NamespaceDescriptor;
033import org.apache.hadoop.hbase.RegionMetrics;
034import org.apache.hadoop.hbase.ServerName;
035import org.apache.hadoop.hbase.TableName;
036import org.apache.hadoop.hbase.client.replication.TableCFs;
037import org.apache.hadoop.hbase.client.security.SecurityCapability;
038import org.apache.hadoop.hbase.net.Address;
039import org.apache.hadoop.hbase.quotas.QuotaFilter;
040import org.apache.hadoop.hbase.quotas.QuotaSettings;
041import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot;
042import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
043import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
044import org.apache.hadoop.hbase.replication.SyncReplicationState;
045import org.apache.hadoop.hbase.rsgroup.RSGroupInfo;
046import org.apache.hadoop.hbase.security.access.GetUserPermissionsRequest;
047import org.apache.hadoop.hbase.security.access.Permission;
048import org.apache.hadoop.hbase.security.access.UserPermission;
049import org.apache.hadoop.hbase.util.FutureUtils;
050import org.apache.hadoop.hbase.util.Pair;
051import org.apache.yetus.audience.InterfaceAudience;
052
053import org.apache.hbase.thirdparty.com.google.protobuf.RpcChannel;
054
055/**
056 * Just a wrapper of {@link RawAsyncHBaseAdmin}. The difference is that users need to provide a
057 * thread pool when constructing this class, and the callback methods registered to the returned
058 * {@link CompletableFuture} will be executed in this thread pool. So usually it is safe for users
059 * to do anything they want in the callbacks without breaking the rpc framework.
060 * @since 2.0.0
061 * @see RawAsyncHBaseAdmin
062 * @see AsyncConnection#getAdmin(ExecutorService)
063 * @see AsyncConnection#getAdminBuilder(ExecutorService)
064 */
065@InterfaceAudience.Private
066class AsyncHBaseAdmin implements AsyncAdmin {
067
068  private final RawAsyncHBaseAdmin rawAdmin;
069
070  private final ExecutorService pool;
071
072  AsyncHBaseAdmin(RawAsyncHBaseAdmin rawAdmin, ExecutorService pool) {
073    this.rawAdmin = rawAdmin;
074    this.pool = pool;
075  }
076
077  private <T> CompletableFuture<T> wrap(CompletableFuture<T> future) {
078    return FutureUtils.wrapFuture(future, pool);
079  }
080
081  @Override
082  public CompletableFuture<Boolean> tableExists(TableName tableName) {
083    return wrap(rawAdmin.tableExists(tableName));
084  }
085
086  @Override
087  public CompletableFuture<List<TableDescriptor>> listTableDescriptors(boolean includeSysTables) {
088    return wrap(rawAdmin.listTableDescriptors(includeSysTables));
089  }
090
091  @Override
092  public CompletableFuture<List<TableDescriptor>> listTableDescriptors(Pattern pattern,
093      boolean includeSysTables) {
094    return wrap(rawAdmin.listTableDescriptors(pattern, includeSysTables));
095  }
096
097  @Override
098  public CompletableFuture<List<TableDescriptor>> listTableDescriptors(List<TableName> tableNames) {
099    return wrap(rawAdmin.listTableDescriptors(tableNames));
100  }
101
102  @Override
103  public CompletableFuture<List<TableDescriptor>> listTableDescriptorsByNamespace(String name) {
104    return wrap(rawAdmin.listTableDescriptorsByNamespace(name));
105  }
106
107  @Override
108  public CompletableFuture<List<TableName>> listTableNames(boolean includeSysTables) {
109    return wrap(rawAdmin.listTableNames(includeSysTables));
110  }
111
112  @Override
113  public CompletableFuture<List<TableName>> listTableNames(Pattern pattern,
114      boolean includeSysTables) {
115    return wrap(rawAdmin.listTableNames(pattern, includeSysTables));
116  }
117
118  @Override
119  public CompletableFuture<List<TableName>> listTableNamesByNamespace(String name) {
120    return wrap(rawAdmin.listTableNamesByNamespace(name));
121  }
122
123  @Override
124  public CompletableFuture<TableDescriptor> getDescriptor(TableName tableName) {
125    return wrap(rawAdmin.getDescriptor(tableName));
126  }
127
128  @Override
129  public CompletableFuture<Void> createTable(TableDescriptor desc) {
130    return wrap(rawAdmin.createTable(desc));
131  }
132
133  @Override
134  public CompletableFuture<Void> createTable(TableDescriptor desc, byte[] startKey, byte[] endKey,
135      int numRegions) {
136    return wrap(rawAdmin.createTable(desc, startKey, endKey, numRegions));
137  }
138
139  @Override
140  public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) {
141    return wrap(rawAdmin.createTable(desc, splitKeys));
142  }
143
144  @Override
145  public CompletableFuture<Void> modifyTable(TableDescriptor desc) {
146    return wrap(rawAdmin.modifyTable(desc));
147  }
148
149  @Override
150  public CompletableFuture<Void> deleteTable(TableName tableName) {
151    return wrap(rawAdmin.deleteTable(tableName));
152  }
153
154  @Override
155  public CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits) {
156    return wrap(rawAdmin.truncateTable(tableName, preserveSplits));
157  }
158
159  @Override
160  public CompletableFuture<Void> enableTable(TableName tableName) {
161    return wrap(rawAdmin.enableTable(tableName));
162  }
163
164  @Override
165  public CompletableFuture<Void> disableTable(TableName tableName) {
166    return wrap(rawAdmin.disableTable(tableName));
167  }
168
169  @Override
170  public CompletableFuture<Boolean> isTableEnabled(TableName tableName) {
171    return wrap(rawAdmin.isTableEnabled(tableName));
172  }
173
174  @Override
175  public CompletableFuture<Boolean> isTableDisabled(TableName tableName) {
176    return wrap(rawAdmin.isTableDisabled(tableName));
177  }
178
179  @Override
180  public CompletableFuture<Boolean> isTableAvailable(TableName tableName) {
181    return wrap(rawAdmin.isTableAvailable(tableName));
182  }
183
184  @Override
185  public CompletableFuture<Void> addColumnFamily(TableName tableName,
186      ColumnFamilyDescriptor columnFamily) {
187    return wrap(rawAdmin.addColumnFamily(tableName, columnFamily));
188  }
189
190  @Override
191  public CompletableFuture<Void> deleteColumnFamily(TableName tableName, byte[] columnFamily) {
192    return wrap(rawAdmin.deleteColumnFamily(tableName, columnFamily));
193  }
194
195  @Override
196  public CompletableFuture<Void> modifyColumnFamily(TableName tableName,
197      ColumnFamilyDescriptor columnFamily) {
198    return wrap(rawAdmin.modifyColumnFamily(tableName, columnFamily));
199  }
200
201  @Override
202  public CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor) {
203    return wrap(rawAdmin.createNamespace(descriptor));
204  }
205
206  @Override
207  public CompletableFuture<Void> modifyNamespace(NamespaceDescriptor descriptor) {
208    return wrap(rawAdmin.modifyNamespace(descriptor));
209  }
210
211  @Override
212  public CompletableFuture<Void> deleteNamespace(String name) {
213    return wrap(rawAdmin.deleteNamespace(name));
214  }
215
216  @Override
217  public CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(String name) {
218    return wrap(rawAdmin.getNamespaceDescriptor(name));
219  }
220
221  @Override
222  public CompletableFuture<List<String>> listNamespaces() {
223    return wrap(rawAdmin.listNamespaces());
224  }
225
226  @Override
227  public CompletableFuture<List<NamespaceDescriptor>> listNamespaceDescriptors() {
228    return wrap(rawAdmin.listNamespaceDescriptors());
229  }
230
231  @Override
232  public CompletableFuture<List<RegionInfo>> getRegions(ServerName serverName) {
233    return wrap(rawAdmin.getRegions(serverName));
234  }
235
236  @Override
237  public CompletableFuture<List<RegionInfo>> getRegions(TableName tableName) {
238    return wrap(rawAdmin.getRegions(tableName));
239  }
240
241  @Override
242  public CompletableFuture<Void> flush(TableName tableName) {
243    return wrap(rawAdmin.flush(tableName));
244  }
245
246  @Override
247  public CompletableFuture<Void> flushRegion(byte[] regionName) {
248    return wrap(rawAdmin.flushRegion(regionName));
249  }
250
251  @Override
252  public CompletableFuture<Void> flushRegionServer(ServerName sn) {
253    return wrap(rawAdmin.flushRegionServer(sn));
254  }
255
256  @Override
257  public CompletableFuture<Void> compact(TableName tableName,
258      CompactType compactType) {
259    return wrap(rawAdmin.compact(tableName, compactType));
260  }
261
262  @Override
263  public CompletableFuture<Void> compact(TableName tableName,
264      byte[] columnFamily, CompactType compactType) {
265    return wrap(rawAdmin.compact(tableName, columnFamily, compactType));
266  }
267
268  @Override
269  public CompletableFuture<Void> compactRegion(byte[] regionName) {
270    return wrap(rawAdmin.compactRegion(regionName));
271  }
272
273  @Override
274  public CompletableFuture<Void> compactRegion(byte[] regionName, byte[] columnFamily) {
275    return wrap(rawAdmin.compactRegion(regionName, columnFamily));
276  }
277
278  @Override
279  public CompletableFuture<Void> majorCompact(TableName tableName, CompactType compactType) {
280    return wrap(rawAdmin.majorCompact(tableName, compactType));
281  }
282
283  @Override
284  public CompletableFuture<Void> majorCompact(TableName tableName, byte[] columnFamily,
285      CompactType compactType) {
286    return wrap(rawAdmin.majorCompact(tableName, columnFamily, compactType));
287  }
288
289  @Override
290  public CompletableFuture<Void> majorCompactRegion(byte[] regionName) {
291    return wrap(rawAdmin.majorCompactRegion(regionName));
292  }
293
294  @Override
295  public CompletableFuture<Void> majorCompactRegion(byte[] regionName, byte[] columnFamily) {
296    return wrap(rawAdmin.majorCompactRegion(regionName, columnFamily));
297  }
298
299  @Override
300  public CompletableFuture<Void> compactRegionServer(ServerName serverName) {
301    return wrap(rawAdmin.compactRegionServer(serverName));
302  }
303
304  @Override
305  public CompletableFuture<Void> majorCompactRegionServer(ServerName serverName) {
306    return wrap(rawAdmin.majorCompactRegionServer(serverName));
307  }
308
309  @Override
310  public CompletableFuture<Boolean> mergeSwitch(boolean enabled, boolean drainMerges) {
311    return wrap(rawAdmin.mergeSwitch(enabled, drainMerges));
312  }
313
314  @Override
315  public CompletableFuture<Boolean> isMergeEnabled() {
316    return wrap(rawAdmin.isMergeEnabled());
317  }
318
319  @Override
320  public CompletableFuture<Boolean> splitSwitch(boolean enabled, boolean drainSplits) {
321    return wrap(rawAdmin.splitSwitch(enabled, drainSplits));
322  }
323
324  @Override
325  public CompletableFuture<Boolean> isSplitEnabled() {
326    return wrap(rawAdmin.isSplitEnabled());
327  }
328
329  @Override
330  public CompletableFuture<Void> mergeRegions(List<byte[]> nameOfRegionsToMerge, boolean forcible) {
331    return wrap(rawAdmin.mergeRegions(nameOfRegionsToMerge, forcible));
332  }
333
334  @Override
335  public CompletableFuture<Void> split(TableName tableName) {
336    return wrap(rawAdmin.split(tableName));
337  }
338
339  @Override
340  public CompletableFuture<Void> split(TableName tableName, byte[] splitPoint) {
341    return wrap(rawAdmin.split(tableName, splitPoint));
342  }
343
344  @Override
345  public CompletableFuture<Void> splitRegion(byte[] regionName) {
346    return wrap(rawAdmin.splitRegion(regionName));
347  }
348
349  @Override
350  public CompletableFuture<Void> splitRegion(byte[] regionName, byte[] splitPoint) {
351    return wrap(rawAdmin.splitRegion(regionName, splitPoint));
352  }
353
354  @Override
355  public CompletableFuture<Void> assign(byte[] regionName) {
356    return wrap(rawAdmin.assign(regionName));
357  }
358
359  @Override
360  public CompletableFuture<Void> unassign(byte[] regionName, boolean forcible) {
361    return wrap(rawAdmin.unassign(regionName, forcible));
362  }
363
364  @Override
365  public CompletableFuture<Void> offline(byte[] regionName) {
366    return wrap(rawAdmin.offline(regionName));
367  }
368
369  @Override
370  public CompletableFuture<Void> move(byte[] regionName) {
371    return wrap(rawAdmin.move(regionName));
372  }
373
374  @Override
375  public CompletableFuture<Void> move(byte[] regionName, ServerName destServerName) {
376    return wrap(rawAdmin.move(regionName, destServerName));
377  }
378
379  @Override
380  public CompletableFuture<Void> setQuota(QuotaSettings quota) {
381    return wrap(rawAdmin.setQuota(quota));
382  }
383
384  @Override
385  public CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter) {
386    return wrap(rawAdmin.getQuota(filter));
387  }
388
389  @Override
390  public CompletableFuture<Void> addReplicationPeer(String peerId,
391      ReplicationPeerConfig peerConfig, boolean enabled) {
392    return wrap(rawAdmin.addReplicationPeer(peerId, peerConfig, enabled));
393  }
394
395  @Override
396  public CompletableFuture<Void> removeReplicationPeer(String peerId) {
397    return wrap(rawAdmin.removeReplicationPeer(peerId));
398  }
399
400  @Override
401  public CompletableFuture<Void> enableReplicationPeer(String peerId) {
402    return wrap(rawAdmin.enableReplicationPeer(peerId));
403  }
404
405  @Override
406  public CompletableFuture<Void> disableReplicationPeer(String peerId) {
407    return wrap(rawAdmin.disableReplicationPeer(peerId));
408  }
409
410  @Override
411  public CompletableFuture<ReplicationPeerConfig> getReplicationPeerConfig(String peerId) {
412    return wrap(rawAdmin.getReplicationPeerConfig(peerId));
413  }
414
415  @Override
416  public CompletableFuture<Void> updateReplicationPeerConfig(String peerId,
417      ReplicationPeerConfig peerConfig) {
418    return wrap(rawAdmin.updateReplicationPeerConfig(peerId, peerConfig));
419  }
420
421  @Override
422  public CompletableFuture<Void> transitReplicationPeerSyncReplicationState(String peerId,
423      SyncReplicationState clusterState) {
424    return wrap(rawAdmin.transitReplicationPeerSyncReplicationState(peerId, clusterState));
425  }
426
427  @Override
428  public CompletableFuture<Void> appendReplicationPeerTableCFs(String peerId,
429      Map<TableName, List<String>> tableCfs) {
430    return wrap(rawAdmin.appendReplicationPeerTableCFs(peerId, tableCfs));
431  }
432
433  @Override
434  public CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId,
435      Map<TableName, List<String>> tableCfs) {
436    return wrap(rawAdmin.removeReplicationPeerTableCFs(peerId, tableCfs));
437  }
438
439  @Override
440  public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() {
441    return wrap(rawAdmin.listReplicationPeers());
442  }
443
444  @Override
445  public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers(Pattern pattern) {
446    return wrap(rawAdmin.listReplicationPeers(pattern));
447  }
448
449  @Override
450  public CompletableFuture<List<TableCFs>> listReplicatedTableCFs() {
451    return wrap(rawAdmin.listReplicatedTableCFs());
452  }
453
454  @Override
455  public CompletableFuture<Void> enableTableReplication(TableName tableName) {
456    return wrap(rawAdmin.enableTableReplication(tableName));
457  }
458
459  @Override
460  public CompletableFuture<Void> disableTableReplication(TableName tableName) {
461    return wrap(rawAdmin.disableTableReplication(tableName));
462  }
463
464  @Override
465  public CompletableFuture<Void> snapshot(SnapshotDescription snapshot) {
466    return wrap(rawAdmin.snapshot(snapshot));
467  }
468
469  @Override
470  public CompletableFuture<Boolean> isSnapshotFinished(SnapshotDescription snapshot) {
471    return wrap(rawAdmin.isSnapshotFinished(snapshot));
472  }
473
474  @Override
475  public CompletableFuture<Void> restoreSnapshot(String snapshotName) {
476    return wrap(rawAdmin.restoreSnapshot(snapshotName));
477  }
478
479  @Override
480  public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot,
481      boolean restoreAcl) {
482    return wrap(rawAdmin.restoreSnapshot(snapshotName, takeFailSafeSnapshot, restoreAcl));
483  }
484
485  @Override
486  public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName,
487      boolean restoreAcl) {
488    return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName, restoreAcl));
489  }
490
491  @Override
492  public CompletableFuture<List<SnapshotDescription>> listSnapshots() {
493    return wrap(rawAdmin.listSnapshots());
494  }
495
496  @Override
497  public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern pattern) {
498    return wrap(rawAdmin.listSnapshots(pattern));
499  }
500
501  @Override
502  public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern) {
503    return wrap(rawAdmin.listTableSnapshots(tableNamePattern));
504  }
505
506  @Override
507  public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern,
508      Pattern snapshotNamePattern) {
509    return wrap(rawAdmin.listTableSnapshots(tableNamePattern, snapshotNamePattern));
510  }
511
512  @Override
513  public CompletableFuture<Void> deleteSnapshot(String snapshotName) {
514    return wrap(rawAdmin.deleteSnapshot(snapshotName));
515  }
516
517  @Override
518  public CompletableFuture<Void> deleteSnapshots() {
519    return wrap(rawAdmin.deleteSnapshots());
520  }
521
522  @Override
523  public CompletableFuture<Void> deleteSnapshots(Pattern pattern) {
524    return wrap(rawAdmin.deleteSnapshots(pattern));
525  }
526
527  @Override
528  public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) {
529    return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern));
530  }
531
532  @Override
533  public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern,
534      Pattern snapshotNamePattern) {
535    return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern, snapshotNamePattern));
536  }
537
538  @Override
539  public CompletableFuture<Void> execProcedure(String signature, String instance,
540      Map<String, String> props) {
541    return wrap(rawAdmin.execProcedure(signature, instance, props));
542  }
543
544  @Override
545  public CompletableFuture<byte[]> execProcedureWithReturn(String signature, String instance,
546      Map<String, String> props) {
547    return wrap(rawAdmin.execProcedureWithReturn(signature, instance, props));
548  }
549
550  @Override
551  public CompletableFuture<Boolean> isProcedureFinished(String signature, String instance,
552      Map<String, String> props) {
553    return wrap(rawAdmin.isProcedureFinished(signature, instance, props));
554  }
555
556  @Override
557  public CompletableFuture<Boolean> abortProcedure(long procId, boolean mayInterruptIfRunning) {
558    return wrap(rawAdmin.abortProcedure(procId, mayInterruptIfRunning));
559  }
560
561  @Override
562  public CompletableFuture<String> getProcedures() {
563    return wrap(rawAdmin.getProcedures());
564  }
565
566  @Override
567  public CompletableFuture<String> getLocks() {
568    return wrap(rawAdmin.getLocks());
569  }
570
571  @Override
572  public CompletableFuture<Void> decommissionRegionServers(List<ServerName> servers,
573      boolean offload) {
574    return wrap(rawAdmin.decommissionRegionServers(servers, offload));
575  }
576
577  @Override
578  public CompletableFuture<List<ServerName>> listDecommissionedRegionServers() {
579    return wrap(rawAdmin.listDecommissionedRegionServers());
580  }
581
582  @Override
583  public CompletableFuture<Void> recommissionRegionServer(ServerName server,
584      List<byte[]> encodedRegionNames) {
585    return wrap(rawAdmin.recommissionRegionServer(server, encodedRegionNames));
586  }
587
588  @Override
589  public CompletableFuture<ClusterMetrics> getClusterMetrics() {
590    return getClusterMetrics(EnumSet.allOf(Option.class));
591  }
592
593  @Override
594  public CompletableFuture<ClusterMetrics> getClusterMetrics(EnumSet<Option> options) {
595    return wrap(rawAdmin.getClusterMetrics(options));
596  }
597
598  @Override
599  public CompletableFuture<Void> shutdown() {
600    return wrap(rawAdmin.shutdown());
601  }
602
603  @Override
604  public CompletableFuture<Void> stopMaster() {
605    return wrap(rawAdmin.stopMaster());
606  }
607
608  @Override
609  public CompletableFuture<Void> stopRegionServer(ServerName serverName) {
610    return wrap(rawAdmin.stopRegionServer(serverName));
611  }
612
613  @Override
614  public CompletableFuture<Void> updateConfiguration(ServerName serverName) {
615    return wrap(rawAdmin.updateConfiguration(serverName));
616  }
617
618  @Override
619  public CompletableFuture<Void> updateConfiguration() {
620    return wrap(rawAdmin.updateConfiguration());
621  }
622
623  @Override
624  public CompletableFuture<Void> rollWALWriter(ServerName serverName) {
625    return wrap(rawAdmin.rollWALWriter(serverName));
626  }
627
628  @Override
629  public CompletableFuture<Void> clearCompactionQueues(ServerName serverName, Set<String> queues) {
630    return wrap(rawAdmin.clearCompactionQueues(serverName, queues));
631  }
632
633  @Override
634  public CompletableFuture<List<SecurityCapability>> getSecurityCapabilities() {
635    return wrap(rawAdmin.getSecurityCapabilities());
636  }
637
638  @Override
639  public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName) {
640    return wrap(rawAdmin.getRegionMetrics(serverName));
641  }
642
643  @Override
644  public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName,
645      TableName tableName) {
646    return wrap(rawAdmin.getRegionMetrics(serverName, tableName));
647  }
648
649  @Override
650  public CompletableFuture<Boolean> isMasterInMaintenanceMode() {
651    return wrap(rawAdmin.isMasterInMaintenanceMode());
652  }
653
654  @Override
655  public CompletableFuture<CompactionState> getCompactionState(
656      TableName tableName, CompactType compactType) {
657    return wrap(rawAdmin.getCompactionState(tableName, compactType));
658  }
659
660  @Override
661  public CompletableFuture<CompactionState> getCompactionStateForRegion(byte[] regionName) {
662    return wrap(rawAdmin.getCompactionStateForRegion(regionName));
663  }
664
665  @Override
666  public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestamp(TableName tableName) {
667    return wrap(rawAdmin.getLastMajorCompactionTimestamp(tableName));
668  }
669
670  @Override
671  public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestampForRegion(
672      byte[] regionName) {
673    return wrap(rawAdmin.getLastMajorCompactionTimestampForRegion(regionName));
674  }
675
676  @Override
677  public CompletableFuture<Boolean> balancerSwitch(boolean on, boolean drainRITs) {
678    return wrap(rawAdmin.balancerSwitch(on, drainRITs));
679  }
680
681  @Override
682  public CompletableFuture<Boolean> balance(boolean forcible) {
683    return wrap(rawAdmin.balance(forcible));
684  }
685
686  @Override
687  public CompletableFuture<Boolean> isBalancerEnabled() {
688    return wrap(rawAdmin.isBalancerEnabled());
689  }
690
691  @Override
692  public CompletableFuture<Boolean> normalizerSwitch(boolean on) {
693    return wrap(rawAdmin.normalizerSwitch(on));
694  }
695
696  @Override
697  public CompletableFuture<Boolean> isNormalizerEnabled() {
698    return wrap(rawAdmin.isNormalizerEnabled());
699  }
700
701  @Override
702  public CompletableFuture<Boolean> normalize() {
703    return wrap(rawAdmin.normalize());
704  }
705
706  @Override
707  public CompletableFuture<Boolean> cleanerChoreSwitch(boolean enabled) {
708    return wrap(rawAdmin.cleanerChoreSwitch(enabled));
709  }
710
711  @Override
712  public CompletableFuture<Boolean> isCleanerChoreEnabled() {
713    return wrap(rawAdmin.isCleanerChoreEnabled());
714  }
715
716  @Override
717  public CompletableFuture<Boolean> runCleanerChore() {
718    return wrap(rawAdmin.runCleanerChore());
719  }
720
721  @Override
722  public CompletableFuture<Boolean> catalogJanitorSwitch(boolean enabled) {
723    return wrap(rawAdmin.catalogJanitorSwitch(enabled));
724  }
725
726  @Override
727  public CompletableFuture<Boolean> isCatalogJanitorEnabled() {
728    return wrap(rawAdmin.isCatalogJanitorEnabled());
729  }
730
731  @Override
732  public CompletableFuture<Integer> runCatalogJanitor() {
733    return wrap(rawAdmin.runCatalogJanitor());
734  }
735
736  @Override
737  public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker,
738      ServiceCaller<S, R> callable) {
739    return wrap(rawAdmin.coprocessorService(stubMaker, callable));
740  }
741
742  @Override
743  public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker,
744      ServiceCaller<S, R> callable, ServerName serverName) {
745    return wrap(rawAdmin.coprocessorService(stubMaker, callable, serverName));
746  }
747
748  @Override
749  public CompletableFuture<List<ServerName>> listDeadServers() {
750    return wrap(rawAdmin.listDeadServers());
751  }
752
753  @Override
754  public CompletableFuture<List<ServerName>> clearDeadServers(List<ServerName> servers) {
755    return wrap(rawAdmin.clearDeadServers(servers));
756  }
757
758  @Override
759  public CompletableFuture<CacheEvictionStats> clearBlockCache(TableName tableName) {
760    return wrap(rawAdmin.clearBlockCache(tableName));
761  }
762
763  @Override
764  public CompletableFuture<Void> cloneTableSchema(TableName tableName, TableName newTableName,
765      boolean preserveSplits) {
766    return wrap(rawAdmin.cloneTableSchema(tableName, newTableName, preserveSplits));
767  }
768
769  @Override
770  public CompletableFuture<Map<ServerName, Boolean>> compactionSwitch(boolean switchState,
771      List<String> serverNamesList) {
772    return wrap(rawAdmin.compactionSwitch(switchState, serverNamesList));
773  }
774
775  @Override
776  public CompletableFuture<Boolean> switchRpcThrottle(boolean enable) {
777    return wrap(rawAdmin.switchRpcThrottle(enable));
778  }
779
780  @Override
781  public CompletableFuture<Boolean> isRpcThrottleEnabled() {
782    return wrap(rawAdmin.isRpcThrottleEnabled());
783  }
784
785  @Override
786  public CompletableFuture<Boolean> exceedThrottleQuotaSwitch(boolean enable) {
787    return wrap(rawAdmin.exceedThrottleQuotaSwitch(enable));
788  }
789
790  @Override
791  public CompletableFuture<Map<TableName, Long>> getSpaceQuotaTableSizes() {
792    return wrap(rawAdmin.getSpaceQuotaTableSizes());
793  }
794
795  @Override
796  public CompletableFuture<Map<TableName, SpaceQuotaSnapshot>> getRegionServerSpaceQuotaSnapshots(
797      ServerName serverName) {
798    return wrap(rawAdmin.getRegionServerSpaceQuotaSnapshots(serverName));
799  }
800
801  @Override
802  public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(String namespace) {
803    return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(namespace));
804  }
805
806  @Override
807  public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(TableName tableName) {
808    return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(tableName));
809  }
810
811  @Override
812  public CompletableFuture<Void> grant(UserPermission userPermission,
813      boolean mergeExistingPermissions) {
814    return wrap(rawAdmin.grant(userPermission, mergeExistingPermissions));
815  }
816
817  @Override
818  public CompletableFuture<Void> revoke(UserPermission userPermission) {
819    return wrap(rawAdmin.revoke(userPermission));
820  }
821
822  @Override
823  public CompletableFuture<List<UserPermission>>
824      getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) {
825    return wrap(rawAdmin.getUserPermissions(getUserPermissionsRequest));
826  }
827
828  @Override
829  public CompletableFuture<List<Boolean>> hasUserPermissions(String userName,
830      List<Permission> permissions) {
831    return wrap(rawAdmin.hasUserPermissions(userName, permissions));
832  }
833
834  @Override
835  public CompletableFuture<Boolean> snapshotCleanupSwitch(final boolean on,
836      final boolean sync) {
837    return wrap(rawAdmin.snapshotCleanupSwitch(on, sync));
838  }
839
840  @Override
841  public CompletableFuture<Boolean> isSnapshotCleanupEnabled() {
842    return wrap(rawAdmin.isSnapshotCleanupEnabled());
843  }
844
845  @Override
846  public CompletableFuture<List<OnlineLogRecord>> getSlowLogResponses(
847      final Set<ServerName> serverNames, final LogQueryFilter logQueryFilter) {
848    return wrap(rawAdmin.getSlowLogResponses(serverNames, logQueryFilter));
849  }
850
851  @Override
852  public CompletableFuture<List<Boolean>> clearSlowLogResponses(Set<ServerName> serverNames) {
853    return wrap(rawAdmin.clearSlowLogResponses(serverNames));
854  }
855
856  @Override
857  public CompletableFuture<RSGroupInfo> getRSGroup(String groupName) {
858    return wrap(rawAdmin.getRSGroup(groupName));
859  }
860
861  @Override
862  public CompletableFuture<Void> moveServersToRSGroup(Set<Address> servers, String groupName) {
863    return wrap(rawAdmin.moveServersToRSGroup(servers, groupName));
864  }
865
866  @Override
867  public CompletableFuture<Void> addRSGroup(String groupName) {
868    return wrap(rawAdmin.addRSGroup(groupName));
869  }
870
871  @Override
872  public CompletableFuture<Void> removeRSGroup(String groupName) {
873    return wrap(rawAdmin.removeRSGroup(groupName));
874  }
875
876  @Override
877  public CompletableFuture<Boolean> balanceRSGroup(String groupName) {
878    return wrap(rawAdmin.balanceRSGroup(groupName));
879  }
880
881  @Override
882  public CompletableFuture<List<RSGroupInfo>> listRSGroups() {
883    return wrap(rawAdmin.listRSGroups());
884  }
885
886  @Override
887  public CompletableFuture<List<TableName>> listTablesInRSGroup(String groupName) {
888    return wrap(rawAdmin.listTablesInRSGroup(groupName));
889  }
890
891  @Override
892  public CompletableFuture<Pair<List<String>, List<TableName>>>
893    getConfiguredNamespacesAndTablesInRSGroup(String groupName) {
894    return wrap(rawAdmin.getConfiguredNamespacesAndTablesInRSGroup(groupName));
895  }
896
897  @Override
898  public CompletableFuture<RSGroupInfo> getRSGroup(Address hostPort) {
899    return wrap(rawAdmin.getRSGroup(hostPort));
900  }
901
902  @Override
903  public CompletableFuture<Void> removeServersFromRSGroup(Set<Address> servers) {
904    return wrap(rawAdmin.removeServersFromRSGroup(servers));
905  }
906
907  @Override
908  public CompletableFuture<RSGroupInfo> getRSGroup(TableName tableName) {
909    return wrap(rawAdmin.getRSGroup(tableName));
910  }
911
912  @Override
913  public CompletableFuture<Void> setRSGroup(Set<TableName> tables, String groupName) {
914    return wrap(rawAdmin.setRSGroup(tables, groupName));
915  }
916}