String cmd_1 = cmd_trimmed.substring(tokens[0].length()).trim();
CommandProcessor proc = CommandProcessorFactory.get(tokens[0]);
if (proc != null) {
if (proc instanceof Driver) {
Driver qp = (Driver) proc;
qp.setTryCount(Integer.MAX_VALUE);
try {
queryRet.add(Integer.valueOf(qp.run(cmd).getResponseCode()));
ArrayList<String> res = new ArrayList<String>();
try {
while (qp.getResults(res)) {
ArrayList<String> resCopy = new ArrayList<String>();
resCopy.addAll(res);
resultBucket.add(resCopy);
if (resultBucket.size() > resultBucketMaxSize) {
resultBucket.remove(0);
}
for (String row : res) {
if (ss != null) {
if (ss.out != null) {
ss.out.println(row);
}
} else {
throw new RuntimeException("ss was null");
}
}
res.clear();
}
} catch (IOException ex) {
l4j.error(getSessionName() + " getting results " + getResultFile()
+ " caused exception.", ex);
}
} catch (CommandNeedRetryException e) {
// this should never happen since we Driver.setTryCount(Integer.MAX_VALUE)
l4j.error(getSessionName() + " Exception when executing", e);
} finally {
qp.close();
}
} else {
try {
queryRet.add(Integer.valueOf(proc.run(cmd_1).getResponseCode()));
} catch (CommandNeedRetryException e) {