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.thrift2.client; 019 020import java.io.IOException; 021import java.nio.ByteBuffer; 022import java.util.EnumSet; 023import java.util.List; 024import java.util.Map; 025import java.util.Set; 026import java.util.concurrent.Future; 027import java.util.regex.Pattern; 028import org.apache.commons.lang3.NotImplementedException; 029import org.apache.hadoop.conf.Configuration; 030import org.apache.hadoop.hbase.CacheEvictionStats; 031import org.apache.hadoop.hbase.ClusterMetrics; 032import org.apache.hadoop.hbase.HConstants; 033import org.apache.hadoop.hbase.HRegionInfo; 034import org.apache.hadoop.hbase.HTableDescriptor; 035import org.apache.hadoop.hbase.NamespaceDescriptor; 036import org.apache.hadoop.hbase.NamespaceNotFoundException; 037import org.apache.hadoop.hbase.RegionMetrics; 038import org.apache.hadoop.hbase.ServerName; 039import org.apache.hadoop.hbase.TableExistsException; 040import org.apache.hadoop.hbase.TableName; 041import org.apache.hadoop.hbase.TableNotFoundException; 042import org.apache.hadoop.hbase.client.Admin; 043import org.apache.hadoop.hbase.client.BalanceRequest; 044import org.apache.hadoop.hbase.client.BalanceResponse; 045import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; 046import org.apache.hadoop.hbase.client.CompactType; 047import org.apache.hadoop.hbase.client.CompactionState; 048import org.apache.hadoop.hbase.client.Connection; 049import org.apache.hadoop.hbase.client.LogEntry; 050import org.apache.hadoop.hbase.client.LogQueryFilter; 051import org.apache.hadoop.hbase.client.NormalizeTableFilterParams; 052import org.apache.hadoop.hbase.client.OnlineLogRecord; 053import org.apache.hadoop.hbase.client.RegionInfo; 054import org.apache.hadoop.hbase.client.ServerType; 055import org.apache.hadoop.hbase.client.SnapshotDescription; 056import org.apache.hadoop.hbase.client.SnapshotType; 057import org.apache.hadoop.hbase.client.TableDescriptor; 058import org.apache.hadoop.hbase.client.replication.TableCFs; 059import org.apache.hadoop.hbase.client.security.SecurityCapability; 060import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; 061import org.apache.hadoop.hbase.quotas.QuotaFilter; 062import org.apache.hadoop.hbase.quotas.QuotaRetriever; 063import org.apache.hadoop.hbase.quotas.QuotaSettings; 064import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; 065import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; 066import org.apache.hadoop.hbase.replication.ReplicationPeerDescription; 067import org.apache.hadoop.hbase.security.access.GetUserPermissionsRequest; 068import org.apache.hadoop.hbase.security.access.Permission; 069import org.apache.hadoop.hbase.security.access.UserPermission; 070import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException; 071import org.apache.hadoop.hbase.thrift2.ThriftUtilities; 072import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor; 073import org.apache.hadoop.hbase.thrift2.generated.THBaseService; 074import org.apache.hadoop.hbase.thrift2.generated.TLogQueryFilter; 075import org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor; 076import org.apache.hadoop.hbase.thrift2.generated.TOnlineLogRecord; 077import org.apache.hadoop.hbase.thrift2.generated.TServerName; 078import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor; 079import org.apache.hadoop.hbase.thrift2.generated.TTableName; 080import org.apache.hadoop.hbase.util.Bytes; 081import org.apache.hadoop.hbase.util.Pair; 082import org.apache.thrift.TException; 083import org.apache.thrift.transport.TTransport; 084import org.apache.yetus.audience.InterfaceAudience; 085 086@InterfaceAudience.Private 087public class ThriftAdmin implements Admin { 088 089 private THBaseService.Client client; 090 private TTransport transport; 091 private int operationTimeout; 092 private int syncWaitTimeout; 093 private Configuration conf; 094 095 public ThriftAdmin(THBaseService.Client client, TTransport tTransport, Configuration conf) { 096 this.client = client; 097 this.transport = tTransport; 098 this.operationTimeout = conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 099 HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT); 100 this.syncWaitTimeout = conf.getInt("hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min 101 this.conf = conf; 102 } 103 104 @Override 105 public int getOperationTimeout() { 106 return operationTimeout; 107 } 108 109 @Override 110 public int getSyncWaitTimeout() { 111 return syncWaitTimeout; 112 } 113 114 @Override 115 public void abort(String why, Throwable e) { 116 } 117 118 @Override 119 public boolean isAborted() { 120 return false; 121 } 122 123 @Override 124 public void close() throws IOException { 125 transport.close(); 126 } 127 128 @Override 129 public Configuration getConfiguration() { 130 return conf; 131 } 132 133 @Override 134 public boolean tableExists(TableName tableName) throws IOException { 135 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 136 try { 137 return client.tableExists(tTableName); 138 } catch (TException e) { 139 throw new IOException(e); 140 } 141 } 142 143 @Override 144 public Connection getConnection() { 145 throw new NotImplementedException("getConnection not supported in ThriftAdmin"); 146 } 147 148 @Override 149 public HTableDescriptor[] listTables() throws IOException { 150 return listTables((String) null); 151 } 152 153 @Override 154 public List<TableDescriptor> listTableDescriptors() throws IOException { 155 return listTableDescriptors((Pattern) null); 156 } 157 158 @Override 159 public HTableDescriptor[] listTables(Pattern pattern) throws IOException { 160 String regex = (pattern == null ? null : pattern.toString()); 161 return listTables(regex); 162 } 163 164 @Override 165 public List<TableDescriptor> listTableDescriptors(Pattern pattern) throws IOException { 166 return listTableDescriptors(pattern, false); 167 } 168 169 @Override 170 public HTableDescriptor[] listTables(String regex) throws IOException { 171 return listTables(regex, false); 172 } 173 174 @Override 175 public HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables) 176 throws IOException { 177 String regex = (pattern == null ? null : pattern.toString()); 178 return listTables(regex, includeSysTables); 179 180 } 181 182 @Override 183 public List<TableDescriptor> listTableDescriptors(Pattern pattern, boolean includeSysTables) 184 throws IOException { 185 try { 186 String regex = (pattern == null ? null : pattern.toString()); 187 List<TTableDescriptor> tTableDescriptors = 188 client.getTableDescriptorsByPattern(regex, includeSysTables); 189 return ThriftUtilities.tableDescriptorsFromThrift(tTableDescriptors); 190 191 } catch (TException e) { 192 throw new IOException(e); 193 } 194 } 195 196 @Override 197 public HTableDescriptor[] listTables(String regex, boolean includeSysTables) throws IOException { 198 try { 199 List<TTableDescriptor> tTableDescriptors = 200 client.getTableDescriptorsByPattern(regex, includeSysTables); 201 return ThriftUtilities.hTableDescriptorsFromThrift(tTableDescriptors); 202 203 } catch (TException e) { 204 throw new IOException(e); 205 } 206 } 207 208 @Override 209 public TableName[] listTableNames() throws IOException { 210 return listTableNames((String) null); 211 } 212 213 @Override 214 public TableName[] listTableNames(Pattern pattern) throws IOException { 215 return listTableNames(pattern, false); 216 } 217 218 @Override 219 public TableName[] listTableNames(String regex) throws IOException { 220 return listTableNames(regex, false); 221 } 222 223 @Override 224 public TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException { 225 String regex = (pattern == null ? null : pattern.toString()); 226 return listTableNames(regex, includeSysTables); 227 } 228 229 @Override 230 public TableName[] listTableNames(String regex, boolean includeSysTables) throws IOException { 231 try { 232 List<TTableName> tTableNames = client.getTableNamesByPattern(regex, includeSysTables); 233 return ThriftUtilities.tableNamesArrayFromThrift(tTableNames); 234 } catch (TException e) { 235 throw new IOException(e); 236 } 237 } 238 239 @Override 240 public HTableDescriptor getTableDescriptor(TableName tableName) 241 throws TableNotFoundException, IOException { 242 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 243 try { 244 TTableDescriptor tTableDescriptor = client.getTableDescriptor(tTableName); 245 return ThriftUtilities.hTableDescriptorFromThrift(tTableDescriptor); 246 } catch (TException e) { 247 throw new IOException(e); 248 } 249 } 250 251 @Override 252 public TableDescriptor getDescriptor(TableName tableName) 253 throws TableNotFoundException, IOException { 254 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 255 try { 256 TTableDescriptor tTableDescriptor = client.getTableDescriptor(tTableName); 257 return ThriftUtilities.tableDescriptorFromThrift(tTableDescriptor); 258 } catch (TException e) { 259 throw new IOException(e); 260 } 261 } 262 263 @Override 264 public HTableDescriptor[] listTableDescriptorsByNamespace(String name) throws IOException { 265 try { 266 List<TTableDescriptor> tTableDescriptors = client.getTableDescriptorsByNamespace(name); 267 return ThriftUtilities.hTableDescriptorsFromThrift(tTableDescriptors); 268 } catch (TException e) { 269 throw new IOException(e); 270 } 271 } 272 273 @Override 274 public List<TableDescriptor> listTableDescriptorsByNamespace(byte[] name) throws IOException { 275 try { 276 List<TTableDescriptor> tTableDescriptors = 277 client.getTableDescriptorsByNamespace(Bytes.toString(name)); 278 return ThriftUtilities.tableDescriptorsFromThrift(tTableDescriptors); 279 } catch (TException e) { 280 throw new IOException(e); 281 } 282 } 283 284 @Override 285 public TableName[] listTableNamesByNamespace(String name) throws IOException { 286 try { 287 List<TTableName> tTableNames = client.getTableNamesByNamespace(name); 288 return ThriftUtilities.tableNamesArrayFromThrift(tTableNames); 289 } catch (TException e) { 290 throw new IOException(e); 291 } 292 } 293 294 @Override 295 public void createTable(TableDescriptor desc) throws IOException { 296 createTable(desc, null); 297 } 298 299 @Override 300 public void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) 301 throws IOException { 302 if (numRegions < 3) { 303 throw new IllegalArgumentException("Must create at least three regions"); 304 } else if (Bytes.compareTo(startKey, endKey) >= 0) { 305 throw new IllegalArgumentException("Start key must be smaller than end key"); 306 } 307 if (numRegions == 3) { 308 createTable(desc, new byte[][] { startKey, endKey }); 309 return; 310 } 311 byte[][] splitKeys = Bytes.split(startKey, endKey, numRegions - 3); 312 if (splitKeys == null || splitKeys.length != numRegions - 1) { 313 throw new IllegalArgumentException("Unable to split key range into enough regions"); 314 } 315 createTable(desc, splitKeys); 316 } 317 318 @Override 319 public void createTable(TableDescriptor desc, byte[][] splitKeys) throws IOException { 320 TTableDescriptor tTableDescriptor = ThriftUtilities.tableDescriptorFromHBase(desc); 321 List<ByteBuffer> splitKeyInBuffer = ThriftUtilities.splitKeyFromHBase(splitKeys); 322 try { 323 client.createTable(tTableDescriptor, splitKeyInBuffer); 324 } catch (TException e) { 325 throw new IOException(e); 326 } 327 } 328 329 @Override 330 public void deleteTable(TableName tableName) throws IOException { 331 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 332 try { 333 client.deleteTable(tTableName); 334 } catch (TException e) { 335 throw new IOException(e); 336 } 337 } 338 339 @Override 340 public void truncateTable(TableName tableName, boolean preserveSplits) throws IOException { 341 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 342 try { 343 client.truncateTable(tTableName, preserveSplits); 344 } catch (TException e) { 345 throw new IOException(e); 346 } 347 } 348 349 @Override 350 public void enableTable(TableName tableName) throws IOException { 351 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 352 try { 353 client.enableTable(tTableName); 354 } catch (TException e) { 355 throw new IOException(e); 356 } 357 } 358 359 @Override 360 public void disableTable(TableName tableName) throws IOException { 361 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 362 try { 363 client.disableTable(tTableName); 364 } catch (TException e) { 365 throw new IOException(e); 366 } 367 } 368 369 @Override 370 public boolean isTableEnabled(TableName tableName) throws IOException { 371 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 372 try { 373 return client.isTableEnabled(tTableName); 374 } catch (TException e) { 375 throw new IOException(e); 376 } 377 } 378 379 @Override 380 public boolean isTableDisabled(TableName tableName) throws IOException { 381 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 382 try { 383 return client.isTableDisabled(tTableName); 384 } catch (TException e) { 385 throw new IOException(e); 386 } 387 } 388 389 @Override 390 public boolean isTableAvailable(TableName tableName) throws IOException { 391 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 392 try { 393 return client.isTableAvailable(tTableName); 394 } catch (TException e) { 395 throw new IOException(e); 396 } 397 } 398 399 @Override 400 public boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException { 401 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 402 List<ByteBuffer> splitKeyInBuffer = ThriftUtilities.splitKeyFromHBase(splitKeys); 403 try { 404 return client.isTableAvailableWithSplit(tTableName, splitKeyInBuffer); 405 } catch (TException e) { 406 throw new IOException(e); 407 } 408 } 409 410 @Override 411 public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) 412 throws IOException { 413 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 414 TColumnFamilyDescriptor tColumnFamilyDescriptor = 415 ThriftUtilities.columnFamilyDescriptorFromHBase(columnFamily); 416 try { 417 client.addColumnFamily(tTableName, tColumnFamilyDescriptor); 418 } catch (TException e) { 419 throw new IOException(e); 420 } 421 } 422 423 @Override 424 public void deleteColumn(TableName tableName, byte[] columnFamily) throws IOException { 425 deleteColumnFamily(tableName, columnFamily); 426 } 427 428 @Override 429 public void deleteColumnFamily(TableName tableName, byte[] columnFamily) throws IOException { 430 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 431 try { 432 client.deleteColumnFamily(tTableName, ByteBuffer.wrap(columnFamily)); 433 } catch (TException e) { 434 throw new IOException(e); 435 } 436 } 437 438 @Override 439 public void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) 440 throws IOException { 441 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 442 TColumnFamilyDescriptor tColumnFamilyDescriptor = 443 ThriftUtilities.columnFamilyDescriptorFromHBase(columnFamily); 444 try { 445 client.modifyColumnFamily(tTableName, tColumnFamilyDescriptor); 446 } catch (TException e) { 447 throw new IOException(e); 448 } 449 } 450 451 @Override 452 public void modifyTable(TableName tableName, TableDescriptor td) throws IOException { 453 modifyTable(td); 454 } 455 456 @Override 457 public void modifyTable(TableDescriptor td) throws IOException { 458 TTableDescriptor tTableDescriptor = ThriftUtilities.tableDescriptorFromHBase(td); 459 try { 460 client.modifyTable(tTableDescriptor); 461 } catch (TException e) { 462 throw new IOException(e); 463 } 464 } 465 466 @Override 467 public void modifyNamespace(NamespaceDescriptor descriptor) throws IOException { 468 TNamespaceDescriptor tNamespaceDescriptor = 469 ThriftUtilities.namespaceDescriptorFromHBase(descriptor); 470 try { 471 client.modifyNamespace(tNamespaceDescriptor); 472 } catch (TException e) { 473 throw new IOException(e); 474 } 475 } 476 477 @Override 478 public void deleteNamespace(String name) throws IOException { 479 try { 480 client.deleteNamespace(name); 481 } catch (TException e) { 482 throw new IOException(e); 483 } 484 } 485 486 @Override 487 public NamespaceDescriptor getNamespaceDescriptor(String name) 488 throws NamespaceNotFoundException, IOException { 489 try { 490 TNamespaceDescriptor tNamespaceDescriptor = client.getNamespaceDescriptor(name); 491 return ThriftUtilities.namespaceDescriptorFromThrift(tNamespaceDescriptor); 492 } catch (TException e) { 493 throw new IOException(e); 494 } 495 } 496 497 @Override 498 public String[] listNamespaces() throws IOException { 499 try { 500 List<String> tNamespaces = client.listNamespaces(); 501 return tNamespaces.toArray(new String[tNamespaces.size()]); 502 } catch (TException e) { 503 throw new IOException(e); 504 } 505 } 506 507 @Override 508 public NamespaceDescriptor[] listNamespaceDescriptors() throws IOException { 509 try { 510 List<TNamespaceDescriptor> tNamespaceDescriptors = client.listNamespaceDescriptors(); 511 return ThriftUtilities.namespaceDescriptorsFromThrift(tNamespaceDescriptors); 512 } catch (TException e) { 513 throw new IOException(e); 514 } 515 } 516 517 @Override 518 public void createNamespace(NamespaceDescriptor descriptor) throws IOException { 519 TNamespaceDescriptor tNamespaceDescriptor = 520 ThriftUtilities.namespaceDescriptorFromHBase(descriptor); 521 try { 522 client.createNamespace(tNamespaceDescriptor); 523 } catch (TException e) { 524 throw new IOException(e); 525 } 526 } 527 528 @Override 529 public boolean switchRpcThrottle(boolean enable) throws IOException { 530 throw new NotImplementedException("switchRpcThrottle by pattern not supported in ThriftAdmin"); 531 } 532 533 @Override 534 public boolean isRpcThrottleEnabled() throws IOException { 535 throw new NotImplementedException( 536 "isRpcThrottleEnabled by pattern not supported in ThriftAdmin"); 537 } 538 539 @Override 540 public boolean exceedThrottleQuotaSwitch(boolean enable) throws IOException { 541 throw new NotImplementedException( 542 "exceedThrottleQuotaSwitch by pattern not supported in ThriftAdmin"); 543 } 544 545 @Override 546 public HTableDescriptor[] disableTables(String regex) throws IOException { 547 throw new NotImplementedException("disableTables by pattern not supported in ThriftAdmin"); 548 } 549 550 @Override 551 public HTableDescriptor[] disableTables(Pattern pattern) throws IOException { 552 throw new NotImplementedException("disableTables by pattern not supported in ThriftAdmin"); 553 } 554 555 @Override 556 public HTableDescriptor[] enableTables(String regex) throws IOException { 557 throw new NotImplementedException("enableTables by pattern not supported in ThriftAdmin"); 558 } 559 560 @Override 561 public HTableDescriptor[] enableTables(Pattern pattern) throws IOException { 562 throw new NotImplementedException("enableTables by pattern not supported in ThriftAdmin"); 563 } 564 565 @Override 566 public HTableDescriptor[] deleteTables(String regex) throws IOException { 567 throw new NotImplementedException("deleteTables by pattern not supported in ThriftAdmin"); 568 } 569 570 @Override 571 public HTableDescriptor[] deleteTables(Pattern pattern) throws IOException { 572 throw new NotImplementedException("deleteTables by pattern not supported in ThriftAdmin"); 573 574 } 575 576 @Override 577 public HTableDescriptor[] getTableDescriptorsByTableName(List<TableName> tableNames) 578 throws IOException { 579 throw new NotImplementedException("getTableDescriptorsByTableName not supported in ThriftAdmin" 580 + ", use getDescriptor to get descriptors one by one"); 581 } 582 583 @Override 584 public List<TableDescriptor> listTableDescriptors(List<TableName> tableNames) throws IOException { 585 throw new NotImplementedException("listTableDescriptors not supported in ThriftAdmin" 586 + ", use getDescriptor to get descriptors one by one"); 587 } 588 589 @Override 590 public HTableDescriptor[] getTableDescriptors(List<String> names) throws IOException { 591 throw new NotImplementedException("getTableDescriptors not supported in ThriftAdmin" 592 + ", use getDescriptor to get descriptors one by one"); 593 } 594 595 @Override 596 public void closeRegion(String regionname, String serverName) { 597 throw new NotImplementedException("closeRegion not supported in ThriftAdmin"); 598 599 } 600 601 @Override 602 public void closeRegion(byte[] regionname, String serverName) { 603 throw new NotImplementedException("closeRegion not supported in ThriftAdmin"); 604 605 } 606 607 @Override 608 public boolean closeRegionWithEncodedRegionName(String encodedRegionName, String serverName) { 609 throw new NotImplementedException( 610 "closeRegionWithEncodedRegionName not supported in ThriftAdmin"); 611 } 612 613 @Override 614 public void closeRegion(ServerName sn, HRegionInfo hri) { 615 throw new NotImplementedException("closeRegion not supported in ThriftAdmin"); 616 617 } 618 619 @Override 620 public List<HRegionInfo> getOnlineRegions(ServerName sn) { 621 throw new NotImplementedException("getOnlineRegions not supported in ThriftAdmin"); 622 } 623 624 @Override 625 public List<RegionInfo> getRegions(ServerName serverName) { 626 throw new NotImplementedException("getRegions not supported in ThriftAdmin"); 627 } 628 629 @Override 630 public void flush(TableName tableName) { 631 throw new NotImplementedException("flush not supported in ThriftAdmin"); 632 633 } 634 635 @Override 636 public void flush(TableName tableName, byte[] columnFamily) { 637 throw new NotImplementedException("flush not supported in ThriftAdmin"); 638 } 639 640 @Override 641 public void flushRegion(byte[] regionName) { 642 throw new NotImplementedException("flushRegion not supported in ThriftAdmin"); 643 644 } 645 646 @Override 647 public void flushRegion(byte[] regionName, byte[] columnFamily) { 648 throw new NotImplementedException("flushRegion not supported in ThriftAdmin"); 649 } 650 651 @Override 652 public void flushRegionServer(ServerName serverName) { 653 throw new NotImplementedException("flushRegionServer not supported in ThriftAdmin"); 654 655 } 656 657 @Override 658 public void compact(TableName tableName) { 659 throw new NotImplementedException("compact not supported in ThriftAdmin"); 660 661 } 662 663 @Override 664 public void compactRegion(byte[] regionName) { 665 throw new NotImplementedException("compactRegion not supported in ThriftAdmin"); 666 667 } 668 669 @Override 670 public void compact(TableName tableName, byte[] columnFamily) { 671 throw new NotImplementedException("compact not supported in ThriftAdmin"); 672 673 } 674 675 @Override 676 public void compactRegion(byte[] regionName, byte[] columnFamily) { 677 throw new NotImplementedException("compactRegion not supported in ThriftAdmin"); 678 679 } 680 681 @Override 682 public void compact(TableName tableName, CompactType compactType) { 683 throw new NotImplementedException("compact not supported in ThriftAdmin"); 684 685 } 686 687 @Override 688 public void compact(TableName tableName, byte[] columnFamily, CompactType compactType) { 689 throw new NotImplementedException("compact not supported in ThriftAdmin"); 690 691 } 692 693 @Override 694 public void majorCompact(TableName tableName) { 695 throw new NotImplementedException("majorCompact not supported in ThriftAdmin"); 696 697 } 698 699 @Override 700 public void majorCompactRegion(byte[] regionName) { 701 throw new NotImplementedException("majorCompactRegion not supported in ThriftAdmin"); 702 703 } 704 705 @Override 706 public void majorCompact(TableName tableName, byte[] columnFamily) { 707 throw new NotImplementedException("majorCompact not supported in ThriftAdmin"); 708 709 } 710 711 @Override 712 public void majorCompactRegion(byte[] regionName, byte[] columnFamily) { 713 throw new NotImplementedException("majorCompactRegion not supported in ThriftAdmin"); 714 715 } 716 717 @Override 718 public void majorCompact(TableName tableName, CompactType compactType) { 719 throw new NotImplementedException("majorCompact not supported in ThriftAdmin"); 720 721 } 722 723 @Override 724 public void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType) { 725 throw new NotImplementedException("majorCompact not supported in ThriftAdmin"); 726 727 } 728 729 @Override 730 public Map<ServerName, Boolean> compactionSwitch(boolean switchState, 731 List<String> serverNamesList) { 732 throw new NotImplementedException("compactionSwitch not supported in ThriftAdmin"); 733 } 734 735 @Override 736 public void compactRegionServer(ServerName serverName) { 737 throw new NotImplementedException("compactRegionServer not supported in ThriftAdmin"); 738 739 } 740 741 @Override 742 public void majorCompactRegionServer(ServerName serverName) { 743 throw new NotImplementedException("majorCompactRegionServer not supported in ThriftAdmin"); 744 745 } 746 747 @Override 748 public void move(byte[] encodedRegionName) { 749 throw new NotImplementedException("move not supported in ThriftAdmin"); 750 } 751 752 @Override 753 public void move(byte[] encodedRegionName, ServerName destServerName) { 754 throw new NotImplementedException("move not supported in ThriftAdmin"); 755 } 756 757 @Override 758 public void assign(byte[] regionName) { 759 throw new NotImplementedException("assign not supported in ThriftAdmin"); 760 761 } 762 763 @Override 764 public void unassign(byte[] regionName) { 765 throw new NotImplementedException("unassign not supported in ThriftAdmin"); 766 } 767 768 @Override 769 public void offline(byte[] regionName) { 770 throw new NotImplementedException("offline not supported in ThriftAdmin"); 771 772 } 773 774 @Override 775 public boolean balancerSwitch(boolean onOrOff, boolean synchronous) { 776 throw new NotImplementedException("balancerSwitch not supported in ThriftAdmin"); 777 } 778 779 @Override 780 public boolean balance() { 781 throw new NotImplementedException("balance not supported in ThriftAdmin"); 782 } 783 784 @Override 785 public boolean balance(boolean force) { 786 throw new NotImplementedException("balance not supported in ThriftAdmin"); 787 } 788 789 @Override 790 public BalanceResponse balance(BalanceRequest request) throws IOException { 791 throw new NotImplementedException("balance not supported in ThriftAdmin"); 792 } 793 794 @Override 795 public boolean isBalancerEnabled() { 796 throw new NotImplementedException("isBalancerEnabled not supported in ThriftAdmin"); 797 } 798 799 @Override 800 public CacheEvictionStats clearBlockCache(TableName tableName) { 801 throw new NotImplementedException("clearBlockCache not supported in ThriftAdmin"); 802 } 803 804 @Override 805 public boolean normalize(NormalizeTableFilterParams ntfp) { 806 throw new NotImplementedException("normalize not supported in ThriftAdmin"); 807 } 808 809 @Override 810 public boolean isNormalizerEnabled() { 811 throw new NotImplementedException("isNormalizerEnabled not supported in ThriftAdmin"); 812 } 813 814 @Override 815 public boolean normalizerSwitch(boolean on) { 816 throw new NotImplementedException("normalizerSwitch not supported in ThriftAdmin"); 817 } 818 819 @Override 820 public boolean catalogJanitorSwitch(boolean onOrOff) { 821 throw new NotImplementedException("catalogJanitorSwitch not supported in ThriftAdmin"); 822 } 823 824 @Override 825 public int runCatalogJanitor() { 826 throw new NotImplementedException("runCatalogJanitor not supported in ThriftAdmin"); 827 } 828 829 @Override 830 public boolean isCatalogJanitorEnabled() { 831 throw new NotImplementedException("isCatalogJanitorEnabled not supported in ThriftAdmin"); 832 } 833 834 @Override 835 public boolean cleanerChoreSwitch(boolean onOrOff) { 836 throw new NotImplementedException("cleanerChoreSwitch not supported in ThriftAdmin"); 837 } 838 839 @Override 840 public boolean runCleanerChore() { 841 throw new NotImplementedException("runCleanerChore not supported in ThriftAdmin"); 842 } 843 844 @Override 845 public boolean isCleanerChoreEnabled() { 846 throw new NotImplementedException("isCleanerChoreEnabled not supported in ThriftAdmin"); 847 } 848 849 @Override 850 public void mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) { 851 throw new NotImplementedException("mergeRegions not supported in ThriftAdmin"); 852 853 } 854 855 @Override 856 public Future<Void> mergeRegionsAsync(byte[] nameOfRegionA, byte[] nameOfRegionB, 857 boolean forcible) { 858 throw new NotImplementedException("mergeRegionsAsync not supported in ThriftAdmin"); 859 } 860 861 @Override 862 public Future<Void> mergeRegionsAsync(byte[][] nameofRegionsToMerge, boolean forcible) { 863 throw new NotImplementedException("mergeRegionsAsync not supported in ThriftAdmin"); 864 } 865 866 @Override 867 public void split(TableName tableName) { 868 throw new NotImplementedException("split not supported in ThriftAdmin"); 869 } 870 871 @Override 872 public void splitRegion(byte[] regionName) { 873 throw new NotImplementedException("splitRegion not supported in ThriftAdmin"); 874 } 875 876 @Override 877 public void split(TableName tableName, byte[] splitPoint) { 878 throw new NotImplementedException("split not supported in ThriftAdmin"); 879 } 880 881 @Override 882 public void splitRegion(byte[] regionName, byte[] splitPoint) { 883 throw new NotImplementedException("splitRegion not supported in ThriftAdmin"); 884 } 885 886 @Override 887 public Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint) { 888 throw new NotImplementedException("splitRegionAsync not supported in ThriftAdmin"); 889 } 890 891 @Override 892 public Future<Void> modifyTableAsync(TableName tableName, TableDescriptor td) { 893 throw new NotImplementedException("modifyTableAsync not supported in ThriftAdmin"); 894 } 895 896 @Override 897 public Future<Void> modifyTableAsync(TableDescriptor td) { 898 throw new NotImplementedException("modifyTableAsync not supported in ThriftAdmin"); 899 } 900 901 @Override 902 public void shutdown() { 903 throw new NotImplementedException("shutdown not supported in ThriftAdmin"); 904 905 } 906 907 @Override 908 public void stopMaster() { 909 throw new NotImplementedException("stopMaster not supported in ThriftAdmin"); 910 911 } 912 913 @Override 914 public boolean isMasterInMaintenanceMode() { 915 throw new NotImplementedException("isMasterInMaintenanceMode not supported in ThriftAdmin"); 916 } 917 918 @Override 919 public void stopRegionServer(String hostnamePort) { 920 throw new NotImplementedException("stopRegionServer not supported in ThriftAdmin"); 921 922 } 923 924 @Override 925 public ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options) { 926 throw new NotImplementedException("getClusterMetrics not supported in ThriftAdmin"); 927 } 928 929 @Override 930 public List<RegionMetrics> getRegionMetrics(ServerName serverName, TableName tableName) { 931 throw new NotImplementedException("getRegionMetrics not supported in ThriftAdmin"); 932 } 933 934 @Override 935 public Future<Void> createNamespaceAsync(NamespaceDescriptor descriptor) { 936 throw new NotImplementedException("createNamespaceAsync not supported in ThriftAdmin"); 937 } 938 939 @Override 940 public Future<Void> modifyNamespaceAsync(NamespaceDescriptor descriptor) { 941 throw new NotImplementedException("modifyNamespaceAsync not supported in ThriftAdmin"); 942 } 943 944 @Override 945 public List<HRegionInfo> getTableRegions(TableName tableName) { 946 throw new NotImplementedException("getTableRegions not supported in ThriftAdmin"); 947 } 948 949 @Override 950 public List<RegionInfo> getRegions(TableName tableName) { 951 throw new NotImplementedException("getRegions not supported in ThriftAdmin"); 952 } 953 954 @Override 955 public boolean abortProcedure(long procId, boolean mayInterruptIfRunning) { 956 throw new NotImplementedException("abortProcedure not supported in ThriftAdmin"); 957 } 958 959 @Override 960 public Future<Boolean> abortProcedureAsync(long procId, boolean mayInterruptIfRunning) { 961 throw new NotImplementedException("abortProcedureAsync not supported in ThriftAdmin"); 962 } 963 964 @Override 965 public String getProcedures() { 966 throw new NotImplementedException("getProcedures not supported in ThriftAdmin"); 967 } 968 969 @Override 970 public String getLocks() { 971 throw new NotImplementedException("getLocks not supported in ThriftAdmin"); 972 } 973 974 @Override 975 public void rollWALWriter(ServerName serverName) { 976 throw new NotImplementedException("rollWALWriter not supported in ThriftAdmin"); 977 978 } 979 980 @Override 981 public CompactionState getCompactionState(TableName tableName) { 982 throw new NotImplementedException("getCompactionState not supported in ThriftAdmin"); 983 } 984 985 @Override 986 public CompactionState getCompactionState(TableName tableName, CompactType compactType) { 987 throw new NotImplementedException("getCompactionState not supported in ThriftAdmin"); 988 } 989 990 @Override 991 public CompactionState getCompactionStateForRegion(byte[] regionName) { 992 throw new NotImplementedException("getCompactionStateForRegion not supported in ThriftAdmin"); 993 } 994 995 @Override 996 public long getLastMajorCompactionTimestamp(TableName tableName) { 997 throw new NotImplementedException( 998 "getLastMajorCompactionTimestamp not supported in ThriftAdmin"); 999 } 1000 1001 @Override 1002 public long getLastMajorCompactionTimestampForRegion(byte[] regionName) { 1003 throw new NotImplementedException( 1004 "getLastMajorCompactionTimestampForRegion not supported in ThriftAdmin"); 1005 } 1006 1007 @Override 1008 public void snapshot(String snapshotName, TableName tableName) { 1009 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1010 1011 } 1012 1013 @Override 1014 public void snapshot(byte[] snapshotName, TableName tableName) { 1015 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1016 1017 } 1018 1019 @Override 1020 public void snapshot(String snapshotName, TableName tableName, SnapshotType type) { 1021 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1022 1023 } 1024 1025 @Override 1026 public void snapshot(SnapshotDescription snapshot) { 1027 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1028 1029 } 1030 1031 @Override 1032 public Future<Void> snapshotAsync(SnapshotDescription snapshot) { 1033 throw new NotImplementedException("snapshotAsync not supported in ThriftAdmin"); 1034 1035 } 1036 1037 @Override 1038 public boolean isSnapshotFinished(SnapshotDescription snapshot) { 1039 throw new NotImplementedException("isSnapshotFinished not supported in ThriftAdmin"); 1040 } 1041 1042 @Override 1043 public void restoreSnapshot(byte[] snapshotName) { 1044 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1045 1046 } 1047 1048 @Override 1049 public void restoreSnapshot(String snapshotName) { 1050 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1051 1052 } 1053 1054 @Override 1055 public Future<Void> restoreSnapshotAsync(String snapshotName) { 1056 throw new NotImplementedException("restoreSnapshotAsync not supported in ThriftAdmin"); 1057 } 1058 1059 @Override 1060 public void restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot, 1061 boolean restoreAcl) { 1062 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1063 } 1064 1065 @Override 1066 public Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean cloneAcl, 1067 String customSFT) throws IOException, TableExistsException, RestoreSnapshotException { 1068 throw new NotImplementedException("cloneSnapshotAsync not supported in ThriftAdmin"); 1069 } 1070 1071 @Override 1072 public void execProcedure(String signature, String instance, Map<String, String> props) { 1073 throw new NotImplementedException("execProcedure not supported in ThriftAdmin"); 1074 1075 } 1076 1077 @Override 1078 public byte[] execProcedureWithReturn(String signature, String instance, 1079 Map<String, String> props) { 1080 throw new NotImplementedException("execProcedureWithReturn not supported in ThriftAdmin"); 1081 } 1082 1083 @Override 1084 public boolean isProcedureFinished(String signature, String instance, Map<String, String> props) { 1085 throw new NotImplementedException("isProcedureFinished not supported in ThriftAdmin"); 1086 } 1087 1088 @Override 1089 public List<SnapshotDescription> listSnapshots() { 1090 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1091 } 1092 1093 @Override 1094 public List<SnapshotDescription> listSnapshots(String regex) { 1095 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1096 } 1097 1098 @Override 1099 public List<SnapshotDescription> listSnapshots(Pattern pattern) { 1100 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1101 } 1102 1103 @Override 1104 public List<SnapshotDescription> listTableSnapshots(String tableNameRegex, 1105 String snapshotNameRegex) { 1106 throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin"); 1107 } 1108 1109 @Override 1110 public List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, 1111 Pattern snapshotNamePattern) { 1112 throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin"); 1113 } 1114 1115 @Override 1116 public void deleteSnapshot(byte[] snapshotName) { 1117 throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin"); 1118 } 1119 1120 @Override 1121 public void deleteSnapshot(String snapshotName) { 1122 throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin"); 1123 } 1124 1125 @Override 1126 public void deleteSnapshots(String regex) { 1127 throw new NotImplementedException("deleteSnapshots not supported in ThriftAdmin"); 1128 } 1129 1130 @Override 1131 public void deleteSnapshots(Pattern pattern) { 1132 throw new NotImplementedException("deleteSnapshots not supported in ThriftAdmin"); 1133 } 1134 1135 @Override 1136 public void deleteTableSnapshots(String tableNameRegex, String snapshotNameRegex) { 1137 throw new NotImplementedException("deleteTableSnapshots not supported in ThriftAdmin"); 1138 } 1139 1140 @Override 1141 public void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) { 1142 throw new NotImplementedException("deleteTableSnapshots not supported in ThriftAdmin"); 1143 } 1144 1145 @Override 1146 public void setQuota(QuotaSettings quota) { 1147 throw new NotImplementedException("setQuota not supported in ThriftAdmin"); 1148 } 1149 1150 @Override 1151 public QuotaRetriever getQuotaRetriever(QuotaFilter filter) { 1152 throw new NotImplementedException("getQuotaRetriever not supported in ThriftAdmin"); 1153 } 1154 1155 @Override 1156 public List<QuotaSettings> getQuota(QuotaFilter filter) { 1157 throw new NotImplementedException("getQuota not supported in ThriftAdmin"); 1158 } 1159 1160 @Override 1161 public CoprocessorRpcChannel coprocessorService() { 1162 throw new NotImplementedException("coprocessorService not supported in ThriftAdmin"); 1163 } 1164 1165 @Override 1166 public CoprocessorRpcChannel coprocessorService(ServerName serverName) { 1167 throw new NotImplementedException("coprocessorService not supported in ThriftAdmin"); 1168 } 1169 1170 @Override 1171 public void updateConfiguration(ServerName server) { 1172 throw new NotImplementedException("updateConfiguration not supported in ThriftAdmin"); 1173 } 1174 1175 @Override 1176 public void updateConfiguration() { 1177 throw new NotImplementedException("updateConfiguration not supported in ThriftAdmin"); 1178 } 1179 1180 @Override 1181 public List<SecurityCapability> getSecurityCapabilities() { 1182 throw new NotImplementedException("getSecurityCapabilities not supported in ThriftAdmin"); 1183 } 1184 1185 @Override 1186 public boolean splitSwitch(boolean enabled, boolean synchronous) { 1187 throw new NotImplementedException("splitSwitch not supported in ThriftAdmin"); 1188 } 1189 1190 @Override 1191 public boolean mergeSwitch(boolean enabled, boolean synchronous) { 1192 throw new NotImplementedException("mergeSwitch not supported in ThriftAdmin"); 1193 } 1194 1195 @Override 1196 public boolean isSplitEnabled() { 1197 throw new NotImplementedException("isSplitEnabled not supported in ThriftAdmin"); 1198 } 1199 1200 @Override 1201 public boolean isMergeEnabled() { 1202 throw new NotImplementedException("isMergeEnabled not supported in ThriftAdmin"); 1203 } 1204 1205 @Override 1206 public Future<Void> addReplicationPeerAsync(String peerId, ReplicationPeerConfig peerConfig, 1207 boolean enabled) { 1208 throw new NotImplementedException("addReplicationPeerAsync not supported in ThriftAdmin"); 1209 } 1210 1211 @Override 1212 public Future<Void> removeReplicationPeerAsync(String peerId) { 1213 throw new NotImplementedException("removeReplicationPeerAsync not supported in ThriftAdmin"); 1214 } 1215 1216 @Override 1217 public Future<Void> enableReplicationPeerAsync(String peerId) { 1218 throw new NotImplementedException("enableReplicationPeerAsync not supported in ThriftAdmin"); 1219 } 1220 1221 @Override 1222 public Future<Void> disableReplicationPeerAsync(String peerId) { 1223 throw new NotImplementedException("disableReplicationPeerAsync not supported in ThriftAdmin"); 1224 } 1225 1226 @Override 1227 public ReplicationPeerConfig getReplicationPeerConfig(String peerId) { 1228 throw new NotImplementedException("getReplicationPeerConfig not supported in ThriftAdmin"); 1229 } 1230 1231 @Override 1232 public Future<Void> updateReplicationPeerConfigAsync(String peerId, 1233 ReplicationPeerConfig peerConfig) { 1234 throw new NotImplementedException( 1235 "updateReplicationPeerConfigAsync not supported in ThriftAdmin"); 1236 } 1237 1238 @Override 1239 public List<ReplicationPeerDescription> listReplicationPeers() { 1240 throw new NotImplementedException("listReplicationPeers not supported in ThriftAdmin"); 1241 } 1242 1243 @Override 1244 public List<ReplicationPeerDescription> listReplicationPeers(Pattern pattern) { 1245 throw new NotImplementedException("listReplicationPeers not supported in ThriftAdmin"); 1246 } 1247 1248 @Override 1249 public void decommissionRegionServers(List<ServerName> servers, boolean offload) { 1250 throw new NotImplementedException("decommissionRegionServers not supported in ThriftAdmin"); 1251 1252 } 1253 1254 @Override 1255 public List<ServerName> listDecommissionedRegionServers() { 1256 throw new NotImplementedException( 1257 "listDecommissionedRegionServers not supported in ThriftAdmin"); 1258 } 1259 1260 @Override 1261 public void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames) { 1262 throw new NotImplementedException("recommissionRegionServer not supported in ThriftAdmin"); 1263 1264 } 1265 1266 @Override 1267 public List<TableCFs> listReplicatedTableCFs() { 1268 throw new NotImplementedException("listReplicatedTableCFs not supported in ThriftAdmin"); 1269 } 1270 1271 @Override 1272 public void enableTableReplication(TableName tableName) { 1273 throw new NotImplementedException("enableTableReplication not supported in ThriftAdmin"); 1274 1275 } 1276 1277 @Override 1278 public void disableTableReplication(TableName tableName) { 1279 throw new NotImplementedException("disableTableReplication not supported in ThriftAdmin"); 1280 1281 } 1282 1283 @Override 1284 public void clearCompactionQueues(ServerName serverName, Set<String> queues) { 1285 throw new NotImplementedException("clearCompactionQueues not supported in ThriftAdmin"); 1286 1287 } 1288 1289 @Override 1290 public List<ServerName> clearDeadServers(List<ServerName> servers) { 1291 throw new NotImplementedException("clearDeadServers not supported in ThriftAdmin"); 1292 } 1293 1294 @Override 1295 public void cloneTableSchema(TableName tableName, TableName newTableName, 1296 boolean preserveSplits) { 1297 throw new NotImplementedException("cloneTableSchema not supported in ThriftAdmin"); 1298 1299 } 1300 1301 @Override 1302 public Future<Void> createTableAsync(TableDescriptor desc) { 1303 throw new NotImplementedException("createTableAsync not supported in ThriftAdmin"); 1304 } 1305 1306 @Override 1307 public Future<Void> createTableAsync(TableDescriptor desc, byte[][] splitKeys) { 1308 throw new NotImplementedException("createTableAsync not supported in ThriftAdmin"); 1309 } 1310 1311 @Override 1312 public Future<Void> deleteTableAsync(TableName tableName) { 1313 throw new NotImplementedException("deleteTableAsync not supported in ThriftAdmin"); 1314 } 1315 1316 @Override 1317 public Future<Void> truncateTableAsync(TableName tableName, boolean preserveSplits) { 1318 throw new NotImplementedException("truncateTableAsync not supported in ThriftAdmin"); 1319 } 1320 1321 @Override 1322 public Future<Void> enableTableAsync(TableName tableName) { 1323 throw new NotImplementedException("enableTableAsync not supported in ThriftAdmin"); 1324 } 1325 1326 @Override 1327 public Future<Void> disableTableAsync(TableName tableName) { 1328 throw new NotImplementedException("disableTableAsync not supported in ThriftAdmin"); 1329 } 1330 1331 @Override 1332 public Pair<Integer, Integer> getAlterStatus(TableName tableName) { 1333 throw new NotImplementedException("getAlterStatus not supported in ThriftAdmin"); 1334 } 1335 1336 @Override 1337 public Pair<Integer, Integer> getAlterStatus(byte[] tableName) { 1338 throw new NotImplementedException("getAlterStatus not supported in ThriftAdmin"); 1339 } 1340 1341 @Override 1342 public Future<Void> deleteColumnFamilyAsync(TableName tableName, byte[] columnFamily) { 1343 throw new NotImplementedException("deleteColumnFamilyAsync not supported in ThriftAdmin"); 1344 } 1345 1346 @Override 1347 public Future<Void> addColumnFamilyAsync(TableName tableName, 1348 ColumnFamilyDescriptor columnFamily) { 1349 throw new NotImplementedException("addColumnFamilyAsync not supported in ThriftAdmin"); 1350 } 1351 1352 @Override 1353 public Future<Void> modifyColumnFamilyAsync(TableName tableName, 1354 ColumnFamilyDescriptor columnFamily) { 1355 throw new NotImplementedException("modifyColumnFamilyAsync not supported in ThriftAdmin"); 1356 } 1357 1358 @Override 1359 public Future<Void> deleteNamespaceAsync(String name) { 1360 throw new NotImplementedException("deleteNamespaceAsync not supported in ThriftAdmin"); 1361 } 1362 1363 @Override 1364 public Map<TableName, Long> getSpaceQuotaTableSizes() throws IOException { 1365 throw new NotImplementedException("getSpaceQuotaTableSizes not supported in ThriftAdmin"); 1366 } 1367 1368 @Override 1369 public Map<TableName, SpaceQuotaSnapshot> 1370 getRegionServerSpaceQuotaSnapshots(ServerName serverName) throws IOException { 1371 throw new NotImplementedException( 1372 "getRegionServerSpaceQuotaSnapshots not supported in ThriftAdmin"); 1373 } 1374 1375 @Override 1376 public SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(String namespace) throws IOException { 1377 throw new NotImplementedException("getCurrentSpaceQuotaSnapshot not supported in ThriftAdmin"); 1378 } 1379 1380 @Override 1381 public SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(TableName tableName) throws IOException { 1382 throw new NotImplementedException("getCurrentSpaceQuotaSnapshot not supported in ThriftAdmin"); 1383 } 1384 1385 @Override 1386 public void grant(UserPermission userPermission, boolean mergeExistingPermissions) { 1387 throw new NotImplementedException("grant not supported in ThriftAdmin"); 1388 } 1389 1390 @Override 1391 public void revoke(UserPermission userPermission) { 1392 throw new NotImplementedException("revoke not supported in ThriftAdmin"); 1393 } 1394 1395 @Override 1396 public List<UserPermission> 1397 getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) { 1398 throw new NotImplementedException("getUserPermissions not supported in ThriftAdmin"); 1399 } 1400 1401 @Override 1402 public List<Boolean> hasUserPermissions(String userName, List<Permission> permissions) { 1403 throw new NotImplementedException("hasUserPermissions not supported in ThriftAdmin"); 1404 } 1405 1406 @Override 1407 public boolean snapshotCleanupSwitch(boolean on, boolean synchronous) { 1408 throw new NotImplementedException("snapshotCleanupSwitch not supported in ThriftAdmin"); 1409 } 1410 1411 @Override 1412 public boolean isSnapshotCleanupEnabled() { 1413 throw new NotImplementedException("isSnapshotCleanupEnabled not supported in ThriftAdmin"); 1414 } 1415 1416 @Override 1417 public List<OnlineLogRecord> getSlowLogResponses(final Set<ServerName> serverNames, 1418 final LogQueryFilter logQueryFilter) throws IOException { 1419 Set<TServerName> tServerNames = ThriftUtilities.getServerNamesFromHBase(serverNames); 1420 TLogQueryFilter tLogQueryFilter = ThriftUtilities.getSlowLogQueryFromHBase(logQueryFilter); 1421 try { 1422 List<TOnlineLogRecord> tOnlineLogRecords = 1423 client.getSlowLogResponses(tServerNames, tLogQueryFilter); 1424 return ThriftUtilities.getSlowLogRecordsFromThrift(tOnlineLogRecords); 1425 } catch (TException e) { 1426 throw new IOException(e); 1427 } 1428 } 1429 1430 @Override 1431 public List<Boolean> clearSlowLogResponses(final Set<ServerName> serverNames) throws IOException { 1432 Set<TServerName> tServerNames = ThriftUtilities.getServerNamesFromHBase(serverNames); 1433 try { 1434 return client.clearSlowLogResponses(tServerNames); 1435 } catch (TException e) { 1436 throw new IOException(e); 1437 } 1438 } 1439 1440 @Override 1441 public Future<Void> splitRegionAsync(byte[] regionName) throws IOException { 1442 return splitRegionAsync(regionName, null); 1443 } 1444 1445 @Override 1446 public List<LogEntry> getLogEntries(Set<ServerName> serverNames, String logType, 1447 ServerType serverType, int limit, Map<String, Object> filterParams) throws IOException { 1448 throw new NotImplementedException("getLogEntries not supported in ThriftAdmin"); 1449 } 1450 1451 @Override 1452 public void flushMasterStore() throws IOException { 1453 throw new NotImplementedException("flushMasterStore not supported in ThriftAdmin"); 1454 } 1455 1456 @Override 1457 public Future<Void> modifyColumnFamilyStoreFileTrackerAsync(TableName tableName, byte[] family, 1458 String dstSFT) throws IOException { 1459 throw new NotImplementedException( 1460 "modifyColumnFamilyStoreFileTrackerAsync not supported in ThriftAdmin"); 1461 } 1462 1463 @Override 1464 public Future<Void> modifyTableStoreFileTrackerAsync(TableName tableName, String dstSFT) 1465 throws IOException { 1466 throw new NotImplementedException( 1467 "modifyTableStoreFileTrackerAsync not supported in ThriftAdmin"); 1468 } 1469}