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;
}
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;
}
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;
}
Aggregations