Example usage for org.apache.thrift.async TAsyncClient hasError

List of usage examples for org.apache.thrift.async TAsyncClient hasError

Introduction

In this page you can find the example usage for org.apache.thrift.async TAsyncClient hasError.

Prototype

public boolean hasError() 

Source Link

Document

Is the client in an error state?

Usage

From source file:com.nearinfinity.blur.thrift.AsyncClientPool.java

License:Apache License

private void returnClient(Connection connection, TAsyncClient client) throws InterruptedException {
    if (!client.hasError()) {
        getQueue(connection).put(client);
    } else {/*ww w. j a  v a  2 s .  co  m*/
        AtomicInteger counter = _numberOfConnections.get(connection.getHost());
        if (counter != null) {
            counter.decrementAndGet();
        }
    }
}

From source file:org.corfudb.runtime.protocols.AsyncPooledThriftClient.java

License:Apache License

private void returnClient(TAsyncClient client) throws InterruptedException {
    if (!client.hasError()) {
        getQueue(_connection).put(client);
    } else {/* w w  w. j av  a 2s. c  om*/
        AtomicInteger counter = _numberOfConnections.get(_connection.getHost());
        if (counter != null) {
            counter.decrementAndGet();
        }
    }
}