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<TableDescriptor>> listTableDescriptorsByState(boolean isEnabled) {
109    return wrap(rawAdmin.listTableDescriptorsByState(isEnabled));
110  }
111
112  @Override
113  public CompletableFuture<List<TableName>> listTableNames(boolean includeSysTables) {
114    return wrap(rawAdmin.listTableNames(includeSysTables));
115  }
116
117  @Override
118  public CompletableFuture<List<TableName>> listTableNames(Pattern pattern,
119    boolean includeSysTables) {
120    return wrap(rawAdmin.listTableNames(pattern, includeSysTables));
121  }
122
123  @Override
124  public CompletableFuture<List<TableName>> listTableNamesByState(boolean isEnabled) {
125    return wrap(rawAdmin.listTableNamesByState(isEnabled));
126  }
127
128  @Override
129  public CompletableFuture<List<TableName>> listTableNamesByNamespace(String name) {
130    return wrap(rawAdmin.listTableNamesByNamespace(name));
131  }
132
133  @Override
134  public CompletableFuture<TableDescriptor> getDescriptor(TableName tableName) {
135    return wrap(rawAdmin.getDescriptor(tableName));
136  }
137
138  @Override
139  public CompletableFuture<Void> createTable(TableDescriptor desc) {
140    return wrap(rawAdmin.createTable(desc));
141  }
142
143  @Override
144  public CompletableFuture<Void> createTable(TableDescriptor desc, byte[] startKey, byte[] endKey,
145    int numRegions) {
146    return wrap(rawAdmin.createTable(desc, startKey, endKey, numRegions));
147  }
148
149  @Override
150  public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) {
151    return wrap(rawAdmin.createTable(desc, splitKeys));
152  }
153
154  @Override
155  public CompletableFuture<Void> modifyTable(TableDescriptor desc) {
156    return modifyTable(desc, true);
157  }
158
159  @Override
160  public CompletableFuture<Void> modifyTable(TableDescriptor desc, boolean reopenRegions) {
161    return wrap(rawAdmin.modifyTable(desc, reopenRegions));
162  }
163
164  @Override
165  public CompletableFuture<Void> modifyTableStoreFileTracker(TableName tableName, String dstSFT) {
166    return wrap(rawAdmin.modifyTableStoreFileTracker(tableName, dstSFT));
167  }
168
169  @Override
170  public CompletableFuture<Void> deleteTable(TableName tableName) {
171    return wrap(rawAdmin.deleteTable(tableName));
172  }
173
174  @Override
175  public CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits) {
176    return wrap(rawAdmin.truncateTable(tableName, preserveSplits));
177  }
178
179  @Override
180  public CompletableFuture<Void> enableTable(TableName tableName) {
181    return wrap(rawAdmin.enableTable(tableName));
182  }
183
184  @Override
185  public CompletableFuture<Void> disableTable(TableName tableName) {
186    return wrap(rawAdmin.disableTable(tableName));
187  }
188
189  @Override
190  public CompletableFuture<Boolean> isTableEnabled(TableName tableName) {
191    return wrap(rawAdmin.isTableEnabled(tableName));
192  }
193
194  @Override
195  public CompletableFuture<Boolean> isTableDisabled(TableName tableName) {
196    return wrap(rawAdmin.isTableDisabled(tableName));
197  }
198
199  @Override
200  public CompletableFuture<Boolean> isTableAvailable(TableName tableName) {
201    return wrap(rawAdmin.isTableAvailable(tableName));
202  }
203
204  @Override
205  public CompletableFuture<Void> addColumnFamily(TableName tableName,
206    ColumnFamilyDescriptor columnFamily) {
207    return wrap(rawAdmin.addColumnFamily(tableName, columnFamily));
208  }
209
210  @Override
211  public CompletableFuture<Void> deleteColumnFamily(TableName tableName, byte[] columnFamily) {
212    return wrap(rawAdmin.deleteColumnFamily(tableName, columnFamily));
213  }
214
215  @Override
216  public CompletableFuture<Void> modifyColumnFamily(TableName tableName,
217    ColumnFamilyDescriptor columnFamily) {
218    return wrap(rawAdmin.modifyColumnFamily(tableName, columnFamily));
219  }
220
221  @Override
222  public CompletableFuture<Void> modifyColumnFamilyStoreFileTracker(TableName tableName,
223    byte[] family, String dstSFT) {
224    return wrap(rawAdmin.modifyColumnFamilyStoreFileTracker(tableName, family, dstSFT));
225  }
226
227  @Override
228  public CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor) {
229    return wrap(rawAdmin.createNamespace(descriptor));
230  }
231
232  @Override
233  public CompletableFuture<Void> modifyNamespace(NamespaceDescriptor descriptor) {
234    return wrap(rawAdmin.modifyNamespace(descriptor));
235  }
236
237  @Override
238  public CompletableFuture<Void> deleteNamespace(String name) {
239    return wrap(rawAdmin.deleteNamespace(name));
240  }
241
242  @Override
243  public CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(String name) {
244    return wrap(rawAdmin.getNamespaceDescriptor(name));
245  }
246
247  @Override
248  public CompletableFuture<List<String>> listNamespaces() {
249    return wrap(rawAdmin.listNamespaces());
250  }
251
252  @Override
253  public CompletableFuture<List<NamespaceDescriptor>> listNamespaceDescriptors() {
254    return wrap(rawAdmin.listNamespaceDescriptors());
255  }
256
257  @Override
258  public CompletableFuture<List<RegionInfo>> getRegions(ServerName serverName) {
259    return wrap(rawAdmin.getRegions(serverName));
260  }
261
262  @Override
263  public CompletableFuture<List<RegionInfo>> getRegions(TableName tableName) {
264    return wrap(rawAdmin.getRegions(tableName));
265  }
266
267  @Override
268  public CompletableFuture<Void> flush(TableName tableName) {
269    return wrap(rawAdmin.flush(tableName));
270  }
271
272  @Override
273  public CompletableFuture<Void> flush(TableName tableName, byte[] columnFamily) {
274    return wrap(rawAdmin.flush(tableName, columnFamily));
275  }
276
277  @Override
278  public CompletableFuture<Void> flush(TableName tableName, List<byte[]> columnFamilies) {
279    return wrap(rawAdmin.flush(tableName, columnFamilies));
280  }
281
282  @Override
283  public CompletableFuture<Void> flushRegion(byte[] regionName) {
284    return wrap(rawAdmin.flushRegion(regionName));
285  }
286
287  @Override
288  public CompletableFuture<Void> flushRegion(byte[] regionName, byte[] columnFamily) {
289    return wrap(rawAdmin.flushRegion(regionName, columnFamily));
290  }
291
292  @Override
293  public CompletableFuture<Void> flushRegionServer(ServerName sn) {
294    return wrap(rawAdmin.flushRegionServer(sn));
295  }
296
297  @Override
298  public CompletableFuture<Void> compact(TableName tableName, CompactType compactType) {
299    return wrap(rawAdmin.compact(tableName, compactType));
300  }
301
302  @Override
303  public CompletableFuture<Void> compact(TableName tableName, byte[] columnFamily,
304    CompactType compactType) {
305    return wrap(rawAdmin.compact(tableName, columnFamily, compactType));
306  }
307
308  @Override
309  public CompletableFuture<Void> compactRegion(byte[] regionName) {
310    return wrap(rawAdmin.compactRegion(regionName));
311  }
312
313  @Override
314  public CompletableFuture<Void> compactRegion(byte[] regionName, byte[] columnFamily) {
315    return wrap(rawAdmin.compactRegion(regionName, columnFamily));
316  }
317
318  @Override
319  public CompletableFuture<Void> majorCompact(TableName tableName, CompactType compactType) {
320    return wrap(rawAdmin.majorCompact(tableName, compactType));
321  }
322
323  @Override
324  public CompletableFuture<Void> majorCompact(TableName tableName, byte[] columnFamily,
325    CompactType compactType) {
326    return wrap(rawAdmin.majorCompact(tableName, columnFamily, compactType));
327  }
328
329  @Override
330  public CompletableFuture<Void> majorCompactRegion(byte[] regionName) {
331    return wrap(rawAdmin.majorCompactRegion(regionName));
332  }
333
334  @Override
335  public CompletableFuture<Void> majorCompactRegion(byte[] regionName, byte[] columnFamily) {
336    return wrap(rawAdmin.majorCompactRegion(regionName, columnFamily));
337  }
338
339  @Override
340  public CompletableFuture<Void> compactRegionServer(ServerName serverName) {
341    return wrap(rawAdmin.compactRegionServer(serverName));
342  }
343
344  @Override
345  public CompletableFuture<Void> majorCompactRegionServer(ServerName serverName) {
346    return wrap(rawAdmin.majorCompactRegionServer(serverName));
347  }
348
349  @Override
350  public CompletableFuture<Boolean> mergeSwitch(boolean enabled, boolean drainMerges) {
351    return wrap(rawAdmin.mergeSwitch(enabled, drainMerges));
352  }
353
354  @Override
355  public CompletableFuture<Boolean> isMergeEnabled() {
356    return wrap(rawAdmin.isMergeEnabled());
357  }
358
359  @Override
360  public CompletableFuture<Boolean> splitSwitch(boolean enabled, boolean drainSplits) {
361    return wrap(rawAdmin.splitSwitch(enabled, drainSplits));
362  }
363
364  @Override
365  public CompletableFuture<Boolean> isSplitEnabled() {
366    return wrap(rawAdmin.isSplitEnabled());
367  }
368
369  @Override
370  public CompletableFuture<Void> mergeRegions(List<byte[]> nameOfRegionsToMerge, boolean forcible) {
371    return wrap(rawAdmin.mergeRegions(nameOfRegionsToMerge, forcible));
372  }
373
374  @Override
375  public CompletableFuture<Void> split(TableName tableName) {
376    return wrap(rawAdmin.split(tableName));
377  }
378
379  @Override
380  public CompletableFuture<Void> split(TableName tableName, byte[] splitPoint) {
381    return wrap(rawAdmin.split(tableName, splitPoint));
382  }
383
384  @Override
385  public CompletableFuture<Void> splitRegion(byte[] regionName) {
386    return wrap(rawAdmin.splitRegion(regionName));
387  }
388
389  @Override
390  public CompletableFuture<Void> splitRegion(byte[] regionName, byte[] splitPoint) {
391    return wrap(rawAdmin.splitRegion(regionName, splitPoint));
392  }
393
394  @Override
395  public CompletableFuture<Void> truncateRegion(byte[] regionName) {
396    return wrap(rawAdmin.truncateRegion(regionName));
397  }
398
399  @Override
400  public CompletableFuture<Void> assign(byte[] regionName) {
401    return wrap(rawAdmin.assign(regionName));
402  }
403
404  @Override
405  public CompletableFuture<Void> unassign(byte[] regionName) {
406    return wrap(rawAdmin.unassign(regionName));
407  }
408
409  @Override
410  public CompletableFuture<Void> offline(byte[] regionName) {
411    return wrap(rawAdmin.offline(regionName));
412  }
413
414  @Override
415  public CompletableFuture<Void> move(byte[] regionName) {
416    return wrap(rawAdmin.move(regionName));
417  }
418
419  @Override
420  public CompletableFuture<Void> move(byte[] regionName, ServerName destServerName) {
421    return wrap(rawAdmin.move(regionName, destServerName));
422  }
423
424  @Override
425  public CompletableFuture<Void> setQuota(QuotaSettings quota) {
426    return wrap(rawAdmin.setQuota(quota));
427  }
428
429  @Override
430  public CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter) {
431    return wrap(rawAdmin.getQuota(filter));
432  }
433
434  @Override
435  public CompletableFuture<Void> addReplicationPeer(String peerId, ReplicationPeerConfig peerConfig,
436    boolean enabled) {
437    return wrap(rawAdmin.addReplicationPeer(peerId, peerConfig, enabled));
438  }
439
440  @Override
441  public CompletableFuture<Void> removeReplicationPeer(String peerId) {
442    return wrap(rawAdmin.removeReplicationPeer(peerId));
443  }
444
445  @Override
446  public CompletableFuture<Void> enableReplicationPeer(String peerId) {
447    return wrap(rawAdmin.enableReplicationPeer(peerId));
448  }
449
450  @Override
451  public CompletableFuture<Void> disableReplicationPeer(String peerId) {
452    return wrap(rawAdmin.disableReplicationPeer(peerId));
453  }
454
455  @Override
456  public CompletableFuture<ReplicationPeerConfig> getReplicationPeerConfig(String peerId) {
457    return wrap(rawAdmin.getReplicationPeerConfig(peerId));
458  }
459
460  @Override
461  public CompletableFuture<Void> updateReplicationPeerConfig(String peerId,
462    ReplicationPeerConfig peerConfig) {
463    return wrap(rawAdmin.updateReplicationPeerConfig(peerId, peerConfig));
464  }
465
466  @Override
467  public CompletableFuture<Void> transitReplicationPeerSyncReplicationState(String peerId,
468    SyncReplicationState clusterState) {
469    return wrap(rawAdmin.transitReplicationPeerSyncReplicationState(peerId, clusterState));
470  }
471
472  @Override
473  public CompletableFuture<Void> appendReplicationPeerTableCFs(String peerId,
474    Map<TableName, List<String>> tableCfs) {
475    return wrap(rawAdmin.appendReplicationPeerTableCFs(peerId, tableCfs));
476  }
477
478  @Override
479  public CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId,
480    Map<TableName, List<String>> tableCfs) {
481    return wrap(rawAdmin.removeReplicationPeerTableCFs(peerId, tableCfs));
482  }
483
484  @Override
485  public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() {
486    return wrap(rawAdmin.listReplicationPeers());
487  }
488
489  @Override
490  public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers(Pattern pattern) {
491    return wrap(rawAdmin.listReplicationPeers(pattern));
492  }
493
494  @Override
495  public CompletableFuture<List<TableCFs>> listReplicatedTableCFs() {
496    return wrap(rawAdmin.listReplicatedTableCFs());
497  }
498
499  @Override
500  public CompletableFuture<Void> enableTableReplication(TableName tableName) {
501    return wrap(rawAdmin.enableTableReplication(tableName));
502  }
503
504  @Override
505  public CompletableFuture<Void> disableTableReplication(TableName tableName) {
506    return wrap(rawAdmin.disableTableReplication(tableName));
507  }
508
509  @Override
510  public CompletableFuture<Boolean> isReplicationPeerEnabled(String peerId) {
511    return wrap(rawAdmin.isReplicationPeerEnabled(peerId));
512  }
513
514  @Override
515  public CompletableFuture<Boolean> replicationPeerModificationSwitch(boolean on,
516    boolean drainProcedures) {
517    return wrap(rawAdmin.replicationPeerModificationSwitch(on, drainProcedures));
518  }
519
520  @Override
521  public CompletableFuture<Boolean> isReplicationPeerModificationEnabled() {
522    return wrap(rawAdmin.isReplicationPeerModificationEnabled());
523  }
524
525  @Override
526  public CompletableFuture<Void> snapshot(SnapshotDescription snapshot) {
527    return wrap(rawAdmin.snapshot(snapshot));
528  }
529
530  @Override
531  public CompletableFuture<Boolean> isSnapshotFinished(SnapshotDescription snapshot) {
532    return wrap(rawAdmin.isSnapshotFinished(snapshot));
533  }
534
535  @Override
536  public CompletableFuture<Void> restoreSnapshot(String snapshotName) {
537    return wrap(rawAdmin.restoreSnapshot(snapshotName));
538  }
539
540  @Override
541  public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot,
542    boolean restoreAcl) {
543    return wrap(rawAdmin.restoreSnapshot(snapshotName, takeFailSafeSnapshot, restoreAcl));
544  }
545
546  @Override
547  public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName,
548    boolean restoreAcl, String customSFT) {
549    return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName, restoreAcl, customSFT));
550  }
551
552  @Override
553  public CompletableFuture<List<SnapshotDescription>> listSnapshots() {
554    return wrap(rawAdmin.listSnapshots());
555  }
556
557  @Override
558  public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern pattern) {
559    return wrap(rawAdmin.listSnapshots(pattern));
560  }
561
562  @Override
563  public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern) {
564    return wrap(rawAdmin.listTableSnapshots(tableNamePattern));
565  }
566
567  @Override
568  public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern,
569    Pattern snapshotNamePattern) {
570    return wrap(rawAdmin.listTableSnapshots(tableNamePattern, snapshotNamePattern));
571  }
572
573  @Override
574  public CompletableFuture<Void> deleteSnapshot(String snapshotName) {
575    return wrap(rawAdmin.deleteSnapshot(snapshotName));
576  }
577
578  @Override
579  public CompletableFuture<Void> deleteSnapshots() {
580    return wrap(rawAdmin.deleteSnapshots());
581  }
582
583  @Override
584  public CompletableFuture<Void> deleteSnapshots(Pattern pattern) {
585    return wrap(rawAdmin.deleteSnapshots(pattern));
586  }
587
588  @Override
589  public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) {
590    return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern));
591  }
592
593  @Override
594  public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern,
595    Pattern snapshotNamePattern) {
596    return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern, snapshotNamePattern));
597  }
598
599  @Override
600  public CompletableFuture<Void> execProcedure(String signature, String instance,
601    Map<String, String> props) {
602    return wrap(rawAdmin.execProcedure(signature, instance, props));
603  }
604
605  @Override
606  public CompletableFuture<byte[]> execProcedureWithReturn(String signature, String instance,
607    Map<String, String> props) {
608    return wrap(rawAdmin.execProcedureWithReturn(signature, instance, props));
609  }
610
611  @Override
612  public CompletableFuture<Boolean> isProcedureFinished(String signature, String instance,
613    Map<String, String> props) {
614    return wrap(rawAdmin.isProcedureFinished(signature, instance, props));
615  }
616
617  @Override
618  public CompletableFuture<Boolean> abortProcedure(long procId, boolean mayInterruptIfRunning) {
619    return wrap(rawAdmin.abortProcedure(procId, mayInterruptIfRunning));
620  }
621
622  @Override
623  public CompletableFuture<String> getProcedures() {
624    return wrap(rawAdmin.getProcedures());
625  }
626
627  @Override
628  public CompletableFuture<String> getLocks() {
629    return wrap(rawAdmin.getLocks());
630  }
631
632  @Override
633  public CompletableFuture<Void> decommissionRegionServers(List<ServerName> servers,
634    boolean offload) {
635    return wrap(rawAdmin.decommissionRegionServers(servers, offload));
636  }
637
638  @Override
639  public CompletableFuture<List<ServerName>> listDecommissionedRegionServers() {
640    return wrap(rawAdmin.listDecommissionedRegionServers());
641  }
642
643  @Override
644  public CompletableFuture<Void> recommissionRegionServer(ServerName server,
645    List<byte[]> encodedRegionNames) {
646    return wrap(rawAdmin.recommissionRegionServer(server, encodedRegionNames));
647  }
648
649  @Override
650  public CompletableFuture<ClusterMetrics> getClusterMetrics() {
651    return getClusterMetrics(EnumSet.allOf(Option.class));
652  }
653
654  @Override
655  public CompletableFuture<ClusterMetrics> getClusterMetrics(EnumSet<Option> options) {
656    return wrap(rawAdmin.getClusterMetrics(options));
657  }
658
659  @Override
660  public CompletableFuture<Void> shutdown() {
661    return wrap(rawAdmin.shutdown());
662  }
663
664  @Override
665  public CompletableFuture<Void> stopMaster() {
666    return wrap(rawAdmin.stopMaster());
667  }
668
669  @Override
670  public CompletableFuture<Void> stopRegionServer(ServerName serverName) {
671    return wrap(rawAdmin.stopRegionServer(serverName));
672  }
673
674  @Override
675  public CompletableFuture<Void> updateConfiguration(ServerName serverName) {
676    return wrap(rawAdmin.updateConfiguration(serverName));
677  }
678
679  @Override
680  public CompletableFuture<Void> updateConfiguration() {
681    return wrap(rawAdmin.updateConfiguration());
682  }
683
684  @Override
685  public CompletableFuture<Void> updateConfiguration(String groupName) {
686    return wrap(rawAdmin.updateConfiguration(groupName));
687  }
688
689  @Override
690  public CompletableFuture<Void> rollWALWriter(ServerName serverName) {
691    return wrap(rawAdmin.rollWALWriter(serverName));
692  }
693
694  @Override
695  public CompletableFuture<Void> clearCompactionQueues(ServerName serverName, Set<String> queues) {
696    return wrap(rawAdmin.clearCompactionQueues(serverName, queues));
697  }
698
699  @Override
700  public CompletableFuture<List<SecurityCapability>> getSecurityCapabilities() {
701    return wrap(rawAdmin.getSecurityCapabilities());
702  }
703
704  @Override
705  public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName) {
706    return wrap(rawAdmin.getRegionMetrics(serverName));
707  }
708
709  @Override
710  public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName,
711    TableName tableName) {
712    return wrap(rawAdmin.getRegionMetrics(serverName, tableName));
713  }
714
715  @Override
716  public CompletableFuture<Boolean> isMasterInMaintenanceMode() {
717    return wrap(rawAdmin.isMasterInMaintenanceMode());
718  }
719
720  @Override
721  public CompletableFuture<CompactionState> getCompactionState(TableName tableName,
722    CompactType compactType) {
723    return wrap(rawAdmin.getCompactionState(tableName, compactType));
724  }
725
726  @Override
727  public CompletableFuture<CompactionState> getCompactionStateForRegion(byte[] regionName) {
728    return wrap(rawAdmin.getCompactionStateForRegion(regionName));
729  }
730
731  @Override
732  public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestamp(TableName tableName) {
733    return wrap(rawAdmin.getLastMajorCompactionTimestamp(tableName));
734  }
735
736  @Override
737  public CompletableFuture<Optional<Long>>
738    getLastMajorCompactionTimestampForRegion(byte[] regionName) {
739    return wrap(rawAdmin.getLastMajorCompactionTimestampForRegion(regionName));
740  }
741
742  @Override
743  public CompletableFuture<Boolean> balancerSwitch(boolean on, boolean drainRITs) {
744    return wrap(rawAdmin.balancerSwitch(on, drainRITs));
745  }
746
747  @Override
748  public CompletableFuture<BalanceResponse> balance(BalanceRequest request) {
749    return wrap(rawAdmin.balance(request));
750  }
751
752  @Override
753  public CompletableFuture<Boolean> isBalancerEnabled() {
754    return wrap(rawAdmin.isBalancerEnabled());
755  }
756
757  @Override
758  public CompletableFuture<Boolean> normalizerSwitch(boolean on) {
759    return wrap(rawAdmin.normalizerSwitch(on));
760  }
761
762  @Override
763  public CompletableFuture<Boolean> isNormalizerEnabled() {
764    return wrap(rawAdmin.isNormalizerEnabled());
765  }
766
767  @Override
768  public CompletableFuture<Boolean> normalize(NormalizeTableFilterParams ntfp) {
769    return wrap(rawAdmin.normalize(ntfp));
770  }
771
772  @Override
773  public CompletableFuture<Boolean> cleanerChoreSwitch(boolean enabled) {
774    return wrap(rawAdmin.cleanerChoreSwitch(enabled));
775  }
776
777  @Override
778  public CompletableFuture<Boolean> isCleanerChoreEnabled() {
779    return wrap(rawAdmin.isCleanerChoreEnabled());
780  }
781
782  @Override
783  public CompletableFuture<Boolean> runCleanerChore() {
784    return wrap(rawAdmin.runCleanerChore());
785  }
786
787  @Override
788  public CompletableFuture<Boolean> catalogJanitorSwitch(boolean enabled) {
789    return wrap(rawAdmin.catalogJanitorSwitch(enabled));
790  }
791
792  @Override
793  public CompletableFuture<Boolean> isCatalogJanitorEnabled() {
794    return wrap(rawAdmin.isCatalogJanitorEnabled());
795  }
796
797  @Override
798  public CompletableFuture<Integer> runCatalogJanitor() {
799    return wrap(rawAdmin.runCatalogJanitor());
800  }
801
802  @Override
803  public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker,
804    ServiceCaller<S, R> callable) {
805    return wrap(rawAdmin.coprocessorService(stubMaker, callable));
806  }
807
808  @Override
809  public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker,
810    ServiceCaller<S, R> callable, ServerName serverName) {
811    return wrap(rawAdmin.coprocessorService(stubMaker, callable, serverName));
812  }
813
814  @Override
815  public CompletableFuture<List<ServerName>> listDeadServers() {
816    return wrap(rawAdmin.listDeadServers());
817  }
818
819  @Override
820  public CompletableFuture<List<ServerName>> listUnknownServers() {
821    return wrap(rawAdmin.listUnknownServers());
822  }
823
824  @Override
825  public CompletableFuture<List<ServerName>> clearDeadServers(List<ServerName> servers) {
826    return wrap(rawAdmin.clearDeadServers(servers));
827  }
828
829  @Override
830  public CompletableFuture<CacheEvictionStats> clearBlockCache(TableName tableName) {
831    return wrap(rawAdmin.clearBlockCache(tableName));
832  }
833
834  @Override
835  public CompletableFuture<Void> cloneTableSchema(TableName tableName, TableName newTableName,
836    boolean preserveSplits) {
837    return wrap(rawAdmin.cloneTableSchema(tableName, newTableName, preserveSplits));
838  }
839
840  @Override
841  public CompletableFuture<Map<ServerName, Boolean>> compactionSwitch(boolean switchState,
842    List<String> serverNamesList) {
843    return wrap(rawAdmin.compactionSwitch(switchState, serverNamesList));
844  }
845
846  @Override
847  public CompletableFuture<Boolean> switchRpcThrottle(boolean enable) {
848    return wrap(rawAdmin.switchRpcThrottle(enable));
849  }
850
851  @Override
852  public CompletableFuture<Boolean> isRpcThrottleEnabled() {
853    return wrap(rawAdmin.isRpcThrottleEnabled());
854  }
855
856  @Override
857  public CompletableFuture<Boolean> exceedThrottleQuotaSwitch(boolean enable) {
858    return wrap(rawAdmin.exceedThrottleQuotaSwitch(enable));
859  }
860
861  @Override
862  public CompletableFuture<Map<TableName, Long>> getSpaceQuotaTableSizes() {
863    return wrap(rawAdmin.getSpaceQuotaTableSizes());
864  }
865
866  @Override
867  public CompletableFuture<Map<TableName, SpaceQuotaSnapshot>>
868    getRegionServerSpaceQuotaSnapshots(ServerName serverName) {
869    return wrap(rawAdmin.getRegionServerSpaceQuotaSnapshots(serverName));
870  }
871
872  @Override
873  public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(String namespace) {
874    return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(namespace));
875  }
876
877  @Override
878  public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(TableName tableName) {
879    return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(tableName));
880  }
881
882  @Override
883  public CompletableFuture<Void> grant(UserPermission userPermission,
884    boolean mergeExistingPermissions) {
885    return wrap(rawAdmin.grant(userPermission, mergeExistingPermissions));
886  }
887
888  @Override
889  public CompletableFuture<Void> revoke(UserPermission userPermission) {
890    return wrap(rawAdmin.revoke(userPermission));
891  }
892
893  @Override
894  public CompletableFuture<List<UserPermission>>
895    getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) {
896    return wrap(rawAdmin.getUserPermissions(getUserPermissionsRequest));
897  }
898
899  @Override
900  public CompletableFuture<List<Boolean>> hasUserPermissions(String userName,
901    List<Permission> permissions) {
902    return wrap(rawAdmin.hasUserPermissions(userName, permissions));
903  }
904
905  @Override
906  public CompletableFuture<Boolean> snapshotCleanupSwitch(final boolean on, final boolean sync) {
907    return wrap(rawAdmin.snapshotCleanupSwitch(on, sync));
908  }
909
910  @Override
911  public CompletableFuture<Boolean> isSnapshotCleanupEnabled() {
912    return wrap(rawAdmin.isSnapshotCleanupEnabled());
913  }
914
915  @Override
916  public CompletableFuture<List<Boolean>> clearSlowLogResponses(Set<ServerName> serverNames) {
917    return wrap(rawAdmin.clearSlowLogResponses(serverNames));
918  }
919
920  @Override
921  public CompletableFuture<RSGroupInfo> getRSGroup(String groupName) {
922    return wrap(rawAdmin.getRSGroup(groupName));
923  }
924
925  @Override
926  public CompletableFuture<Void> moveServersToRSGroup(Set<Address> servers, String groupName) {
927    return wrap(rawAdmin.moveServersToRSGroup(servers, groupName));
928  }
929
930  @Override
931  public CompletableFuture<Void> addRSGroup(String groupName) {
932    return wrap(rawAdmin.addRSGroup(groupName));
933  }
934
935  @Override
936  public CompletableFuture<Void> removeRSGroup(String groupName) {
937    return wrap(rawAdmin.removeRSGroup(groupName));
938  }
939
940  @Override
941  public CompletableFuture<BalanceResponse> balanceRSGroup(String groupName,
942    BalanceRequest request) {
943    return wrap(rawAdmin.balanceRSGroup(groupName, request));
944  }
945
946  @Override
947  public CompletableFuture<List<RSGroupInfo>> listRSGroups() {
948    return wrap(rawAdmin.listRSGroups());
949  }
950
951  @Override
952  public CompletableFuture<List<TableName>> listTablesInRSGroup(String groupName) {
953    return wrap(rawAdmin.listTablesInRSGroup(groupName));
954  }
955
956  @Override
957  public CompletableFuture<Pair<List<String>, List<TableName>>>
958    getConfiguredNamespacesAndTablesInRSGroup(String groupName) {
959    return wrap(rawAdmin.getConfiguredNamespacesAndTablesInRSGroup(groupName));
960  }
961
962  @Override
963  public CompletableFuture<RSGroupInfo> getRSGroup(Address hostPort) {
964    return wrap(rawAdmin.getRSGroup(hostPort));
965  }
966
967  @Override
968  public CompletableFuture<Void> removeServersFromRSGroup(Set<Address> servers) {
969    return wrap(rawAdmin.removeServersFromRSGroup(servers));
970  }
971
972  @Override
973  public CompletableFuture<RSGroupInfo> getRSGroup(TableName tableName) {
974    return wrap(rawAdmin.getRSGroup(tableName));
975  }
976
977  @Override
978  public CompletableFuture<Void> setRSGroup(Set<TableName> tables, String groupName) {
979    return wrap(rawAdmin.setRSGroup(tables, groupName));
980  }
981
982  @Override
983  public CompletableFuture<Void> renameRSGroup(String oldName, String newName) {
984    return wrap(rawAdmin.renameRSGroup(oldName, newName));
985  }
986
987  @Override
988  public CompletableFuture<Void> updateRSGroupConfig(String groupName,
989    Map<String, String> configuration) {
990    return wrap(rawAdmin.updateRSGroupConfig(groupName, configuration));
991  }
992
993  @Override
994  public CompletableFuture<List<LogEntry>> getLogEntries(Set<ServerName> serverNames,
995    String logType, ServerType serverType, int limit, Map<String, Object> filterParams) {
996    return wrap(rawAdmin.getLogEntries(serverNames, logType, serverType, limit, filterParams));
997  }
998
999  @Override
1000  public CompletableFuture<Void> flushMasterStore() {
1001    return wrap(rawAdmin.flushMasterStore());
1002  }
1003
1004  @Override
1005  public CompletableFuture<List<String>> getCachedFilesList(ServerName serverName) {
1006    return wrap(rawAdmin.getCachedFilesList(serverName));
1007  }
1008}