use of org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client in project accumulo by apache.
the class InstanceOperationsImpl method getActiveScans.
@Override
public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException {
final HostAndPort parsedTserver = HostAndPort.fromString(tserver);
Client client = null;
try {
client = ThriftUtil.getTServerClient(parsedTserver, context);
List<ActiveScan> as = new ArrayList<>();
for (org.apache.accumulo.core.tabletserver.thrift.ActiveScan activeScan : client.getActiveScans(Tracer.traceInfo(), context.rpcCreds())) {
try {
as.add(new ActiveScanImpl(context.getInstance(), activeScan));
} catch (TableNotFoundException e) {
throw new AccumuloException(e);
}
}
return as;
} catch (TTransportException e) {
throw new AccumuloException(e);
} catch (ThriftSecurityException e) {
throw new AccumuloSecurityException(e.user, e.code, e);
} catch (TException e) {
throw new AccumuloException(e);
} finally {
if (client != null)
ThriftUtil.returnClient(client);
}
}
use of org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client in project accumulo by apache.
the class InstanceOperationsImpl method ping.
@Override
public void ping(String tserver) throws AccumuloException {
TTransport transport = null;
try {
transport = ThriftUtil.createTransport(AddressUtil.parseAddress(tserver, false), context);
TabletClientService.Client client = ThriftUtil.createClient(new TabletClientService.Client.Factory(), transport);
client.getTabletServerStatus(Tracer.traceInfo(), context.rpcCreds());
} catch (TException e) {
throw new AccumuloException(e);
} finally {
if (transport != null) {
transport.close();
}
}
}
Aggregations