use of com.hazelcast.query.impl.predicates.PagingPredicateImpl in project hazelcast by hazelcast.
the class QueryEngineImpl method adjustQuery.
private Query adjustQuery(Query query) {
IterationType retrievalIterationType = getRetrievalIterationType(query.getPredicate(), query.getIterationType());
Query adjustedQuery = Query.of(query).iterationType(retrievalIterationType).build();
if (adjustedQuery.getPredicate() instanceof PagingPredicateImpl) {
((PagingPredicateImpl) adjustedQuery.getPredicate()).setIterationType(query.getIterationType());
} else {
if (adjustedQuery.getPredicate() == Predicates.alwaysTrue()) {
queryResultSizeLimiter.precheckMaxResultLimitOnLocalPartitions(adjustedQuery.getMapName());
}
}
return adjustedQuery;
}
use of com.hazelcast.query.impl.predicates.PagingPredicateImpl in project hazelcast by hazelcast.
the class ParallelPartitionScanExecutor method execute.
@SuppressWarnings("unchecked")
@Override
public void execute(String mapName, Predicate predicate, Collection<Integer> partitions, Result result) {
runUsingPartitionScanWithoutPaging(mapName, predicate, partitions, result);
if (predicate instanceof PagingPredicateImpl) {
PagingPredicateImpl pagingPredicate = (PagingPredicateImpl) predicate;
Map.Entry<Integer, Map.Entry> nearestAnchorEntry = pagingPredicate.getNearestAnchorEntry();
result.orderAndLimit(pagingPredicate, nearestAnchorEntry);
}
}
use of com.hazelcast.query.impl.predicates.PagingPredicateImpl in project hazelcast by hazelcast.
the class ClientMapProxy method keySetWithPagingPredicate.
@SuppressWarnings("unchecked")
private Set keySetWithPagingPredicate(Predicate predicate) {
PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
pagingPredicate.setIterationType(IterationType.KEY);
PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
ClientMessage response = invokeWithPredicate(request, predicate);
MapKeySetWithPagingPredicateCodec.ResponseParameters resultParameters = MapKeySetWithPagingPredicateCodec.decodeResponse(response);
SerializationService serializationService = getSerializationService();
pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService));
return new UnmodifiableLazySet(resultParameters.response, serializationService);
}
use of com.hazelcast.query.impl.predicates.PagingPredicateImpl in project hazelcast by hazelcast.
the class ClientMapProxy method entrySetWithPagingPredicate.
private Set entrySetWithPagingPredicate(Predicate predicate) {
PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
pagingPredicate.setIterationType(IterationType.ENTRY);
PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
ClientMessage request = MapEntriesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
ClientMessage response = invokeWithPredicate(request, predicate);
MapEntriesWithPagingPredicateCodec.ResponseParameters resultParameters = MapEntriesWithPagingPredicateCodec.decodeResponse(response);
pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(getSerializationService()));
return getEntriesAsImmutableLazySet(resultParameters.response);
}
use of com.hazelcast.query.impl.predicates.PagingPredicateImpl in project hazelcast by hazelcast.
the class ClientMapProxy method valuesForPagingPredicate.
@SuppressWarnings("unchecked")
private Collection<V> valuesForPagingPredicate(Predicate predicate) {
PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate);
pagingPredicate.setIterationType(IterationType.VALUE);
PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService());
ClientMessage request = MapValuesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder);
ClientMessage response = invokeWithPredicate(request, predicate);
MapValuesWithPagingPredicateCodec.ResponseParameters resultParameters = MapValuesWithPagingPredicateCodec.decodeResponse(response);
SerializationService serializationService = getSerializationService();
pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService));
return (Collection<V>) new UnmodifiableLazyList(resultParameters.response, serializationService);
}
Aggregations