use of com.hazelcast.internal.util.IterationType in project hazelcast by hazelcast.
the class PublisherCreateOperation method runInitialQuery.
private QueryResult runInitialQuery() {
QueryEngine queryEngine = getMapServiceContext().getQueryEngine(name);
IterationType iterationType = info.isIncludeValue() ? IterationType.ENTRY : IterationType.KEY;
Query query = Query.of().mapName(name).predicate(info.getPredicate()).iterationType(iterationType).build();
return queryEngine.execute(query, Target.LOCAL_NODE);
}
use of com.hazelcast.internal.util.IterationType in project hazelcast by hazelcast.
the class PagingPredicateHolder method asPredicate.
public <K, V> Predicate<K, V> asPredicate(SerializationService serializationService) {
List<Map.Entry<Integer, Map.Entry<K, V>>> anchorList = anchorDataListHolder.asAnchorList(serializationService);
Predicate predicate = serializationService.toObject(predicateData);
Comparator comparator = serializationService.toObject(comparatorData);
IterationType iterationType = IterationType.getById(iterationTypeId);
PagingPredicateImpl<K, V> pagingPredicate = new PagingPredicateImpl<K, V>(anchorList, predicate, comparator, pageSize, page, iterationType);
if (partitionKeyData == null) {
return pagingPredicate;
}
return new PartitionPredicateImpl<>(serializationService.toObject(partitionKeyData), pagingPredicate);
}
use of com.hazelcast.internal.util.IterationType 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;
}
Aggregations