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.ColumnFamilyDescriptor; 044import org.apache.hadoop.hbase.client.CompactType; 045import org.apache.hadoop.hbase.client.CompactionState; 046import org.apache.hadoop.hbase.client.Connection; 047import org.apache.hadoop.hbase.client.LogEntry; 048import org.apache.hadoop.hbase.client.LogQueryFilter; 049import org.apache.hadoop.hbase.client.NormalizeTableFilterParams; 050import org.apache.hadoop.hbase.client.OnlineLogRecord; 051import org.apache.hadoop.hbase.client.RegionInfo; 052import org.apache.hadoop.hbase.client.ServerType; 053import org.apache.hadoop.hbase.client.SnapshotDescription; 054import org.apache.hadoop.hbase.client.SnapshotType; 055import org.apache.hadoop.hbase.client.TableDescriptor; 056import org.apache.hadoop.hbase.client.replication.TableCFs; 057import org.apache.hadoop.hbase.client.security.SecurityCapability; 058import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; 059import org.apache.hadoop.hbase.quotas.QuotaFilter; 060import org.apache.hadoop.hbase.quotas.QuotaRetriever; 061import org.apache.hadoop.hbase.quotas.QuotaSettings; 062import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; 063import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; 064import org.apache.hadoop.hbase.replication.ReplicationPeerDescription; 065import org.apache.hadoop.hbase.security.access.GetUserPermissionsRequest; 066import org.apache.hadoop.hbase.security.access.Permission; 067import org.apache.hadoop.hbase.security.access.UserPermission; 068import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException; 069import org.apache.hadoop.hbase.thrift2.ThriftUtilities; 070import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor; 071import org.apache.hadoop.hbase.thrift2.generated.THBaseService; 072import org.apache.hadoop.hbase.thrift2.generated.TLogQueryFilter; 073import org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor; 074import org.apache.hadoop.hbase.thrift2.generated.TOnlineLogRecord; 075import org.apache.hadoop.hbase.thrift2.generated.TServerName; 076import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor; 077import org.apache.hadoop.hbase.thrift2.generated.TTableName; 078import org.apache.hadoop.hbase.util.Bytes; 079import org.apache.hadoop.hbase.util.Pair; 080import org.apache.thrift.TException; 081import org.apache.thrift.transport.TTransport; 082import org.apache.yetus.audience.InterfaceAudience; 083 084@InterfaceAudience.Private 085public class ThriftAdmin implements Admin { 086 087 private THBaseService.Client client; 088 private TTransport transport; 089 private int operationTimeout; 090 private int syncWaitTimeout; 091 private Configuration conf; 092 093 094 public ThriftAdmin(THBaseService.Client client, TTransport tTransport, Configuration conf) { 095 this.client = client; 096 this.transport = tTransport; 097 this.operationTimeout = conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 098 HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT); 099 this.syncWaitTimeout = conf.getInt("hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min 100 this.conf = conf; 101 } 102 103 @Override 104 public int getOperationTimeout() { 105 return operationTimeout; 106 } 107 108 @Override 109 public int getSyncWaitTimeout() { 110 return syncWaitTimeout; 111 } 112 113 @Override 114 public void abort(String why, Throwable e) { 115 } 116 117 @Override 118 public boolean isAborted() { 119 return false; 120 } 121 122 @Override 123 public void close() throws IOException { 124 transport.close(); 125 } 126 127 @Override 128 public Configuration getConfiguration() { 129 return conf; 130 } 131 132 @Override 133 public boolean tableExists(TableName tableName) throws IOException { 134 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 135 try { 136 return client.tableExists(tTableName); 137 } catch (TException e) { 138 throw new IOException(e); 139 } 140 } 141 142 @Override 143 public Connection getConnection() { 144 throw new NotImplementedException("getConnection not supported in ThriftAdmin"); 145 } 146 147 @Override 148 public HTableDescriptor[] listTables() throws IOException { 149 return listTables((String)null); 150 } 151 152 @Override 153 public List<TableDescriptor> listTableDescriptors() throws IOException { 154 return listTableDescriptors((Pattern) null); 155 } 156 157 @Override 158 public HTableDescriptor[] listTables(Pattern pattern) throws IOException { 159 String regex = (pattern == null ? null : pattern.toString()); 160 return listTables(regex); 161 } 162 163 @Override 164 public List<TableDescriptor> listTableDescriptors(Pattern pattern) throws IOException { 165 return listTableDescriptors(pattern, false); 166 } 167 168 @Override 169 public HTableDescriptor[] listTables(String regex) throws IOException { 170 return listTables(regex, false); 171 } 172 173 @Override 174 public HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables) 175 throws IOException { 176 String regex = (pattern == null ? null : pattern.toString()); 177 return listTables(regex, includeSysTables); 178 179 } 180 181 @Override 182 public List<TableDescriptor> listTableDescriptors(Pattern pattern, boolean includeSysTables) 183 throws IOException { 184 try { 185 String regex = (pattern == null ? null : pattern.toString()); 186 List<TTableDescriptor> tTableDescriptors = client 187 .getTableDescriptorsByPattern(regex, includeSysTables); 188 return ThriftUtilities.tableDescriptorsFromThrift(tTableDescriptors); 189 190 } catch (TException e) { 191 throw new IOException(e); 192 } 193 } 194 195 @Override 196 public HTableDescriptor[] listTables(String regex, boolean includeSysTables) throws IOException { 197 try { 198 List<TTableDescriptor> tTableDescriptors = client 199 .getTableDescriptorsByPattern(regex, includeSysTables); 200 return ThriftUtilities.hTableDescriptorsFromThrift(tTableDescriptors); 201 202 } catch (TException e) { 203 throw new IOException(e); 204 } 205 } 206 207 @Override 208 public TableName[] listTableNames() throws IOException { 209 return listTableNames((String)null); 210 } 211 212 @Override 213 public TableName[] listTableNames(Pattern pattern) throws IOException { 214 return listTableNames(pattern, false); 215 } 216 217 @Override 218 public TableName[] listTableNames(String regex) throws IOException { 219 return listTableNames(regex, false); 220 } 221 222 @Override 223 public TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException { 224 String regex = (pattern == null ? null : pattern.toString()); 225 return listTableNames(regex, includeSysTables); 226 } 227 228 @Override 229 public TableName[] listTableNames(String regex, boolean includeSysTables) throws IOException { 230 try { 231 List<TTableName> tTableNames = client.getTableNamesByPattern(regex, includeSysTables); 232 return ThriftUtilities.tableNamesArrayFromThrift(tTableNames); 233 } catch (TException e) { 234 throw new IOException(e); 235 } 236 } 237 238 @Override 239 public HTableDescriptor getTableDescriptor(TableName tableName) 240 throws TableNotFoundException, IOException { 241 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 242 try { 243 TTableDescriptor tTableDescriptor = client.getTableDescriptor(tTableName); 244 return ThriftUtilities.hTableDescriptorFromThrift(tTableDescriptor); 245 } catch (TException e) { 246 throw new IOException(e); 247 } 248 } 249 250 @Override 251 public TableDescriptor getDescriptor(TableName tableName) 252 throws TableNotFoundException, IOException { 253 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 254 try { 255 TTableDescriptor tTableDescriptor = client.getTableDescriptor(tTableName); 256 return ThriftUtilities.tableDescriptorFromThrift(tTableDescriptor); 257 } catch (TException e) { 258 throw new IOException(e); 259 } 260 } 261 262 @Override 263 public HTableDescriptor[] listTableDescriptorsByNamespace(String name) throws IOException { 264 try { 265 List<TTableDescriptor> tTableDescriptors = client.getTableDescriptorsByNamespace(name); 266 return ThriftUtilities.hTableDescriptorsFromThrift(tTableDescriptors); 267 } catch (TException e) { 268 throw new IOException(e); 269 } 270 } 271 272 @Override 273 public List<TableDescriptor> listTableDescriptorsByNamespace(byte[] name) throws IOException { 274 try { 275 List<TTableDescriptor> tTableDescriptors = client 276 .getTableDescriptorsByNamespace(Bytes.toString(name)); 277 return ThriftUtilities.tableDescriptorsFromThrift(tTableDescriptors); 278 } catch (TException e) { 279 throw new IOException(e); 280 } 281 } 282 283 @Override 284 public TableName[] listTableNamesByNamespace(String name) throws IOException { 285 try { 286 List<TTableName> tTableNames = client.getTableNamesByNamespace(name); 287 return ThriftUtilities.tableNamesArrayFromThrift(tTableNames); 288 } catch (TException e) { 289 throw new IOException(e); 290 } 291 } 292 293 @Override 294 public void createTable(TableDescriptor desc) throws IOException { 295 createTable(desc, null); 296 } 297 298 @Override 299 public void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRegions) 300 throws IOException { 301 if(numRegions < 3) { 302 throw new IllegalArgumentException("Must create at least three regions"); 303 } else if(Bytes.compareTo(startKey, endKey) >= 0) { 304 throw new IllegalArgumentException("Start key must be smaller than end key"); 305 } 306 if (numRegions == 3) { 307 createTable(desc, new byte[][]{startKey, endKey}); 308 return; 309 } 310 byte [][] splitKeys = Bytes.split(startKey, endKey, numRegions - 3); 311 if(splitKeys == null || splitKeys.length != numRegions - 1) { 312 throw new IllegalArgumentException("Unable to split key range into enough regions"); 313 } 314 createTable(desc, splitKeys); 315 } 316 317 @Override 318 public void createTable(TableDescriptor desc, byte[][] splitKeys) throws IOException { 319 TTableDescriptor tTableDescriptor = ThriftUtilities.tableDescriptorFromHBase(desc); 320 List<ByteBuffer> splitKeyInBuffer = ThriftUtilities.splitKeyFromHBase(splitKeys); 321 try { 322 client.createTable(tTableDescriptor, splitKeyInBuffer); 323 } catch (TException e) { 324 throw new IOException(e); 325 } 326 } 327 328 @Override 329 public void deleteTable(TableName tableName) throws IOException { 330 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 331 try { 332 client.deleteTable(tTableName); 333 } catch (TException e) { 334 throw new IOException(e); 335 } 336 } 337 338 @Override 339 public void truncateTable(TableName tableName, boolean preserveSplits) throws IOException { 340 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 341 try { 342 client.truncateTable(tTableName, preserveSplits); 343 } catch (TException e) { 344 throw new IOException(e); 345 } 346 } 347 348 @Override 349 public void enableTable(TableName tableName) throws IOException { 350 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 351 try { 352 client.enableTable(tTableName); 353 } catch (TException e) { 354 throw new IOException(e); 355 } 356 } 357 358 @Override 359 public void disableTable(TableName tableName) throws IOException { 360 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 361 try { 362 client.disableTable(tTableName); 363 } catch (TException e) { 364 throw new IOException(e); 365 } 366 } 367 368 @Override 369 public boolean isTableEnabled(TableName tableName) throws IOException { 370 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 371 try { 372 return client.isTableEnabled(tTableName); 373 } catch (TException e) { 374 throw new IOException(e); 375 } 376 } 377 378 @Override 379 public boolean isTableDisabled(TableName tableName) throws IOException { 380 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 381 try { 382 return client.isTableDisabled(tTableName); 383 } catch (TException e) { 384 throw new IOException(e); 385 } 386 } 387 388 @Override 389 public boolean isTableAvailable(TableName tableName) throws IOException { 390 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 391 try { 392 return client.isTableAvailable(tTableName); 393 } catch (TException e) { 394 throw new IOException(e); 395 } 396 } 397 398 @Override 399 public boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException { 400 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 401 List<ByteBuffer> splitKeyInBuffer = ThriftUtilities.splitKeyFromHBase(splitKeys); 402 try { 403 return client.isTableAvailableWithSplit(tTableName, splitKeyInBuffer); 404 } catch (TException e) { 405 throw new IOException(e); 406 } 407 } 408 409 @Override 410 public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) 411 throws IOException { 412 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 413 TColumnFamilyDescriptor tColumnFamilyDescriptor = ThriftUtilities 414 .columnFamilyDescriptorFromHBase(columnFamily); 415 try { 416 client.addColumnFamily(tTableName, tColumnFamilyDescriptor); 417 } catch (TException e) { 418 throw new IOException(e); 419 } 420 } 421 422 @Override 423 public void deleteColumn(TableName tableName, byte[] columnFamily) throws IOException { 424 deleteColumnFamily(tableName, columnFamily); 425 } 426 427 @Override 428 public void deleteColumnFamily(TableName tableName, byte[] columnFamily) throws IOException { 429 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 430 try { 431 client.deleteColumnFamily(tTableName, ByteBuffer.wrap(columnFamily)); 432 } catch (TException e) { 433 throw new IOException(e); 434 } 435 } 436 437 @Override 438 public void modifyColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamily) 439 throws IOException { 440 TTableName tTableName = ThriftUtilities.tableNameFromHBase(tableName); 441 TColumnFamilyDescriptor tColumnFamilyDescriptor = ThriftUtilities 442 .columnFamilyDescriptorFromHBase(columnFamily); 443 try { 444 client.modifyColumnFamily(tTableName, tColumnFamilyDescriptor); 445 } catch (TException e) { 446 throw new IOException(e); 447 } 448 } 449 450 @Override 451 public void modifyTable(TableName tableName, TableDescriptor td) throws IOException { 452 modifyTable(td); 453 } 454 455 @Override 456 public void modifyTable(TableDescriptor td) throws IOException { 457 TTableDescriptor tTableDescriptor = ThriftUtilities 458 .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 = ThriftUtilities 469 .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 = ThriftUtilities 520 .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 boolean isBalancerEnabled() { 791 throw new NotImplementedException("isBalancerEnabled not supported in ThriftAdmin"); 792 } 793 794 @Override 795 public CacheEvictionStats clearBlockCache(TableName tableName) { 796 throw new NotImplementedException("clearBlockCache not supported in ThriftAdmin"); 797 } 798 799 @Override 800 public boolean normalize(NormalizeTableFilterParams ntfp) { 801 throw new NotImplementedException("normalize not supported in ThriftAdmin"); 802 } 803 804 @Override 805 public boolean isNormalizerEnabled() { 806 throw new NotImplementedException("isNormalizerEnabled not supported in ThriftAdmin"); 807 } 808 809 @Override 810 public boolean normalizerSwitch(boolean on) { 811 throw new NotImplementedException("normalizerSwitch not supported in ThriftAdmin"); 812 } 813 814 @Override 815 public boolean catalogJanitorSwitch(boolean onOrOff) { 816 throw new NotImplementedException("catalogJanitorSwitch not supported in ThriftAdmin"); 817 } 818 819 @Override 820 public int runCatalogJanitor() { 821 throw new NotImplementedException("runCatalogJanitor not supported in ThriftAdmin"); 822 } 823 824 @Override 825 public boolean isCatalogJanitorEnabled() { 826 throw new NotImplementedException("isCatalogJanitorEnabled not supported in ThriftAdmin"); 827 } 828 829 @Override 830 public boolean cleanerChoreSwitch(boolean onOrOff) { 831 throw new NotImplementedException("cleanerChoreSwitch not supported in ThriftAdmin"); 832 } 833 834 @Override 835 public boolean runCleanerChore() { 836 throw new NotImplementedException("runCleanerChore not supported in ThriftAdmin"); 837 } 838 839 @Override 840 public boolean isCleanerChoreEnabled() { 841 throw new NotImplementedException("isCleanerChoreEnabled not supported in ThriftAdmin"); 842 } 843 844 @Override 845 public void mergeRegions(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) { 846 throw new NotImplementedException("mergeRegions not supported in ThriftAdmin"); 847 848 } 849 850 @Override 851 public Future<Void> mergeRegionsAsync(byte[] nameOfRegionA, byte[] nameOfRegionB, 852 boolean forcible) { 853 throw new NotImplementedException("mergeRegionsAsync not supported in ThriftAdmin"); 854 } 855 856 @Override 857 public Future<Void> mergeRegionsAsync(byte[][] nameofRegionsToMerge, boolean forcible) { 858 throw new NotImplementedException("mergeRegionsAsync not supported in ThriftAdmin"); 859 } 860 861 @Override 862 public void split(TableName tableName) { 863 throw new NotImplementedException("split not supported in ThriftAdmin"); 864 } 865 866 @Override 867 public void splitRegion(byte[] regionName) { 868 throw new NotImplementedException("splitRegion not supported in ThriftAdmin"); 869 } 870 871 @Override 872 public void split(TableName tableName, byte[] splitPoint) { 873 throw new NotImplementedException("split not supported in ThriftAdmin"); 874 } 875 876 @Override 877 public void splitRegion(byte[] regionName, byte[] splitPoint) { 878 throw new NotImplementedException("splitRegion not supported in ThriftAdmin"); 879 } 880 881 @Override 882 public Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint) { 883 throw new NotImplementedException("splitRegionAsync not supported in ThriftAdmin"); 884 } 885 886 @Override 887 public Future<Void> modifyTableAsync(TableName tableName, TableDescriptor td) { 888 throw new NotImplementedException("modifyTableAsync not supported in ThriftAdmin"); 889 } 890 891 @Override 892 public Future<Void> modifyTableAsync(TableDescriptor td) { 893 throw new NotImplementedException("modifyTableAsync not supported in ThriftAdmin"); 894 } 895 896 @Override 897 public void shutdown() { 898 throw new NotImplementedException("shutdown not supported in ThriftAdmin"); 899 900 } 901 902 @Override 903 public void stopMaster() { 904 throw new NotImplementedException("stopMaster not supported in ThriftAdmin"); 905 906 } 907 908 @Override 909 public boolean isMasterInMaintenanceMode() { 910 throw new NotImplementedException("isMasterInMaintenanceMode not supported in ThriftAdmin"); 911 } 912 913 @Override 914 public void stopRegionServer(String hostnamePort) { 915 throw new NotImplementedException("stopRegionServer not supported in ThriftAdmin"); 916 917 } 918 919 @Override 920 public ClusterMetrics getClusterMetrics(EnumSet<ClusterMetrics.Option> options) { 921 throw new NotImplementedException("getClusterMetrics not supported in ThriftAdmin"); 922 } 923 924 @Override 925 public List<RegionMetrics> getRegionMetrics(ServerName serverName, TableName tableName) { 926 throw new NotImplementedException("getRegionMetrics not supported in ThriftAdmin"); 927 } 928 929 @Override 930 public Future<Void> createNamespaceAsync(NamespaceDescriptor descriptor) { 931 throw new NotImplementedException("createNamespaceAsync not supported in ThriftAdmin"); 932 } 933 934 @Override 935 public Future<Void> modifyNamespaceAsync(NamespaceDescriptor descriptor) { 936 throw new NotImplementedException("modifyNamespaceAsync not supported in ThriftAdmin"); 937 } 938 939 @Override 940 public List<HRegionInfo> getTableRegions(TableName tableName) { 941 throw new NotImplementedException("getTableRegions not supported in ThriftAdmin"); 942 } 943 944 @Override 945 public List<RegionInfo> getRegions(TableName tableName) { 946 throw new NotImplementedException("getRegions not supported in ThriftAdmin"); 947 } 948 949 @Override 950 public boolean abortProcedure(long procId, boolean mayInterruptIfRunning) { 951 throw new NotImplementedException("abortProcedure not supported in ThriftAdmin"); 952 } 953 954 @Override 955 public Future<Boolean> abortProcedureAsync(long procId, boolean mayInterruptIfRunning) { 956 throw new NotImplementedException("abortProcedureAsync not supported in ThriftAdmin"); 957 } 958 959 @Override 960 public String getProcedures() { 961 throw new NotImplementedException("getProcedures not supported in ThriftAdmin"); 962 } 963 964 @Override 965 public String getLocks() { 966 throw new NotImplementedException("getLocks not supported in ThriftAdmin"); 967 } 968 969 @Override 970 public void rollWALWriter(ServerName serverName) { 971 throw new NotImplementedException("rollWALWriter not supported in ThriftAdmin"); 972 973 } 974 975 @Override 976 public CompactionState getCompactionState(TableName tableName) { 977 throw new NotImplementedException("getCompactionState not supported in ThriftAdmin"); 978 } 979 980 @Override 981 public CompactionState getCompactionState(TableName tableName, CompactType compactType) { 982 throw new NotImplementedException("getCompactionState not supported in ThriftAdmin"); 983 } 984 985 @Override 986 public CompactionState getCompactionStateForRegion(byte[] regionName) { 987 throw new NotImplementedException("getCompactionStateForRegion not supported in ThriftAdmin"); 988 } 989 990 @Override 991 public long getLastMajorCompactionTimestamp(TableName tableName) { 992 throw new NotImplementedException( 993 "getLastMajorCompactionTimestamp not supported in ThriftAdmin"); 994 } 995 996 @Override 997 public long getLastMajorCompactionTimestampForRegion(byte[] regionName) { 998 throw new NotImplementedException( 999 "getLastMajorCompactionTimestampForRegion not supported in ThriftAdmin"); 1000 } 1001 1002 @Override 1003 public void snapshot(String snapshotName, TableName tableName) { 1004 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1005 1006 } 1007 1008 @Override 1009 public void snapshot(byte[] snapshotName, TableName tableName) { 1010 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1011 1012 } 1013 1014 @Override 1015 public void snapshot(String snapshotName, TableName tableName, SnapshotType type) { 1016 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1017 1018 } 1019 1020 @Override 1021 public void snapshot(SnapshotDescription snapshot) { 1022 throw new NotImplementedException("snapshot not supported in ThriftAdmin"); 1023 1024 } 1025 1026 @Override 1027 public Future<Void> snapshotAsync(SnapshotDescription snapshot) { 1028 throw new NotImplementedException("snapshotAsync not supported in ThriftAdmin"); 1029 1030 } 1031 1032 @Override 1033 public boolean isSnapshotFinished(SnapshotDescription snapshot) { 1034 throw new NotImplementedException("isSnapshotFinished not supported in ThriftAdmin"); 1035 } 1036 1037 @Override 1038 public void restoreSnapshot(byte[] snapshotName) { 1039 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1040 1041 } 1042 1043 @Override 1044 public void restoreSnapshot(String snapshotName) { 1045 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1046 1047 } 1048 1049 @Override 1050 public Future<Void> restoreSnapshotAsync(String snapshotName) { 1051 throw new NotImplementedException("restoreSnapshotAsync not supported in ThriftAdmin"); 1052 } 1053 1054 @Override 1055 public void restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot, 1056 boolean restoreAcl) { 1057 throw new NotImplementedException("restoreSnapshot not supported in ThriftAdmin"); 1058 } 1059 1060 @Override 1061 public Future<Void> cloneSnapshotAsync(String snapshotName, TableName tableName, boolean cloneAcl) 1062 throws IOException, TableExistsException, RestoreSnapshotException { 1063 throw new NotImplementedException("cloneSnapshotAsync not supported in ThriftAdmin"); 1064 } 1065 1066 @Override 1067 public void execProcedure(String signature, String instance, Map<String, String> props) { 1068 throw new NotImplementedException("execProcedure not supported in ThriftAdmin"); 1069 1070 } 1071 1072 @Override 1073 public byte[] execProcedureWithReturn(String signature, String instance, 1074 Map<String, String> props) { 1075 throw new NotImplementedException("execProcedureWithReturn not supported in ThriftAdmin"); 1076 } 1077 1078 @Override 1079 public boolean isProcedureFinished(String signature, String instance, Map<String, String> props) { 1080 throw new NotImplementedException("isProcedureFinished not supported in ThriftAdmin"); 1081 } 1082 1083 @Override 1084 public List<SnapshotDescription> listSnapshots() { 1085 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1086 } 1087 1088 @Override 1089 public List<SnapshotDescription> listSnapshots(String regex) { 1090 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1091 } 1092 1093 @Override 1094 public List<SnapshotDescription> listSnapshots(Pattern pattern) { 1095 throw new NotImplementedException("listSnapshots not supported in ThriftAdmin"); 1096 } 1097 1098 @Override 1099 public List<SnapshotDescription> listTableSnapshots(String tableNameRegex, 1100 String snapshotNameRegex) { 1101 throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin"); 1102 } 1103 1104 @Override 1105 public List<SnapshotDescription> listTableSnapshots(Pattern tableNamePattern, 1106 Pattern snapshotNamePattern) { 1107 throw new NotImplementedException("listTableSnapshots not supported in ThriftAdmin"); 1108 } 1109 1110 @Override 1111 public void deleteSnapshot(byte[] snapshotName) { 1112 throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin"); 1113 } 1114 1115 @Override 1116 public void deleteSnapshot(String snapshotName) { 1117 throw new NotImplementedException("deleteSnapshot not supported in ThriftAdmin"); 1118 } 1119 1120 @Override 1121 public void deleteSnapshots(String regex) { 1122 throw new NotImplementedException("deleteSnapshots not supported in ThriftAdmin"); 1123 } 1124 1125 @Override 1126 public void deleteSnapshots(Pattern pattern) { 1127 throw new NotImplementedException("deleteSnapshots not supported in ThriftAdmin"); 1128 } 1129 1130 @Override 1131 public void deleteTableSnapshots(String tableNameRegex, String snapshotNameRegex) { 1132 throw new NotImplementedException("deleteTableSnapshots not supported in ThriftAdmin"); 1133 } 1134 1135 @Override 1136 public void deleteTableSnapshots(Pattern tableNamePattern, Pattern snapshotNamePattern) { 1137 throw new NotImplementedException("deleteTableSnapshots not supported in ThriftAdmin"); 1138 } 1139 1140 @Override 1141 public void setQuota(QuotaSettings quota) { 1142 throw new NotImplementedException("setQuota not supported in ThriftAdmin"); 1143 } 1144 1145 @Override 1146 public QuotaRetriever getQuotaRetriever(QuotaFilter filter) { 1147 throw new NotImplementedException("getQuotaRetriever not supported in ThriftAdmin"); 1148 } 1149 1150 @Override 1151 public List<QuotaSettings> getQuota(QuotaFilter filter) { 1152 throw new NotImplementedException("getQuota not supported in ThriftAdmin"); 1153 } 1154 1155 @Override 1156 public CoprocessorRpcChannel coprocessorService() { 1157 throw new NotImplementedException("coprocessorService not supported in ThriftAdmin"); 1158 } 1159 1160 @Override 1161 public CoprocessorRpcChannel coprocessorService(ServerName serverName) { 1162 throw new NotImplementedException("coprocessorService not supported in ThriftAdmin"); 1163 } 1164 1165 @Override 1166 public void updateConfiguration(ServerName server) { 1167 throw new NotImplementedException("updateConfiguration not supported in ThriftAdmin"); 1168 } 1169 1170 @Override 1171 public void updateConfiguration() { 1172 throw new NotImplementedException("updateConfiguration not supported in ThriftAdmin"); 1173 } 1174 1175 @Override 1176 public List<SecurityCapability> getSecurityCapabilities() { 1177 throw new NotImplementedException("getSecurityCapabilities not supported in ThriftAdmin"); 1178 } 1179 1180 @Override 1181 public boolean splitSwitch(boolean enabled, boolean synchronous) { 1182 throw new NotImplementedException("splitSwitch not supported in ThriftAdmin"); 1183 } 1184 1185 @Override 1186 public boolean mergeSwitch(boolean enabled, boolean synchronous) { 1187 throw new NotImplementedException("mergeSwitch not supported in ThriftAdmin"); 1188 } 1189 1190 @Override 1191 public boolean isSplitEnabled() { 1192 throw new NotImplementedException("isSplitEnabled not supported in ThriftAdmin"); 1193 } 1194 1195 @Override 1196 public boolean isMergeEnabled() { 1197 throw new NotImplementedException("isMergeEnabled not supported in ThriftAdmin"); 1198 } 1199 1200 @Override 1201 public Future<Void> addReplicationPeerAsync(String peerId, ReplicationPeerConfig peerConfig, 1202 boolean enabled) { 1203 throw new NotImplementedException("addReplicationPeerAsync not supported in ThriftAdmin"); 1204 } 1205 1206 @Override 1207 public Future<Void> removeReplicationPeerAsync(String peerId) { 1208 throw new NotImplementedException("removeReplicationPeerAsync not supported in ThriftAdmin"); 1209 } 1210 1211 @Override 1212 public Future<Void> enableReplicationPeerAsync(String peerId) { 1213 throw new NotImplementedException("enableReplicationPeerAsync not supported in ThriftAdmin"); 1214 } 1215 1216 @Override 1217 public Future<Void> disableReplicationPeerAsync(String peerId) { 1218 throw new NotImplementedException("disableReplicationPeerAsync not supported in ThriftAdmin"); 1219 } 1220 1221 @Override 1222 public ReplicationPeerConfig getReplicationPeerConfig(String peerId) { 1223 throw new NotImplementedException("getReplicationPeerConfig not supported in ThriftAdmin"); 1224 } 1225 1226 @Override 1227 public Future<Void> updateReplicationPeerConfigAsync(String peerId, 1228 ReplicationPeerConfig peerConfig) { 1229 throw new NotImplementedException( 1230 "updateReplicationPeerConfigAsync not supported in ThriftAdmin"); 1231 } 1232 1233 @Override 1234 public List<ReplicationPeerDescription> listReplicationPeers() { 1235 throw new NotImplementedException("listReplicationPeers not supported in ThriftAdmin"); 1236 } 1237 1238 @Override 1239 public List<ReplicationPeerDescription> listReplicationPeers(Pattern pattern) { 1240 throw new NotImplementedException("listReplicationPeers not supported in ThriftAdmin"); 1241 } 1242 1243 @Override 1244 public void decommissionRegionServers(List<ServerName> servers, boolean offload) { 1245 throw new NotImplementedException("decommissionRegionServers not supported in ThriftAdmin"); 1246 1247 } 1248 1249 @Override 1250 public List<ServerName> listDecommissionedRegionServers() { 1251 throw new NotImplementedException( 1252 "listDecommissionedRegionServers not supported in ThriftAdmin"); 1253 } 1254 1255 @Override 1256 public void recommissionRegionServer(ServerName server, List<byte[]> encodedRegionNames) { 1257 throw new NotImplementedException("recommissionRegionServer not supported in ThriftAdmin"); 1258 1259 } 1260 1261 @Override 1262 public List<TableCFs> listReplicatedTableCFs() { 1263 throw new NotImplementedException("listReplicatedTableCFs not supported in ThriftAdmin"); 1264 } 1265 1266 @Override 1267 public void enableTableReplication(TableName tableName) { 1268 throw new NotImplementedException("enableTableReplication not supported in ThriftAdmin"); 1269 1270 } 1271 1272 @Override 1273 public void disableTableReplication(TableName tableName) { 1274 throw new NotImplementedException("disableTableReplication not supported in ThriftAdmin"); 1275 1276 } 1277 1278 @Override 1279 public void clearCompactionQueues(ServerName serverName, Set<String> queues) { 1280 throw new NotImplementedException("clearCompactionQueues not supported in ThriftAdmin"); 1281 1282 } 1283 1284 @Override 1285 public List<ServerName> clearDeadServers(List<ServerName> servers) { 1286 throw new NotImplementedException("clearDeadServers not supported in ThriftAdmin"); 1287 } 1288 1289 @Override 1290 public void cloneTableSchema(TableName tableName, TableName newTableName, 1291 boolean preserveSplits) { 1292 throw new NotImplementedException("cloneTableSchema not supported in ThriftAdmin"); 1293 1294 } 1295 1296 @Override 1297 public Future<Void> createTableAsync(TableDescriptor desc) { 1298 throw new NotImplementedException("createTableAsync not supported in ThriftAdmin"); 1299 } 1300 1301 @Override 1302 public Future<Void> createTableAsync(TableDescriptor desc, byte[][] splitKeys) { 1303 throw new NotImplementedException("createTableAsync not supported in ThriftAdmin"); 1304 } 1305 1306 @Override 1307 public Future<Void> deleteTableAsync(TableName tableName) { 1308 throw new NotImplementedException("deleteTableAsync not supported in ThriftAdmin"); 1309 } 1310 1311 @Override 1312 public Future<Void> truncateTableAsync(TableName tableName, boolean preserveSplits) { 1313 throw new NotImplementedException("truncateTableAsync not supported in ThriftAdmin"); 1314 } 1315 1316 @Override 1317 public Future<Void> enableTableAsync(TableName tableName) { 1318 throw new NotImplementedException("enableTableAsync not supported in ThriftAdmin"); 1319 } 1320 1321 @Override 1322 public Future<Void> disableTableAsync(TableName tableName) { 1323 throw new NotImplementedException("disableTableAsync not supported in ThriftAdmin"); 1324 } 1325 1326 @Override 1327 public Pair<Integer, Integer> getAlterStatus(TableName tableName) { 1328 throw new NotImplementedException("getAlterStatus not supported in ThriftAdmin"); 1329 } 1330 1331 @Override 1332 public Pair<Integer, Integer> getAlterStatus(byte[] tableName) { 1333 throw new NotImplementedException("getAlterStatus not supported in ThriftAdmin"); 1334 } 1335 1336 @Override 1337 public Future<Void> deleteColumnFamilyAsync(TableName tableName, byte[] columnFamily) { 1338 throw new NotImplementedException("deleteColumnFamilyAsync not supported in ThriftAdmin"); 1339 } 1340 1341 @Override 1342 public Future<Void> addColumnFamilyAsync(TableName tableName, 1343 ColumnFamilyDescriptor columnFamily) { 1344 throw new NotImplementedException("addColumnFamilyAsync not supported in ThriftAdmin"); 1345 } 1346 1347 @Override 1348 public Future<Void> modifyColumnFamilyAsync(TableName tableName, 1349 ColumnFamilyDescriptor columnFamily) { 1350 throw new NotImplementedException("modifyColumnFamilyAsync not supported in ThriftAdmin"); 1351 } 1352 1353 @Override 1354 public Future<Void> deleteNamespaceAsync(String name) { 1355 throw new NotImplementedException("deleteNamespaceAsync not supported in ThriftAdmin"); 1356 } 1357 1358 @Override 1359 public Map<TableName, Long> getSpaceQuotaTableSizes() throws IOException { 1360 throw new NotImplementedException("getSpaceQuotaTableSizes not supported in ThriftAdmin"); 1361 } 1362 1363 @Override 1364 public Map<TableName, SpaceQuotaSnapshot> getRegionServerSpaceQuotaSnapshots( 1365 ServerName serverName) throws IOException { 1366 throw new NotImplementedException( 1367 "getRegionServerSpaceQuotaSnapshots not supported in ThriftAdmin"); 1368 } 1369 1370 @Override 1371 public SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(String namespace) throws IOException { 1372 throw new NotImplementedException("getCurrentSpaceQuotaSnapshot not supported in ThriftAdmin"); 1373 } 1374 1375 @Override 1376 public SpaceQuotaSnapshot getCurrentSpaceQuotaSnapshot(TableName tableName) throws IOException { 1377 throw new NotImplementedException("getCurrentSpaceQuotaSnapshot not supported in ThriftAdmin"); 1378 } 1379 1380 @Override 1381 public void grant(UserPermission userPermission, boolean mergeExistingPermissions) { 1382 throw new NotImplementedException("grant not supported in ThriftAdmin"); 1383 } 1384 1385 @Override 1386 public void revoke(UserPermission userPermission) { 1387 throw new NotImplementedException("revoke not supported in ThriftAdmin"); 1388 } 1389 1390 @Override 1391 public List<UserPermission> 1392 getUserPermissions(GetUserPermissionsRequest getUserPermissionsRequest) { 1393 throw new NotImplementedException("getUserPermissions not supported in ThriftAdmin"); 1394 } 1395 1396 @Override 1397 public List<Boolean> hasUserPermissions(String userName, List<Permission> permissions) { 1398 throw new NotImplementedException("hasUserPermissions not supported in ThriftAdmin"); 1399 } 1400 1401 @Override 1402 public boolean snapshotCleanupSwitch(boolean on, boolean synchronous) { 1403 throw new NotImplementedException("snapshotCleanupSwitch not supported in ThriftAdmin"); 1404 } 1405 1406 @Override 1407 public boolean isSnapshotCleanupEnabled() { 1408 throw new NotImplementedException("isSnapshotCleanupEnabled not supported in ThriftAdmin"); 1409 } 1410 1411 @Override 1412 public List<OnlineLogRecord> getSlowLogResponses(final Set<ServerName> serverNames, 1413 final LogQueryFilter logQueryFilter) throws IOException { 1414 Set<TServerName> tServerNames = ThriftUtilities.getServerNamesFromHBase(serverNames); 1415 TLogQueryFilter tLogQueryFilter = 1416 ThriftUtilities.getSlowLogQueryFromHBase(logQueryFilter); 1417 try { 1418 List<TOnlineLogRecord> tOnlineLogRecords = 1419 client.getSlowLogResponses(tServerNames, tLogQueryFilter); 1420 return ThriftUtilities.getSlowLogRecordsFromThrift(tOnlineLogRecords); 1421 } catch (TException e) { 1422 throw new IOException(e); 1423 } 1424 } 1425 1426 @Override 1427 public List<Boolean> clearSlowLogResponses(final Set<ServerName> serverNames) 1428 throws IOException { 1429 Set<TServerName> tServerNames = ThriftUtilities.getServerNamesFromHBase(serverNames); 1430 try { 1431 return client.clearSlowLogResponses(tServerNames); 1432 } catch (TException e) { 1433 throw new IOException(e); 1434 } 1435 } 1436 1437 @Override 1438 public Future<Void> splitRegionAsync(byte[] regionName) throws IOException { 1439 return splitRegionAsync(regionName, null); 1440 } 1441 1442 @Override 1443 public List<LogEntry> getLogEntries(Set<ServerName> serverNames, String logType, 1444 ServerType serverType, int limit, Map<String, Object> filterParams) 1445 throws IOException { 1446 throw new NotImplementedException("getLogEntries not supported in ThriftAdmin"); 1447 } 1448}