@Override
public QueueConsumer createConsumer(QueueName queueName, ConsumerConfig consumerConfig, int numGroups)
throws IOException {
LevelDBQueueAdmin admin = ensureTableExists(queueName);
LevelDBOrderedTableCore core = new LevelDBOrderedTableCore(admin.getActualTableName(queueName), service);
// only the first consumer of each group runs eviction; and only if the number of consumers is known (> 0).
QueueEvictor evictor = (numGroups <= 0 || consumerConfig.getInstanceId() != 0) ? QueueEvictor.NOOP :
new LevelDBQueueEvictor(core, queueName, numGroups, evictionExecutor);
return new LevelDBQueueConsumer(core, getQueueLock(queueName.toString()), consumerConfig, queueName, evictor);
}