public IterationResult scanEntries(LastAccessIterationCallback cb)
throws StoreException
{
// !!! TODO: make more efficient. Until then, just use in-order traversal
// Would Snapshot make sense here?
StorableKey key = null;
try {
DBIterator iter = _store.iterator();
try {
iter.seekToFirst();
while (iter.hasNext()) {
Map.Entry<byte[], byte[]> entry = iter.next();
key = _storableKey(entry.getKey());
byte[] b = key.asBytes();
EntryLastAccessed lastAcc = _lastAccessedConverter.createLastAccessed(b, 0, b.length);
if (cb.processEntry(key, lastAcc) == IterationAction.TERMINATE_ITERATION) {
return IterationResult.TERMINATED_FOR_ENTRY;
}
}