final InternalPartitionService partitionService = nodeEngine.getPartitionService();
for (int i = 0; i < partitionService.getPartitionCount(); i++) {
final Address owner = partitionService.getPartitionOwner(i);
if (!nodeEngine.getThisAddress().equals(owner) && backup
|| nodeEngine.getThisAddress().equals(owner) && !backup) {
final PartitionContainer container = mapServiceContext.getPartitionContainer(i);
if (container == null) {
continue;
}
final RecordStore recordStore = container.getRecordStore(map.getName());
final DefaultRecordStore defaultRecordStore = (DefaultRecordStore) recordStore;
final Iterator<Record> iterator = defaultRecordStore.iterator(now, backup);
while (iterator.hasNext()) {
iterator.next();
count++;