int index = lastNode % repEntry.getNodes().size();
electedNode = repEntry.getNodes().get(index);
partitionRoundRobin.get().put(partitionId, index);
// Perform query
QueryStatus qStatus = new QueryStatus();
long start = System.currentTimeMillis();
DNodeService.Client client = null;
boolean renew = false;
try {
client = context.getDNodeClientFromPool(electedNode);
String r;
try {
r = client.sqlQuery(tablespaceName, version, partitionId, sql);
} catch(TTransportException e) {
renew = true;
throw e;
}
qStatus.setResult(JSONSerDe.deSer(r, ArrayList.class));
long end = System.currentTimeMillis();
// Report the time of the query
qStatus.setMillis((end - start));
// ... and the shard hit.
qStatus.setShard(partitionId);
return qStatus;
} catch(DNodeException e) {
log.error("Exception in Querier", e);
if(tried == repEntry.getNodes().size()) {
return new ErrorQueryStatus("DNode exception (" + e.getMsg() + ") from " + electedNode);