keySet(pagingPredicate);
pagingPredicate.nextPage();
}
}
MapQueryRequest request = new MapQueryRequest(name, predicate, IterationType.KEY);
QueryResultSet result = invoke(request);
if (pagingPredicate == null) {
final HashSet<K> keySet = new HashSet<K>();
for (Object o : result) {
final K key = toObject(o);
keySet.add(key);
}
return keySet;
}
final Comparator<Entry> comparator = SortingUtil.newComparator(pagingPredicate.getComparator(), IterationType.KEY);
final SortedQueryResultSet sortedResult = new SortedQueryResultSet(comparator, IterationType.KEY,
pagingPredicate.getPageSize());
final Iterator<Entry> iterator = result.rawIterator();
while (iterator.hasNext()) {
final Entry entry = iterator.next();
final K key = toObject(entry.getKey());
final V value = toObject(entry.getValue());
sortedResult.add(new AbstractMap.SimpleImmutableEntry<K, V>(key, value));