Search in sources :

Example 1 with ClientService

use of org.apache.accumulo.core.clientImpl.thrift.ClientService 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, new ClientService.Client.Factory(), true);
            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, MILLISECONDS);
        } finally {
            if (client != null)
                ServerClient.close(client, context);
        }
    }
}
Also used : ClientService(org.apache.accumulo.core.clientImpl.thrift.ClientService) TTransportException(org.apache.thrift.transport.TTransportException) Client(org.apache.accumulo.core.clientImpl.thrift.ClientService.Client) TServiceClient(org.apache.thrift.TServiceClient) Client(org.apache.accumulo.core.clientImpl.thrift.ClientService.Client) TApplicationException(org.apache.thrift.TApplicationException)

Aggregations

ClientService (org.apache.accumulo.core.clientImpl.thrift.ClientService)1 Client (org.apache.accumulo.core.clientImpl.thrift.ClientService.Client)1 TApplicationException (org.apache.thrift.TApplicationException)1 TServiceClient (org.apache.thrift.TServiceClient)1 TTransportException (org.apache.thrift.transport.TTransportException)1