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