Search in sources :

Example 31 with TIOError

use of org.apache.hadoop.hbase.thrift2.generated.TIOError in project hbase by apache.

the class ThriftHBaseServiceHandler method disableTable.

@Override
public void disableTable(TTableName tableName) throws TIOError, TException {
    try {
        TableName table = tableNameFromThrift(tableName);
        connectionCache.getAdmin().disableTable(table);
    } catch (IOException e) {
        throw getTIOError(e);
    }
}
Also used : TTableName(org.apache.hadoop.hbase.thrift2.generated.TTableName) TableName(org.apache.hadoop.hbase.TableName) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) IOException(java.io.IOException)

Example 32 with TIOError

use of org.apache.hadoop.hbase.thrift2.generated.TIOError in project hbase by apache.

the class ThriftHBaseServiceHandler method getSlowLogResponses.

@Override
public List<TOnlineLogRecord> getSlowLogResponses(Set<TServerName> tServerNames, TLogQueryFilter tLogQueryFilter) throws TIOError, TException {
    try {
        Set<ServerName> serverNames = ThriftUtilities.getServerNamesFromThrift(tServerNames);
        LogQueryFilter logQueryFilter = ThriftUtilities.getSlowLogQueryFromThrift(tLogQueryFilter);
        List<OnlineLogRecord> onlineLogRecords = connectionCache.getAdmin().getSlowLogResponses(serverNames, logQueryFilter);
        return ThriftUtilities.getSlowLogRecordsFromHBase(onlineLogRecords);
    } catch (IOException e) {
        throw getTIOError(e);
    }
}
Also used : ServerName(org.apache.hadoop.hbase.ServerName) TServerName(org.apache.hadoop.hbase.thrift2.generated.TServerName) TOnlineLogRecord(org.apache.hadoop.hbase.thrift2.generated.TOnlineLogRecord) OnlineLogRecord(org.apache.hadoop.hbase.client.OnlineLogRecord) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) IOException(java.io.IOException) TLogQueryFilter(org.apache.hadoop.hbase.thrift2.generated.TLogQueryFilter) LogQueryFilter(org.apache.hadoop.hbase.client.LogQueryFilter)

Example 33 with TIOError

use of org.apache.hadoop.hbase.thrift2.generated.TIOError in project hbase by apache.

the class ThriftHBaseServiceHandler method modifyTable.

@Override
public void modifyTable(TTableDescriptor desc) throws TIOError, TException {
    try {
        TableDescriptor descriptor = tableDescriptorFromThrift(desc);
        connectionCache.getAdmin().modifyTable(descriptor);
    } catch (IOException e) {
        throw getTIOError(e);
    }
}
Also used : DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) IOException(java.io.IOException) TTableDescriptor(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor) TableDescriptor(org.apache.hadoop.hbase.client.TableDescriptor)

Example 34 with TIOError

use of org.apache.hadoop.hbase.thrift2.generated.TIOError in project hbase by apache.

the class ThriftHBaseServiceHandler method getTableDescriptor.

@Override
public TTableDescriptor getTableDescriptor(TTableName table) throws TIOError, TException {
    try {
        TableName tableName = ThriftUtilities.tableNameFromThrift(table);
        TableDescriptor tableDescriptor = connectionCache.getAdmin().getDescriptor(tableName);
        return tableDescriptorFromHBase(tableDescriptor);
    } catch (IOException e) {
        throw getTIOError(e);
    }
}
Also used : TTableName(org.apache.hadoop.hbase.thrift2.generated.TTableName) TableName(org.apache.hadoop.hbase.TableName) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) IOException(java.io.IOException) TTableDescriptor(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor) TableDescriptor(org.apache.hadoop.hbase.client.TableDescriptor)

Example 35 with TIOError

use of org.apache.hadoop.hbase.thrift2.generated.TIOError in project hbase by apache.

the class ThriftHBaseServiceHandler method getTableNamesByPattern.

@Override
public List<TTableName> getTableNamesByPattern(String regex, boolean includeSysTables) throws TIOError, TException {
    try {
        Pattern pattern = (regex == null ? null : Pattern.compile(regex));
        TableName[] tableNames = connectionCache.getAdmin().listTableNames(pattern, includeSysTables);
        return tableNamesFromHBase(tableNames);
    } catch (IOException e) {
        throw getTIOError(e);
    }
}
Also used : Pattern(java.util.regex.Pattern) TTableName(org.apache.hadoop.hbase.thrift2.generated.TTableName) TableName(org.apache.hadoop.hbase.TableName) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) IOException(java.io.IOException)

Aggregations

DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)29 IOException (java.io.IOException)18 ByteBuffer (java.nio.ByteBuffer)17 Test (org.junit.Test)17 TIOError (org.apache.hadoop.hbase.thrift2.generated.TIOError)16 ArrayList (java.util.ArrayList)12 TableName (org.apache.hadoop.hbase.TableName)9 TTableName (org.apache.hadoop.hbase.thrift2.generated.TTableName)9 TColumnValue (org.apache.hadoop.hbase.thrift2.generated.TColumnValue)8 TPut (org.apache.hadoop.hbase.thrift2.generated.TPut)7 TGet (org.apache.hadoop.hbase.thrift2.generated.TGet)6 TableDescriptor (org.apache.hadoop.hbase.client.TableDescriptor)4 TDelete (org.apache.hadoop.hbase.thrift2.generated.TDelete)4 TTableDescriptor (org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor)4 Pattern (java.util.regex.Pattern)2 NamespaceDescriptor (org.apache.hadoop.hbase.NamespaceDescriptor)2 ColumnFamilyDescriptor (org.apache.hadoop.hbase.client.ColumnFamilyDescriptor)2 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)2 TColumnFamilyDescriptor (org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor)2 TNamespaceDescriptor (org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor)2