}
@Override
protected PriorityMQMessage<E> doTake() throws QueueInvalidStateException, QueueFatalException, QueueTimeoutException, DataStoreFatalException {
DataStoreIterator iterator = ds.getAscendingIterator();
boolean jumped = iterator.jump(priorityKeyUtil.encode(getId(), 0L));
if (!jumped) logger.warn("DataStoreIterator failed to jump to queue's first record {} {}", getId(), 0L);
// if (!jumped) something is wrong, we should zero the size and exit
try {
DataStoreIterator.Record record = iterator.getRecord();
CompositeKey key = priorityKeyUtil.decode(record.getKey());