if (logger.isTraceEnabled()) {
logger.trace("thrift message {}", request);
}
final CountDownLatch latch = new CountDownLatch(1);
final AtomicReference<org.elasticsearch.thrift.RestResponse> ref = new AtomicReference<org.elasticsearch.thrift.RestResponse>();
restController.dispatchRequest(new ThriftRestRequest(request), new RestChannel() {
@Override public void sendResponse(RestResponse response) {
try {
ref.set(convert(response));
} catch (IOException e) {
// ignore, should not happen...