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 com.google.protobuf.RpcChannel; 021import java.util.EnumSet; 022import java.util.List; 023import java.util.Map; 024import java.util.Optional; 025import java.util.Set; 026import java.util.concurrent.CompletableFuture; 027import java.util.concurrent.ExecutorService; 028import java.util.function.Function; 029import java.util.regex.Pattern; 030import org.apache.hadoop.hbase.CacheEvictionStats; 031import org.apache.hadoop.hbase.ClusterMetrics; 032import org.apache.hadoop.hbase.ClusterMetrics.Option; 033import org.apache.hadoop.hbase.NamespaceDescriptor; 034import org.apache.hadoop.hbase.RegionMetrics; 035import org.apache.hadoop.hbase.ServerName; 036import org.apache.hadoop.hbase.TableName; 037import org.apache.hadoop.hbase.client.replication.TableCFs; 038import org.apache.hadoop.hbase.client.security.SecurityCapability; 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.security.access.GetUserPermissionsRequest; 045import org.apache.hadoop.hbase.security.access.Permission; 046import org.apache.hadoop.hbase.security.access.UserPermission; 047import org.apache.hadoop.hbase.util.FutureUtils; 048import org.apache.yetus.audience.InterfaceAudience; 049 050/** 051 * Just a wrapper of {@link RawAsyncHBaseAdmin}. The difference is that users need to provide a 052 * thread pool when constructing this class, and the callback methods registered to the returned 053 * {@link CompletableFuture} will be executed in this thread pool. So usually it is safe for users 054 * to do anything they want in the callbacks without breaking the rpc framework. 055 * @since 2.0.0 056 * @see RawAsyncHBaseAdmin 057 * @see AsyncConnection#getAdmin(ExecutorService) 058 * @see AsyncConnection#getAdminBuilder(ExecutorService) 059 */ 060@InterfaceAudience.Private 061class AsyncHBaseAdmin implements AsyncAdmin { 062 063 private final RawAsyncHBaseAdmin rawAdmin; 064 065 private final ExecutorService pool; 066 067 AsyncHBaseAdmin(RawAsyncHBaseAdmin rawAdmin, ExecutorService pool) { 068 this.rawAdmin = rawAdmin; 069 this.pool = pool; 070 } 071 072 private <T> CompletableFuture<T> wrap(CompletableFuture<T> future) { 073 return FutureUtils.wrapFuture(future, pool); 074 } 075 076 @Override 077 public CompletableFuture<Boolean> tableExists(TableName tableName) { 078 return wrap(rawAdmin.tableExists(tableName)); 079 } 080 081 @Override 082 public CompletableFuture<List<TableDescriptor>> listTableDescriptors(boolean includeSysTables) { 083 return wrap(rawAdmin.listTableDescriptors(includeSysTables)); 084 } 085 086 @Override 087 public CompletableFuture<List<TableDescriptor>> listTableDescriptors(Pattern pattern, 088 boolean includeSysTables) { 089 return wrap(rawAdmin.listTableDescriptors(pattern, includeSysTables)); 090 } 091 092 @Override 093 public CompletableFuture<List<TableDescriptor>> listTableDescriptors(List<TableName> tableNames) { 094 return wrap(rawAdmin.listTableDescriptors(tableNames)); 095 } 096 097 @Override 098 public CompletableFuture<List<TableDescriptor>> listTableDescriptorsByNamespace(String name) { 099 return wrap(rawAdmin.listTableDescriptorsByNamespace(name)); 100 } 101 102 @Override 103 public CompletableFuture<List<TableDescriptor>> listTableDescriptorsByState(boolean isEnabled) { 104 return wrap(rawAdmin.listTableDescriptorsByState(isEnabled)); 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<List<TableName>> listTableNamesByState(boolean isEnabled) { 125 return wrap(rawAdmin.listTableNamesByState(isEnabled)); 126 } 127 128 @Override 129 public CompletableFuture<TableDescriptor> getDescriptor(TableName tableName) { 130 return wrap(rawAdmin.getDescriptor(tableName)); 131 } 132 133 @Override 134 public CompletableFuture<Void> createTable(TableDescriptor desc) { 135 return wrap(rawAdmin.createTable(desc)); 136 } 137 138 @Override 139 public CompletableFuture<Void> createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, 140 int numRegions) { 141 return wrap(rawAdmin.createTable(desc, startKey, endKey, numRegions)); 142 } 143 144 @Override 145 public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) { 146 return wrap(rawAdmin.createTable(desc, splitKeys)); 147 } 148 149 @Override 150 public CompletableFuture<Void> modifyTable(TableDescriptor desc) { 151 return modifyTable(desc, true); 152 } 153 154 @Override 155 public CompletableFuture<Void> modifyTable(TableDescriptor desc, boolean reopenRegions) { 156 return wrap(rawAdmin.modifyTable(desc, reopenRegions)); 157 } 158 159 @Override 160 public CompletableFuture<Void> modifyTableStoreFileTracker(TableName tableName, String dstSFT) { 161 return wrap(rawAdmin.modifyTableStoreFileTracker(tableName, dstSFT)); 162 } 163 164 @Override 165 public CompletableFuture<Void> deleteTable(TableName tableName) { 166 return wrap(rawAdmin.deleteTable(tableName)); 167 } 168 169 @Override 170 public CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits) { 171 return wrap(rawAdmin.truncateTable(tableName, preserveSplits)); 172 } 173 174 @Override 175 public CompletableFuture<Void> enableTable(TableName tableName) { 176 return wrap(rawAdmin.enableTable(tableName)); 177 } 178 179 @Override 180 public CompletableFuture<Void> disableTable(TableName tableName) { 181 return wrap(rawAdmin.disableTable(tableName)); 182 } 183 184 @Override 185 public CompletableFuture<Boolean> isTableEnabled(TableName tableName) { 186 return wrap(rawAdmin.isTableEnabled(tableName)); 187 } 188 189 @Override 190 public CompletableFuture<Boolean> isTableDisabled(TableName tableName) { 191 return wrap(rawAdmin.isTableDisabled(tableName)); 192 } 193 194 @Override 195 public CompletableFuture<Boolean> isTableAvailable(TableName tableName) { 196 return wrap(rawAdmin.isTableAvailable(tableName)); 197 } 198 199 @Override 200 public CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys) { 201 return wrap(rawAdmin.isTableAvailable(tableName, splitKeys)); 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> appendReplicationPeerTableCFs(String peerId, 468 Map<TableName, List<String>> tableCfs) { 469 return wrap(rawAdmin.appendReplicationPeerTableCFs(peerId, tableCfs)); 470 } 471 472 @Override 473 public CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId, 474 Map<TableName, List<String>> tableCfs) { 475 return wrap(rawAdmin.removeReplicationPeerTableCFs(peerId, tableCfs)); 476 } 477 478 @Override 479 public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() { 480 return wrap(rawAdmin.listReplicationPeers()); 481 } 482 483 @Override 484 public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers(Pattern pattern) { 485 return wrap(rawAdmin.listReplicationPeers(pattern)); 486 } 487 488 @Override 489 public CompletableFuture<List<TableCFs>> listReplicatedTableCFs() { 490 return wrap(rawAdmin.listReplicatedTableCFs()); 491 } 492 493 @Override 494 public CompletableFuture<Void> enableTableReplication(TableName tableName) { 495 return wrap(rawAdmin.enableTableReplication(tableName)); 496 } 497 498 @Override 499 public CompletableFuture<Void> disableTableReplication(TableName tableName) { 500 return wrap(rawAdmin.disableTableReplication(tableName)); 501 } 502 503 @Override 504 public CompletableFuture<Boolean> isReplicationPeerEnabled(String peerId) { 505 return wrap(rawAdmin.isReplicationPeerEnabled(peerId)); 506 } 507 508 @Override 509 public CompletableFuture<Boolean> replicationPeerModificationSwitch(boolean on, 510 boolean drainProcedures) { 511 return wrap(rawAdmin.replicationPeerModificationSwitch(on, drainProcedures)); 512 } 513 514 @Override 515 public CompletableFuture<Boolean> isReplicationPeerModificationEnabled() { 516 return wrap(rawAdmin.isReplicationPeerModificationEnabled()); 517 } 518 519 @Override 520 public CompletableFuture<Void> snapshot(SnapshotDescription snapshot) { 521 return wrap(rawAdmin.snapshot(snapshot)); 522 } 523 524 @Override 525 public CompletableFuture<Boolean> isSnapshotFinished(SnapshotDescription snapshot) { 526 return wrap(rawAdmin.isSnapshotFinished(snapshot)); 527 } 528 529 @Override 530 public CompletableFuture<Void> restoreSnapshot(String snapshotName) { 531 return wrap(rawAdmin.restoreSnapshot(snapshotName)); 532 } 533 534 @Override 535 public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot, 536 boolean restoreAcl) { 537 return wrap(rawAdmin.restoreSnapshot(snapshotName, takeFailSafeSnapshot, restoreAcl)); 538 } 539 540 @Override 541 public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName, 542 boolean restoreAcl, String customSFT) { 543 return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName, restoreAcl, customSFT)); 544 } 545 546 @Override 547 public CompletableFuture<List<SnapshotDescription>> listSnapshots() { 548 return wrap(rawAdmin.listSnapshots()); 549 } 550 551 @Override 552 public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern pattern) { 553 return wrap(rawAdmin.listSnapshots(pattern)); 554 } 555 556 @Override 557 public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern) { 558 return wrap(rawAdmin.listTableSnapshots(tableNamePattern)); 559 } 560 561 @Override 562 public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern, 563 Pattern snapshotNamePattern) { 564 return wrap(rawAdmin.listTableSnapshots(tableNamePattern, snapshotNamePattern)); 565 } 566 567 @Override 568 public CompletableFuture<Void> deleteSnapshot(String snapshotName) { 569 return wrap(rawAdmin.deleteSnapshot(snapshotName)); 570 } 571 572 @Override 573 public CompletableFuture<Void> deleteSnapshots() { 574 return wrap(rawAdmin.deleteSnapshots()); 575 } 576 577 @Override 578 public CompletableFuture<Void> deleteSnapshots(Pattern pattern) { 579 return wrap(rawAdmin.deleteSnapshots(pattern)); 580 } 581 582 @Override 583 public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) { 584 return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern)); 585 } 586 587 @Override 588 public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern, 589 Pattern snapshotNamePattern) { 590 return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern, snapshotNamePattern)); 591 } 592 593 @Override 594 public CompletableFuture<Void> execProcedure(String signature, String instance, 595 Map<String, String> props) { 596 return wrap(rawAdmin.execProcedure(signature, instance, props)); 597 } 598 599 @Override 600 public CompletableFuture<byte[]> execProcedureWithReturn(String signature, String instance, 601 Map<String, String> props) { 602 return wrap(rawAdmin.execProcedureWithReturn(signature, instance, props)); 603 } 604 605 @Override 606 public CompletableFuture<Boolean> isProcedureFinished(String signature, String instance, 607 Map<String, String> props) { 608 return wrap(rawAdmin.isProcedureFinished(signature, instance, props)); 609 } 610 611 @Override 612 public CompletableFuture<Boolean> abortProcedure(long procId, boolean mayInterruptIfRunning) { 613 return wrap(rawAdmin.abortProcedure(procId, mayInterruptIfRunning)); 614 } 615 616 @Override 617 public CompletableFuture<String> getProcedures() { 618 return wrap(rawAdmin.getProcedures()); 619 } 620 621 @Override 622 public CompletableFuture<String> getLocks() { 623 return wrap(rawAdmin.getLocks()); 624 } 625 626 @Override 627 public CompletableFuture<Void> decommissionRegionServers(List<ServerName> servers, 628 boolean offload) { 629 return wrap(rawAdmin.decommissionRegionServers(servers, offload)); 630 } 631 632 @Override 633 public CompletableFuture<List<ServerName>> listDecommissionedRegionServers() { 634 return wrap(rawAdmin.listDecommissionedRegionServers()); 635 } 636 637 @Override 638 public CompletableFuture<Void> recommissionRegionServer(ServerName server, 639 List<byte[]> encodedRegionNames) { 640 return wrap(rawAdmin.recommissionRegionServer(server, encodedRegionNames)); 641 } 642 643 @Override 644 public CompletableFuture<ClusterMetrics> getClusterMetrics() { 645 return getClusterMetrics(EnumSet.allOf(Option.class)); 646 } 647 648 @Override 649 public CompletableFuture<ClusterMetrics> getClusterMetrics(EnumSet<Option> options) { 650 return wrap(rawAdmin.getClusterMetrics(options)); 651 } 652 653 @Override 654 public CompletableFuture<Void> shutdown() { 655 return wrap(rawAdmin.shutdown()); 656 } 657 658 @Override 659 public CompletableFuture<Void> stopMaster() { 660 return wrap(rawAdmin.stopMaster()); 661 } 662 663 @Override 664 public CompletableFuture<Void> stopRegionServer(ServerName serverName) { 665 return wrap(rawAdmin.stopRegionServer(serverName)); 666 } 667 668 @Override 669 public CompletableFuture<Void> updateConfiguration(ServerName serverName) { 670 return wrap(rawAdmin.updateConfiguration(serverName)); 671 } 672 673 @Override 674 public CompletableFuture<Void> updateConfiguration() { 675 return wrap(rawAdmin.updateConfiguration()); 676 } 677 678 @Override 679 public CompletableFuture<Void> rollWALWriter(ServerName serverName) { 680 return wrap(rawAdmin.rollWALWriter(serverName)); 681 } 682 683 @Override 684 public CompletableFuture<Void> clearCompactionQueues(ServerName serverName, Set<String> queues) { 685 return wrap(rawAdmin.clearCompactionQueues(serverName, queues)); 686 } 687 688 @Override 689 public CompletableFuture<List<SecurityCapability>> getSecurityCapabilities() { 690 return wrap(rawAdmin.getSecurityCapabilities()); 691 } 692 693 @Override 694 public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName) { 695 return wrap(rawAdmin.getRegionMetrics(serverName)); 696 } 697 698 @Override 699 public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName, 700 TableName tableName) { 701 return wrap(rawAdmin.getRegionMetrics(serverName, tableName)); 702 } 703 704 @Override 705 public CompletableFuture<Boolean> isMasterInMaintenanceMode() { 706 return wrap(rawAdmin.isMasterInMaintenanceMode()); 707 } 708 709 @Override 710 public CompletableFuture<CompactionState> getCompactionState(TableName tableName, 711 CompactType compactType) { 712 return wrap(rawAdmin.getCompactionState(tableName, compactType)); 713 } 714 715 @Override 716 public CompletableFuture<CompactionState> getCompactionStateForRegion(byte[] regionName) { 717 return wrap(rawAdmin.getCompactionStateForRegion(regionName)); 718 } 719 720 @Override 721 public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestamp(TableName tableName) { 722 return wrap(rawAdmin.getLastMajorCompactionTimestamp(tableName)); 723 } 724 725 @Override 726 public CompletableFuture<Optional<Long>> 727 getLastMajorCompactionTimestampForRegion(byte[] regionName) { 728 return wrap(rawAdmin.getLastMajorCompactionTimestampForRegion(regionName)); 729 } 730 731 @Override 732 public CompletableFuture<Boolean> balancerSwitch(boolean on, boolean drainRITs) { 733 return wrap(rawAdmin.balancerSwitch(on, drainRITs)); 734 } 735 736 @Override 737 public CompletableFuture<BalanceResponse> balance(BalanceRequest request) { 738 return wrap(rawAdmin.balance(request)); 739 } 740 741 @Override 742 public CompletableFuture<Boolean> isBalancerEnabled() { 743 return wrap(rawAdmin.isBalancerEnabled()); 744 } 745 746 @Override 747 public CompletableFuture<Boolean> normalizerSwitch(boolean on) { 748 return wrap(rawAdmin.normalizerSwitch(on)); 749 } 750 751 @Override 752 public CompletableFuture<Boolean> isNormalizerEnabled() { 753 return wrap(rawAdmin.isNormalizerEnabled()); 754 } 755 756 @Override 757 public CompletableFuture<Boolean> normalize(NormalizeTableFilterParams ntfp) { 758 return wrap(rawAdmin.normalize(ntfp)); 759 } 760 761 @Override 762 public CompletableFuture<Boolean> cleanerChoreSwitch(boolean enabled) { 763 return wrap(rawAdmin.cleanerChoreSwitch(enabled)); 764 } 765 766 @Override 767 public CompletableFuture<Boolean> isCleanerChoreEnabled() { 768 return wrap(rawAdmin.isCleanerChoreEnabled()); 769 } 770 771 @Override 772 public CompletableFuture<Boolean> runCleanerChore() { 773 return wrap(rawAdmin.runCleanerChore()); 774 } 775 776 @Override 777 public CompletableFuture<Boolean> catalogJanitorSwitch(boolean enabled) { 778 return wrap(rawAdmin.catalogJanitorSwitch(enabled)); 779 } 780 781 @Override 782 public CompletableFuture<Boolean> isCatalogJanitorEnabled() { 783 return wrap(rawAdmin.isCatalogJanitorEnabled()); 784 } 785 786 @Override 787 public CompletableFuture<Integer> runCatalogJanitor() { 788 return wrap(rawAdmin.runCatalogJanitor()); 789 } 790 791 @Override 792 public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker, 793 ServiceCaller<S, R> callable) { 794 return wrap(rawAdmin.coprocessorService(stubMaker, callable)); 795 } 796 797 @Override 798 public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker, 799 ServiceCaller<S, R> callable, ServerName serverName) { 800 return wrap(rawAdmin.coprocessorService(stubMaker, callable, serverName)); 801 } 802 803 @Override 804 public CompletableFuture<List<ServerName>> listDeadServers() { 805 return wrap(rawAdmin.listDeadServers()); 806 } 807 808 @Override 809 public CompletableFuture<List<ServerName>> listUnknownServers() { 810 return wrap(rawAdmin.listUnknownServers()); 811 } 812 813 @Override 814 public CompletableFuture<List<ServerName>> clearDeadServers(List<ServerName> servers) { 815 return wrap(rawAdmin.clearDeadServers(servers)); 816 } 817 818 @Override 819 public CompletableFuture<CacheEvictionStats> clearBlockCache(TableName tableName) { 820 return wrap(rawAdmin.clearBlockCache(tableName)); 821 } 822 823 @Override 824 public CompletableFuture<Void> cloneTableSchema(TableName tableName, TableName newTableName, 825 boolean preserveSplits) { 826 return wrap(rawAdmin.cloneTableSchema(tableName, newTableName, preserveSplits)); 827 } 828 829 @Override 830 public CompletableFuture<Map<ServerName, Boolean>> compactionSwitch(boolean switchState, 831 List<String> serverNamesList) { 832 return wrap(rawAdmin.compactionSwitch(switchState, serverNamesList)); 833 } 834 835 @Override 836 public CompletableFuture<Boolean> switchRpcThrottle(boolean enable) { 837 return wrap(rawAdmin.switchRpcThrottle(enable)); 838 } 839 840 @Override 841 public CompletableFuture<Boolean> isRpcThrottleEnabled() { 842 return wrap(rawAdmin.isRpcThrottleEnabled()); 843 } 844 845 @Override 846 public CompletableFuture<Boolean> exceedThrottleQuotaSwitch(boolean enable) { 847 return wrap(rawAdmin.exceedThrottleQuotaSwitch(enable)); 848 } 849 850 @Override 851 public CompletableFuture<Map<TableName, Long>> getSpaceQuotaTableSizes() { 852 return wrap(rawAdmin.getSpaceQuotaTableSizes()); 853 } 854 855 @Override 856 public CompletableFuture<Map<TableName, SpaceQuotaSnapshot>> 857 getRegionServerSpaceQuotaSnapshots(ServerName serverName) { 858 return wrap(rawAdmin.getRegionServerSpaceQuotaSnapshots(serverName)); 859 } 860 861 @Override 862 public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(String namespace) { 863 return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(namespace)); 864 } 865 866 @Override 867 public CompletableFuture<SpaceQuotaSnapshot> getCurrentSpaceQuotaSnapshot(TableName tableName) { 868 return wrap(rawAdmin.getCurrentSpaceQuotaSnapshot(tableName)); 869 } 870 871 @Override 872 public CompletableFuture<Void> grant(UserPermission userPermission, 873 boolean mergeExistingPermissions) { 874 return wrap(rawAdmin.grant(userPermission, mergeExistingPermissions)); 875 } 876 877 @Override 878 public CompletableFuture<Void> revoke(UserPermission userPermission) { 879 return wrap(rawAdmin.revoke(userPermission)); 880 } 881 882 @Override 883 public CompletableFuture<List<UserPermission>> 884 getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) { 885 return wrap(rawAdmin.getUserPermissions(getUserPermissionsRequest)); 886 } 887 888 @Override 889 public CompletableFuture<List<Boolean>> hasUserPermissions(String userName, 890 List<Permission> permissions) { 891 return wrap(rawAdmin.hasUserPermissions(userName, permissions)); 892 } 893 894 @Override 895 public CompletableFuture<Boolean> snapshotCleanupSwitch(final boolean on, final boolean sync) { 896 return wrap(rawAdmin.snapshotCleanupSwitch(on, sync)); 897 } 898 899 @Override 900 public CompletableFuture<Boolean> isSnapshotCleanupEnabled() { 901 return wrap(rawAdmin.isSnapshotCleanupEnabled()); 902 } 903 904 @Override 905 public CompletableFuture<List<Boolean>> clearSlowLogResponses(Set<ServerName> serverNames) { 906 return wrap(rawAdmin.clearSlowLogResponses(serverNames)); 907 } 908 909 @Override 910 public CompletableFuture<List<LogEntry>> getLogEntries(Set<ServerName> serverNames, 911 String logType, ServerType serverType, int limit, Map<String, Object> filterParams) { 912 return wrap(rawAdmin.getLogEntries(serverNames, logType, serverType, limit, filterParams)); 913 } 914 915 @Override 916 public CompletableFuture<Void> flushMasterStore() { 917 return wrap(rawAdmin.flushMasterStore()); 918 } 919 920 @Override 921 public CompletableFuture<List<String>> getCachedFilesList(ServerName serverName) { 922 return wrap(rawAdmin.getCachedFilesList(serverName)); 923 } 924}