Search in sources :

Example 1 with IOError

use of org.apache.hadoop.hbase.thrift.generated.IOError in project hbase by apache.

the class ThriftHBaseServiceHandler method getIOError.

private static IOError getIOError(Throwable throwable) {
    IOError error = new IOErrorWithCause(throwable);
    error.setCanRetry(!(throwable instanceof DoNotRetryIOException));
    error.setMessage(Throwables.getStackTraceAsString(throwable));
    return error;
}
Also used : IOError(org.apache.hadoop.hbase.thrift.generated.IOError) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 2 with IOError

use of org.apache.hadoop.hbase.thrift.generated.IOError in project hbase by apache.

the class ThriftServerRunner method getIOError.

private static IOError getIOError(Throwable throwable) {
    IOError error = new IOErrorWithCause(throwable);
    error.setMessage(Throwables.getStackTraceAsString(throwable));
    return error;
}
Also used : IOError(org.apache.hadoop.hbase.thrift.generated.IOError)

Example 3 with IOError

use of org.apache.hadoop.hbase.thrift.generated.IOError in project akela by mozilla-metrics.

the class ClusterHealth method testThrift.

private static boolean testThrift(String host) {
    boolean ret = false;
    TTransport transport = null;
    try {
        transport = new TSocket(host, 9090, 3000);
        Hbase.Client client = new Hbase.Client(new TBinaryProtocol(transport));
        transport.open();
        client.getColumnDescriptors(ByteBuffer.wrap(META_TABLE_NAME));
        System.out.println(String.format("%s ThriftServer - [ ALIVE ]", new Object[] { host }));
        ret = true;
    } catch (TTransportException e) {
        System.out.println(String.format("%s ThriftServer - [ DEAD ] - %s", new Object[] { host, e.getMessage() }));
    } catch (IOError e) {
        System.out.println(String.format("%s ThriftServer - [ DEAD ] - %s", new Object[] { host, e.getMessage() }));
    } catch (TException e) {
        System.out.println(String.format("%s ThriftServer - [ DEAD ] - %s", new Object[] { host, e.getMessage() }));
    } finally {
        if (transport != null) {
            transport.close();
        }
    }
    return ret;
}
Also used : TException(org.apache.thrift.TException) TBinaryProtocol(org.apache.thrift.protocol.TBinaryProtocol) IOError(org.apache.hadoop.hbase.thrift.generated.IOError) TTransportException(org.apache.thrift.transport.TTransportException) TTransport(org.apache.thrift.transport.TTransport) DFSClient(org.apache.hadoop.hdfs.DFSClient) Hbase(org.apache.hadoop.hbase.thrift.generated.Hbase) TSocket(org.apache.thrift.transport.TSocket)

Aggregations

IOError (org.apache.hadoop.hbase.thrift.generated.IOError)3 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 Hbase (org.apache.hadoop.hbase.thrift.generated.Hbase)1 DFSClient (org.apache.hadoop.hdfs.DFSClient)1 TException (org.apache.thrift.TException)1 TBinaryProtocol (org.apache.thrift.protocol.TBinaryProtocol)1 TSocket (org.apache.thrift.transport.TSocket)1 TTransport (org.apache.thrift.transport.TTransport)1 TTransportException (org.apache.thrift.transport.TTransportException)1