Search in sources :

Example 1 with ClientService

use of org.apache.accumulo.core.client.impl.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);
            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)

Aggregations

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