final StatementExecutionFuture resultFuture = new StatementExecutionFuture(this, futureHandle);
Futures.addCallback(futureHandle, new FutureCallback<QueryHandle>() {
@Override
public void onSuccess(final QueryHandle handle) {
try {
QueryStatus status = getStatus(handle);
if (!status.getStatus().isDone()) {
executor.schedule(new Runnable() {
@Override
public void run() {
onSuccess(handle);
}
}, 300, TimeUnit.MILLISECONDS);
} else {
if (!status.hasResults()) {
close(handle);
}
if (!resultFuture.set(new ClientExploreExecutionResult(AbstractExploreClient.this,
handle, status.hasResults()))) {
close(handle);
}
}
} catch (Exception e) {
throw Throwables.propagate(e);