executeCacheQuery(fileSystem,conf,eventLoop,controller,queryRequest, new QueryCompletionCallback<DataType,ResultKeyType,ResultValueType>() {
@Override
public void queryComplete(final QueryRequest<DataType,ResultKeyType,ResultValueType> request,final QueryResult<ResultKeyType,ResultValueType> queryResult) {
// and call outer callback in async thread context...
eventLoop.setTimer(new Timer(0,false,new Timer.Callback() {
@Override
public void timerFired(Timer timer) {
queryRequest.getQueryStatus().setProgress(1.0f);
LOG.info("Calling queryComplete on cacheRequest for Query:" + getQueryId());
completionCallback.queryComplete(queryRequest,queryResult);
//LOG.info("Finished Calling queryComplete for Query:" + getQueryId());
}
}));
}
@Override
public void queryFailed(final QueryRequest<DataType,ResultKeyType,ResultValueType> request, final String reason) {
// and call outer callback in async thread context...
eventLoop.setTimer(new Timer(0,false,new Timer.Callback() {
@Override
public void timerFired(Timer timer) {
LOG.info("Calling queryFailed on cacheRequest for Query:" + getQueryId() + " Reason:" + reason);
completionCallback.queryFailed(queryRequest,reason);
//LOG.info("Finished Calling queryFailed for Query:" + getQueryId());
}
}));
}
});
} catch (final IOException e) {
LOG.error("Query: " + getQueryId() + " Failed on cacheQuery with Error:" + CCStringUtils.stringifyException(e));
final String error = CCStringUtils.stringifyException(e);
eventLoop.setTimer(new Timer(0,false,new Timer.Callback() {
@Override
public void timerFired(Timer timer) {
completionCallback.queryFailed(queryRequest,error);
}
}));