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