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.replication.ReplicationPeerConfig; 042import org.apache.hadoop.hbase.replication.ReplicationPeerDescription; 043import org.apache.hadoop.hbase.util.FutureUtils; 044import org.apache.yetus.audience.InterfaceAudience; 045 046/** 047 * Just a wrapper of {@link RawAsyncHBaseAdmin}. The difference is that users need to provide a 048 * thread pool when constructing this class, and the callback methods registered to the returned 049 * {@link CompletableFuture} will be executed in this thread pool. So usually it is safe for users 050 * to do anything they want in the callbacks without breaking the rpc framework. 051 * @since 2.0.0 052 * @see RawAsyncHBaseAdmin 053 * @see AsyncConnection#getAdmin(ExecutorService) 054 * @see AsyncConnection#getAdminBuilder(ExecutorService) 055 */ 056@InterfaceAudience.Private 057class AsyncHBaseAdmin implements AsyncAdmin { 058 059 private final RawAsyncHBaseAdmin rawAdmin; 060 061 private final ExecutorService pool; 062 063 AsyncHBaseAdmin(RawAsyncHBaseAdmin rawAdmin, ExecutorService pool) { 064 this.rawAdmin = rawAdmin; 065 this.pool = pool; 066 } 067 068 private <T> CompletableFuture<T> wrap(CompletableFuture<T> future) { 069 return FutureUtils.wrapFuture(future, pool); 070 } 071 072 @Override 073 public CompletableFuture<Boolean> tableExists(TableName tableName) { 074 return wrap(rawAdmin.tableExists(tableName)); 075 } 076 077 @Override 078 public CompletableFuture<List<TableDescriptor>> listTableDescriptors(boolean includeSysTables) { 079 return wrap(rawAdmin.listTableDescriptors(includeSysTables)); 080 } 081 082 @Override 083 public CompletableFuture<List<TableDescriptor>> listTableDescriptors(Pattern pattern, 084 boolean includeSysTables) { 085 return wrap(rawAdmin.listTableDescriptors(pattern, includeSysTables)); 086 } 087 088 @Override 089 public CompletableFuture<List<TableDescriptor>> listTableDescriptorsByNamespace(String name) { 090 return wrap(rawAdmin.listTableDescriptorsByNamespace(name)); 091 } 092 093 @Override 094 public CompletableFuture<List<TableName>> listTableNames(boolean includeSysTables) { 095 return wrap(rawAdmin.listTableNames(includeSysTables)); 096 } 097 098 @Override 099 public CompletableFuture<List<TableName>> listTableNames(Pattern pattern, 100 boolean includeSysTables) { 101 return wrap(rawAdmin.listTableNames(pattern, includeSysTables)); 102 } 103 104 @Override 105 public CompletableFuture<List<TableName>> listTableNamesByNamespace(String name) { 106 return wrap(rawAdmin.listTableNamesByNamespace(name)); 107 } 108 109 @Override 110 public CompletableFuture<TableDescriptor> getDescriptor(TableName tableName) { 111 return wrap(rawAdmin.getDescriptor(tableName)); 112 } 113 114 @Override 115 public CompletableFuture<Void> createTable(TableDescriptor desc) { 116 return wrap(rawAdmin.createTable(desc)); 117 } 118 119 @Override 120 public CompletableFuture<Void> createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, 121 int numRegions) { 122 return wrap(rawAdmin.createTable(desc, startKey, endKey, numRegions)); 123 } 124 125 @Override 126 public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) { 127 return wrap(rawAdmin.createTable(desc, splitKeys)); 128 } 129 130 @Override 131 public CompletableFuture<Void> modifyTable(TableDescriptor desc) { 132 return wrap(rawAdmin.modifyTable(desc)); 133 } 134 135 @Override 136 public CompletableFuture<Void> deleteTable(TableName tableName) { 137 return wrap(rawAdmin.deleteTable(tableName)); 138 } 139 140 @Override 141 public CompletableFuture<Void> truncateTable(TableName tableName, boolean preserveSplits) { 142 return wrap(rawAdmin.truncateTable(tableName, preserveSplits)); 143 } 144 145 @Override 146 public CompletableFuture<Void> enableTable(TableName tableName) { 147 return wrap(rawAdmin.enableTable(tableName)); 148 } 149 150 @Override 151 public CompletableFuture<Void> disableTable(TableName tableName) { 152 return wrap(rawAdmin.disableTable(tableName)); 153 } 154 155 @Override 156 public CompletableFuture<Boolean> isTableEnabled(TableName tableName) { 157 return wrap(rawAdmin.isTableEnabled(tableName)); 158 } 159 160 @Override 161 public CompletableFuture<Boolean> isTableDisabled(TableName tableName) { 162 return wrap(rawAdmin.isTableDisabled(tableName)); 163 } 164 165 @Override 166 public CompletableFuture<Boolean> isTableAvailable(TableName tableName) { 167 return wrap(rawAdmin.isTableAvailable(tableName)); 168 } 169 170 @Override 171 public CompletableFuture<Boolean> isTableAvailable(TableName tableName, byte[][] splitKeys) { 172 return wrap(rawAdmin.isTableAvailable(tableName, splitKeys)); 173 } 174 175 @Override 176 public CompletableFuture<Void> addColumnFamily(TableName tableName, 177 ColumnFamilyDescriptor columnFamily) { 178 return wrap(rawAdmin.addColumnFamily(tableName, columnFamily)); 179 } 180 181 @Override 182 public CompletableFuture<Void> deleteColumnFamily(TableName tableName, byte[] columnFamily) { 183 return wrap(rawAdmin.deleteColumnFamily(tableName, columnFamily)); 184 } 185 186 @Override 187 public CompletableFuture<Void> modifyColumnFamily(TableName tableName, 188 ColumnFamilyDescriptor columnFamily) { 189 return wrap(rawAdmin.modifyColumnFamily(tableName, columnFamily)); 190 } 191 192 @Override 193 public CompletableFuture<Void> createNamespace(NamespaceDescriptor descriptor) { 194 return wrap(rawAdmin.createNamespace(descriptor)); 195 } 196 197 @Override 198 public CompletableFuture<Void> modifyNamespace(NamespaceDescriptor descriptor) { 199 return wrap(rawAdmin.modifyNamespace(descriptor)); 200 } 201 202 @Override 203 public CompletableFuture<Void> deleteNamespace(String name) { 204 return wrap(rawAdmin.deleteNamespace(name)); 205 } 206 207 @Override 208 public CompletableFuture<NamespaceDescriptor> getNamespaceDescriptor(String name) { 209 return wrap(rawAdmin.getNamespaceDescriptor(name)); 210 } 211 212 @Override 213 public CompletableFuture<List<NamespaceDescriptor>> listNamespaceDescriptors() { 214 return wrap(rawAdmin.listNamespaceDescriptors()); 215 } 216 217 @Override 218 public CompletableFuture<List<RegionInfo>> getRegions(ServerName serverName) { 219 return wrap(rawAdmin.getRegions(serverName)); 220 } 221 222 @Override 223 public CompletableFuture<List<RegionInfo>> getRegions(TableName tableName) { 224 return wrap(rawAdmin.getRegions(tableName)); 225 } 226 227 @Override 228 public CompletableFuture<Void> flush(TableName tableName) { 229 return wrap(rawAdmin.flush(tableName)); 230 } 231 232 @Override 233 public CompletableFuture<Void> flushRegion(byte[] regionName) { 234 return wrap(rawAdmin.flushRegion(regionName)); 235 } 236 237 @Override 238 public CompletableFuture<Void> flushRegionServer(ServerName sn) { 239 return wrap(rawAdmin.flushRegionServer(sn)); 240 } 241 242 @Override 243 public CompletableFuture<Void> compact(TableName tableName, 244 CompactType compactType) { 245 return wrap(rawAdmin.compact(tableName, compactType)); 246 } 247 248 @Override 249 public CompletableFuture<Void> compact(TableName tableName, 250 byte[] columnFamily, CompactType compactType) { 251 return wrap(rawAdmin.compact(tableName, columnFamily, compactType)); 252 } 253 254 @Override 255 public CompletableFuture<Void> compactRegion(byte[] regionName) { 256 return wrap(rawAdmin.compactRegion(regionName)); 257 } 258 259 @Override 260 public CompletableFuture<Void> compactRegion(byte[] regionName, byte[] columnFamily) { 261 return wrap(rawAdmin.compactRegion(regionName, columnFamily)); 262 } 263 264 @Override 265 public CompletableFuture<Void> majorCompact(TableName tableName, CompactType compactType) { 266 return wrap(rawAdmin.majorCompact(tableName, compactType)); 267 } 268 269 @Override 270 public CompletableFuture<Void> majorCompact(TableName tableName, byte[] columnFamily, 271 CompactType compactType) { 272 return wrap(rawAdmin.majorCompact(tableName, columnFamily, compactType)); 273 } 274 275 @Override 276 public CompletableFuture<Void> majorCompactRegion(byte[] regionName) { 277 return wrap(rawAdmin.majorCompactRegion(regionName)); 278 } 279 280 @Override 281 public CompletableFuture<Void> majorCompactRegion(byte[] regionName, byte[] columnFamily) { 282 return wrap(rawAdmin.majorCompactRegion(regionName, columnFamily)); 283 } 284 285 @Override 286 public CompletableFuture<Void> compactRegionServer(ServerName serverName) { 287 return wrap(rawAdmin.compactRegionServer(serverName)); 288 } 289 290 @Override 291 public CompletableFuture<Void> majorCompactRegionServer(ServerName serverName) { 292 return wrap(rawAdmin.majorCompactRegionServer(serverName)); 293 } 294 295 @Override 296 public CompletableFuture<Boolean> mergeSwitch(boolean on) { 297 return wrap(rawAdmin.mergeSwitch(on)); 298 } 299 300 @Override 301 public CompletableFuture<Boolean> isMergeEnabled() { 302 return wrap(rawAdmin.isMergeEnabled()); 303 } 304 305 @Override 306 public CompletableFuture<Boolean> splitSwitch(boolean on) { 307 return wrap(rawAdmin.splitSwitch(on)); 308 } 309 310 @Override 311 public CompletableFuture<Boolean> isSplitEnabled() { 312 return wrap(rawAdmin.isSplitEnabled()); 313 } 314 315 @Override 316 public CompletableFuture<Void> mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, 317 boolean forcible) { 318 return wrap(rawAdmin.mergeRegions(nameOfRegionA, nameOfRegionB, forcible)); 319 } 320 321 @Override 322 public CompletableFuture<Void> split(TableName tableName) { 323 return wrap(rawAdmin.split(tableName)); 324 } 325 326 @Override 327 public CompletableFuture<Void> split(TableName tableName, byte[] splitPoint) { 328 return wrap(rawAdmin.split(tableName, splitPoint)); 329 } 330 331 @Override 332 public CompletableFuture<Void> splitRegion(byte[] regionName) { 333 return wrap(rawAdmin.splitRegion(regionName)); 334 } 335 336 @Override 337 public CompletableFuture<Void> splitRegion(byte[] regionName, byte[] splitPoint) { 338 return wrap(rawAdmin.splitRegion(regionName, splitPoint)); 339 } 340 341 @Override 342 public CompletableFuture<Void> assign(byte[] regionName) { 343 return wrap(rawAdmin.assign(regionName)); 344 } 345 346 @Override 347 public CompletableFuture<Void> unassign(byte[] regionName, boolean forcible) { 348 return wrap(rawAdmin.unassign(regionName, forcible)); 349 } 350 351 @Override 352 public CompletableFuture<Void> offline(byte[] regionName) { 353 return wrap(rawAdmin.offline(regionName)); 354 } 355 356 @Override 357 public CompletableFuture<Void> move(byte[] regionName) { 358 return wrap(rawAdmin.move(regionName)); 359 } 360 361 @Override 362 public CompletableFuture<Void> move(byte[] regionName, ServerName destServerName) { 363 return wrap(rawAdmin.move(regionName, destServerName)); 364 } 365 366 @Override 367 public CompletableFuture<Void> setQuota(QuotaSettings quota) { 368 return wrap(rawAdmin.setQuota(quota)); 369 } 370 371 @Override 372 public CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter) { 373 return wrap(rawAdmin.getQuota(filter)); 374 } 375 376 @Override 377 public CompletableFuture<Void> addReplicationPeer(String peerId, 378 ReplicationPeerConfig peerConfig, boolean enabled) { 379 return wrap(rawAdmin.addReplicationPeer(peerId, peerConfig, enabled)); 380 } 381 382 @Override 383 public CompletableFuture<Void> removeReplicationPeer(String peerId) { 384 return wrap(rawAdmin.removeReplicationPeer(peerId)); 385 } 386 387 @Override 388 public CompletableFuture<Void> enableReplicationPeer(String peerId) { 389 return wrap(rawAdmin.enableReplicationPeer(peerId)); 390 } 391 392 @Override 393 public CompletableFuture<Void> disableReplicationPeer(String peerId) { 394 return wrap(rawAdmin.disableReplicationPeer(peerId)); 395 } 396 397 @Override 398 public CompletableFuture<ReplicationPeerConfig> getReplicationPeerConfig(String peerId) { 399 return wrap(rawAdmin.getReplicationPeerConfig(peerId)); 400 } 401 402 @Override 403 public CompletableFuture<Void> updateReplicationPeerConfig(String peerId, 404 ReplicationPeerConfig peerConfig) { 405 return wrap(rawAdmin.updateReplicationPeerConfig(peerId, peerConfig)); 406 } 407 408 @Override 409 public CompletableFuture<Void> appendReplicationPeerTableCFs(String peerId, 410 Map<TableName, List<String>> tableCfs) { 411 return wrap(rawAdmin.appendReplicationPeerTableCFs(peerId, tableCfs)); 412 } 413 414 @Override 415 public CompletableFuture<Void> removeReplicationPeerTableCFs(String peerId, 416 Map<TableName, List<String>> tableCfs) { 417 return wrap(rawAdmin.removeReplicationPeerTableCFs(peerId, tableCfs)); 418 } 419 420 @Override 421 public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers() { 422 return wrap(rawAdmin.listReplicationPeers()); 423 } 424 425 @Override 426 public CompletableFuture<List<ReplicationPeerDescription>> listReplicationPeers(Pattern pattern) { 427 return wrap(rawAdmin.listReplicationPeers(pattern)); 428 } 429 430 @Override 431 public CompletableFuture<List<TableCFs>> listReplicatedTableCFs() { 432 return wrap(rawAdmin.listReplicatedTableCFs()); 433 } 434 435 @Override 436 public CompletableFuture<Void> enableTableReplication(TableName tableName) { 437 return wrap(rawAdmin.enableTableReplication(tableName)); 438 } 439 440 @Override 441 public CompletableFuture<Void> disableTableReplication(TableName tableName) { 442 return wrap(rawAdmin.disableTableReplication(tableName)); 443 } 444 445 @Override 446 public CompletableFuture<Void> snapshot(SnapshotDescription snapshot) { 447 return wrap(rawAdmin.snapshot(snapshot)); 448 } 449 450 @Override 451 public CompletableFuture<Boolean> isSnapshotFinished(SnapshotDescription snapshot) { 452 return wrap(rawAdmin.isSnapshotFinished(snapshot)); 453 } 454 455 @Override 456 public CompletableFuture<Void> restoreSnapshot(String snapshotName) { 457 return wrap(rawAdmin.restoreSnapshot(snapshotName)); 458 } 459 460 @Override 461 public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot) { 462 return wrap(rawAdmin.restoreSnapshot(snapshotName, takeFailSafeSnapshot)); 463 } 464 465 @Override 466 public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName) { 467 return wrap(rawAdmin.cloneSnapshot(snapshotName, tableName)); 468 } 469 470 @Override 471 public CompletableFuture<List<SnapshotDescription>> listSnapshots() { 472 return wrap(rawAdmin.listSnapshots()); 473 } 474 475 @Override 476 public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern pattern) { 477 return wrap(rawAdmin.listSnapshots(pattern)); 478 } 479 480 @Override 481 public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern) { 482 return wrap(rawAdmin.listTableSnapshots(tableNamePattern)); 483 } 484 485 @Override 486 public CompletableFuture<List<SnapshotDescription>> listTableSnapshots(Pattern tableNamePattern, 487 Pattern snapshotNamePattern) { 488 return wrap(rawAdmin.listTableSnapshots(tableNamePattern, snapshotNamePattern)); 489 } 490 491 @Override 492 public CompletableFuture<Void> deleteSnapshot(String snapshotName) { 493 return wrap(rawAdmin.deleteSnapshot(snapshotName)); 494 } 495 496 @Override 497 public CompletableFuture<Void> deleteSnapshots() { 498 return wrap(rawAdmin.deleteSnapshots()); 499 } 500 501 @Override 502 public CompletableFuture<Void> deleteSnapshots(Pattern pattern) { 503 return wrap(rawAdmin.deleteSnapshots(pattern)); 504 } 505 506 @Override 507 public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) { 508 return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern)); 509 } 510 511 @Override 512 public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern, 513 Pattern snapshotNamePattern) { 514 return wrap(rawAdmin.deleteTableSnapshots(tableNamePattern, snapshotNamePattern)); 515 } 516 517 @Override 518 public CompletableFuture<Void> execProcedure(String signature, String instance, 519 Map<String, String> props) { 520 return wrap(rawAdmin.execProcedure(signature, instance, props)); 521 } 522 523 @Override 524 public CompletableFuture<byte[]> execProcedureWithReturn(String signature, String instance, 525 Map<String, String> props) { 526 return wrap(rawAdmin.execProcedureWithReturn(signature, instance, props)); 527 } 528 529 @Override 530 public CompletableFuture<Boolean> isProcedureFinished(String signature, String instance, 531 Map<String, String> props) { 532 return wrap(rawAdmin.isProcedureFinished(signature, instance, props)); 533 } 534 535 @Override 536 public CompletableFuture<Boolean> abortProcedure(long procId, boolean mayInterruptIfRunning) { 537 return wrap(rawAdmin.abortProcedure(procId, mayInterruptIfRunning)); 538 } 539 540 @Override 541 public CompletableFuture<String> getProcedures() { 542 return wrap(rawAdmin.getProcedures()); 543 } 544 545 @Override 546 public CompletableFuture<String> getLocks() { 547 return wrap(rawAdmin.getLocks()); 548 } 549 550 @Override 551 public CompletableFuture<Void> decommissionRegionServers(List<ServerName> servers, 552 boolean offload) { 553 return wrap(rawAdmin.decommissionRegionServers(servers, offload)); 554 } 555 556 @Override 557 public CompletableFuture<List<ServerName>> listDecommissionedRegionServers() { 558 return wrap(rawAdmin.listDecommissionedRegionServers()); 559 } 560 561 @Override 562 public CompletableFuture<Void> recommissionRegionServer(ServerName server, 563 List<byte[]> encodedRegionNames) { 564 return wrap(rawAdmin.recommissionRegionServer(server, encodedRegionNames)); 565 } 566 567 @Override 568 public CompletableFuture<ClusterMetrics> getClusterMetrics() { 569 return getClusterMetrics(EnumSet.allOf(Option.class)); 570 } 571 572 @Override 573 public CompletableFuture<ClusterMetrics> getClusterMetrics(EnumSet<Option> options) { 574 return wrap(rawAdmin.getClusterMetrics(options)); 575 } 576 577 @Override 578 public CompletableFuture<Void> shutdown() { 579 return wrap(rawAdmin.shutdown()); 580 } 581 582 @Override 583 public CompletableFuture<Void> stopMaster() { 584 return wrap(rawAdmin.stopMaster()); 585 } 586 587 @Override 588 public CompletableFuture<Void> stopRegionServer(ServerName serverName) { 589 return wrap(rawAdmin.stopRegionServer(serverName)); 590 } 591 592 @Override 593 public CompletableFuture<Void> updateConfiguration(ServerName serverName) { 594 return wrap(rawAdmin.updateConfiguration(serverName)); 595 } 596 597 @Override 598 public CompletableFuture<Void> updateConfiguration() { 599 return wrap(rawAdmin.updateConfiguration()); 600 } 601 602 @Override 603 public CompletableFuture<Void> rollWALWriter(ServerName serverName) { 604 return wrap(rawAdmin.rollWALWriter(serverName)); 605 } 606 607 @Override 608 public CompletableFuture<Void> clearCompactionQueues(ServerName serverName, Set<String> queues) { 609 return wrap(rawAdmin.clearCompactionQueues(serverName, queues)); 610 } 611 612 @Override 613 public CompletableFuture<List<SecurityCapability>> getSecurityCapabilities() { 614 return wrap(rawAdmin.getSecurityCapabilities()); 615 } 616 617 @Override 618 public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName) { 619 return wrap(rawAdmin.getRegionMetrics(serverName)); 620 } 621 622 @Override 623 public CompletableFuture<List<RegionMetrics>> getRegionMetrics(ServerName serverName, 624 TableName tableName) { 625 return wrap(rawAdmin.getRegionMetrics(serverName, tableName)); 626 } 627 628 @Override 629 public CompletableFuture<Boolean> isMasterInMaintenanceMode() { 630 return wrap(rawAdmin.isMasterInMaintenanceMode()); 631 } 632 633 @Override 634 public CompletableFuture<CompactionState> getCompactionState( 635 TableName tableName, CompactType compactType) { 636 return wrap(rawAdmin.getCompactionState(tableName, compactType)); 637 } 638 639 @Override 640 public CompletableFuture<CompactionState> getCompactionStateForRegion(byte[] regionName) { 641 return wrap(rawAdmin.getCompactionStateForRegion(regionName)); 642 } 643 644 @Override 645 public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestamp(TableName tableName) { 646 return wrap(rawAdmin.getLastMajorCompactionTimestamp(tableName)); 647 } 648 649 @Override 650 public CompletableFuture<Optional<Long>> getLastMajorCompactionTimestampForRegion( 651 byte[] regionName) { 652 return wrap(rawAdmin.getLastMajorCompactionTimestampForRegion(regionName)); 653 } 654 655 @Override 656 public CompletableFuture<Boolean> balancerSwitch(boolean on) { 657 return wrap(rawAdmin.balancerSwitch(on)); 658 } 659 660 @Override 661 public CompletableFuture<Boolean> balance(boolean forcible) { 662 return wrap(rawAdmin.balance(forcible)); 663 } 664 665 @Override 666 public CompletableFuture<Boolean> isBalancerEnabled() { 667 return wrap(rawAdmin.isBalancerEnabled()); 668 } 669 670 @Override 671 public CompletableFuture<Boolean> normalizerSwitch(boolean on) { 672 return wrap(rawAdmin.normalizerSwitch(on)); 673 } 674 675 @Override 676 public CompletableFuture<Boolean> isNormalizerEnabled() { 677 return wrap(rawAdmin.isNormalizerEnabled()); 678 } 679 680 @Override 681 public CompletableFuture<Boolean> normalize() { 682 return wrap(rawAdmin.normalize()); 683 } 684 685 @Override 686 public CompletableFuture<Boolean> cleanerChoreSwitch(boolean enabled) { 687 return wrap(rawAdmin.cleanerChoreSwitch(enabled)); 688 } 689 690 @Override 691 public CompletableFuture<Boolean> isCleanerChoreEnabled() { 692 return wrap(rawAdmin.isCleanerChoreEnabled()); 693 } 694 695 @Override 696 public CompletableFuture<Boolean> runCleanerChore() { 697 return wrap(rawAdmin.runCleanerChore()); 698 } 699 700 @Override 701 public CompletableFuture<Boolean> catalogJanitorSwitch(boolean enabled) { 702 return wrap(rawAdmin.catalogJanitorSwitch(enabled)); 703 } 704 705 @Override 706 public CompletableFuture<Boolean> isCatalogJanitorEnabled() { 707 return wrap(rawAdmin.isCatalogJanitorEnabled()); 708 } 709 710 @Override 711 public CompletableFuture<Integer> runCatalogJanitor() { 712 return wrap(rawAdmin.runCatalogJanitor()); 713 } 714 715 @Override 716 public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker, 717 ServiceCaller<S, R> callable) { 718 return wrap(rawAdmin.coprocessorService(stubMaker, callable)); 719 } 720 721 @Override 722 public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker, 723 ServiceCaller<S, R> callable, ServerName serverName) { 724 return wrap(rawAdmin.coprocessorService(stubMaker, callable, serverName)); 725 } 726 727 @Override 728 public CompletableFuture<List<ServerName>> listDeadServers() { 729 return wrap(rawAdmin.listDeadServers()); 730 } 731 732 @Override 733 public CompletableFuture<List<ServerName>> clearDeadServers(List<ServerName> servers) { 734 return wrap(rawAdmin.clearDeadServers(servers)); 735 } 736 737 @Override 738 public CompletableFuture<CacheEvictionStats> clearBlockCache(TableName tableName) { 739 return wrap(rawAdmin.clearBlockCache(tableName)); 740 } 741}