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