try {
commands = queue.poll();
if (commands == null) {
return;
}
final BatchExecutorBase e = commands.get(0).executor();
final long startTS = System.currentTimeMillis();
batchRunner.run(commands, e);
statisticsCollector.submit(e.id(), commands.size(), System.currentTimeMillis()-startTS, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
logger.warn("Interrupted",e);
}
}