Search in sources :

Example 6 with Client

use of org.apache.accumulo.core.client.impl.thrift.ClientService.Client in project accumulo by apache.

the class ServerClient method executeRawVoid.

public static void executeRawVoid(ClientContext context, ClientExec<ClientService.Client> exec) throws Exception {
    while (true) {
        ClientService.Client client = null;
        String server = null;
        try {
            Pair<String, Client> pair = ServerClient.getConnection(context);
            server = pair.getFirst();
            client = pair.getSecond();
            exec.execute(client);
            break;
        } catch (TApplicationException tae) {
            throw new AccumuloServerException(server, tae);
        } catch (TTransportException tte) {
            log.debug("ClientService request failed " + server + ", retrying ... ", tte);
            sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
        } finally {
            if (client != null)
                ServerClient.close(client);
        }
    }
}
Also used : ClientService(org.apache.accumulo.core.client.impl.thrift.ClientService) TTransportException(org.apache.thrift.transport.TTransportException) Client(org.apache.accumulo.core.client.impl.thrift.ClientService.Client) TServiceClient(org.apache.thrift.TServiceClient) Client(org.apache.accumulo.core.client.impl.thrift.ClientService.Client) TApplicationException(org.apache.thrift.TApplicationException)

Example 7 with Client

use of org.apache.accumulo.core.client.impl.thrift.ClientService.Client in project accumulo by apache.

the class TableOperationsImpl method removeProperty.

@Override
public void removeProperty(final String tableName, final String property) throws AccumuloException, AccumuloSecurityException {
    checkArgument(tableName != null, "tableName is null");
    checkArgument(property != null, "property is null");
    try {
        MasterClient.executeTable(context, new ClientExec<MasterClientService.Client>() {

            @Override
            public void execute(MasterClientService.Client client) throws Exception {
                client.removeTableProperty(Tracer.traceInfo(), context.rpcCreds(), tableName, property);
            }
        });
    } catch (TableNotFoundException e) {
        throw new AccumuloException(e);
    }
}
Also used : TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) AccumuloException(org.apache.accumulo.core.client.AccumuloException) MasterClientService(org.apache.accumulo.core.master.thrift.MasterClientService) Client(org.apache.accumulo.core.client.impl.thrift.ClientService.Client) TableOfflineException(org.apache.accumulo.core.client.TableOfflineException) TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) NamespaceNotFoundException(org.apache.accumulo.core.client.NamespaceNotFoundException) ThriftNotActiveServiceException(org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException) ThriftSecurityException(org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException) TableExistsException(org.apache.accumulo.core.client.TableExistsException) TableDeletedException(org.apache.accumulo.core.client.TableDeletedException) TException(org.apache.thrift.TException) IOException(java.io.IOException) ThriftTableOperationException(org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException) TTransportException(org.apache.thrift.transport.TTransportException) NamespaceExistsException(org.apache.accumulo.core.client.NamespaceExistsException) FileNotFoundException(java.io.FileNotFoundException) NotServingTabletException(org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) TApplicationException(org.apache.thrift.TApplicationException) AccumuloException(org.apache.accumulo.core.client.AccumuloException)

Aggregations

Client (org.apache.accumulo.core.client.impl.thrift.ClientService.Client)7 TTransportException (org.apache.thrift.transport.TTransportException)6 AccumuloException (org.apache.accumulo.core.client.AccumuloException)4 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)4 NamespaceNotFoundException (org.apache.accumulo.core.client.NamespaceNotFoundException)4 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)4 TableOfflineException (org.apache.accumulo.core.client.TableOfflineException)4 ThriftSecurityException (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException)4 ThriftTableOperationException (org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException)4 TApplicationException (org.apache.thrift.TApplicationException)4 FileNotFoundException (java.io.FileNotFoundException)3 IOException (java.io.IOException)3 NamespaceExistsException (org.apache.accumulo.core.client.NamespaceExistsException)3 TableDeletedException (org.apache.accumulo.core.client.TableDeletedException)3 TableExistsException (org.apache.accumulo.core.client.TableExistsException)3 ClientService (org.apache.accumulo.core.client.impl.thrift.ClientService)3 ThriftNotActiveServiceException (org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException)3 MasterClientService (org.apache.accumulo.core.master.thrift.MasterClientService)3 NotServingTabletException (org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException)3 TException (org.apache.thrift.TException)3