public Collection<QueryableEntry> queryOnPartition(String mapName, Predicate predicate, int partitionId) {
final long now = getNow();
final PartitionContainer container = mapServiceContext.getPartitionContainer(partitionId);
final RecordStore recordStore = container.getRecordStore(mapName);
final SerializationService serializationService = nodeEngine.getSerializationService();
final PagingPredicate pagingPredicate = predicate instanceof PagingPredicate ? (PagingPredicate) predicate : null;
final List<QueryEntry> list = new LinkedList<QueryEntry>();
final Iterator<Record> iterator = recordStore.loadAwareIterator(now, false);
while (iterator.hasNext()) {
final Record record = iterator.next();
Data key = record.getKey();
Object value = getValueOrCachedValue(record);
if (value == null) {
continue;
}
QueryEntry queryEntry = new QueryEntry(serializationService, key, key, value);
if (predicate.apply(queryEntry)) {
if (pagingPredicate != null) {
Map.Entry anchor = pagingPredicate.getAnchor();
if (anchor != null
&& SortingUtil.compare(pagingPredicate.getComparator(),
pagingPredicate.getIterationType(), anchor, queryEntry) >= 0) {
continue;
}
}
list.add(queryEntry);
}