Search in sources :

Example 6 with ActiveScan

use of org.apache.accumulo.core.client.admin.ActiveScan 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);
    }
}
Also used : TException(org.apache.thrift.TException) AccumuloException(org.apache.accumulo.core.client.AccumuloException) ActiveScan(org.apache.accumulo.core.client.admin.ActiveScan) ArrayList(java.util.ArrayList) TTransportException(org.apache.thrift.transport.TTransportException) ThriftSecurityException(org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException) HostAndPort(org.apache.accumulo.core.util.HostAndPort) TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) Client(org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client)

Aggregations

ActiveScan (org.apache.accumulo.core.client.admin.ActiveScan)6 ArrayList (java.util.ArrayList)5 AccumuloException (org.apache.accumulo.core.client.AccumuloException)3 Connector (org.apache.accumulo.core.client.Connector)3 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)3 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)3 Test (org.junit.Test)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)2 Scanner (org.apache.accumulo.core.client.Scanner)2 TException (org.apache.thrift.TException)2 HashSet (java.util.HashSet)1 Entry (java.util.Map.Entry)1 Future (java.util.concurrent.Future)1 BatchWriter (org.apache.accumulo.core.client.BatchWriter)1 BatchWriterConfig (org.apache.accumulo.core.client.BatchWriterConfig)1 MutationsRejectedException (org.apache.accumulo.core.client.MutationsRejectedException)1 NamespaceExistsException (org.apache.accumulo.core.client.NamespaceExistsException)1 NamespaceNotEmptyException (org.apache.accumulo.core.client.NamespaceNotEmptyException)1 NamespaceNotFoundException (org.apache.accumulo.core.client.NamespaceNotFoundException)1