}
@Override
public void process(KeyFilter filter, final CacheLoaderTask task, final Executor executor, final boolean fetchValue, final boolean fetchMetadata) {
final TaskContext context = new TaskContextImpl();
final KeyFilter notNullFilter = PersistenceUtil.notNull(filter);
final AtomicLong tasksSubmitted = new AtomicLong();
final AtomicLong tasksFinished = new AtomicLong();
forEachOnDisk(fetchMetadata, fetchValue, new EntryFunctor() {
@Override
public boolean apply(int file, int offset, int size,
final byte[] serializedKey, final byte[] serializedMetadata, final byte[] serializedValue,
long seqId, long expiration) throws IOException, ClassNotFoundException {
if (context.isStopped()) {
return false;
}
final Object key = marshaller.objectFromByteBuffer(serializedKey);
if (!notNullFilter.accept(key)) {
return true;
}
EntryPosition entry = temporaryTable.get(key);
if (entry == null) {
entry = index.getPosition(key, serializedKey);