Search in sources :

Example 1 with IterationType

use of com.hazelcast.util.IterationType in project hazelcast by hazelcast.

the class PublisherCreateOperation method runInitialQuery.

private QueryResult runInitialQuery() {
    MapQueryEngine queryEngine = mapServiceContext.getMapQueryEngine(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);
}
Also used : Query(com.hazelcast.map.impl.query.Query) IterationType(com.hazelcast.util.IterationType) MapQueryEngine(com.hazelcast.map.impl.query.MapQueryEngine)

Example 2 with IterationType

use of com.hazelcast.util.IterationType in project hazelcast by hazelcast.

the class MapQueryEngineImpl 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 PagingPredicate) {
        ((PagingPredicate) adjustedQuery.getPredicate()).setIterationType(query.getIterationType());
    } else {
        if (adjustedQuery.getPredicate() == TruePredicate.INSTANCE) {
            queryResultSizeLimiter.precheckMaxResultLimitOnLocalPartitions(adjustedQuery.getMapName());
        }
    }
    return adjustedQuery;
}
Also used : PagingPredicate(com.hazelcast.query.PagingPredicate) IterationType(com.hazelcast.util.IterationType)

Aggregations

IterationType (com.hazelcast.util.IterationType)2 MapQueryEngine (com.hazelcast.map.impl.query.MapQueryEngine)1 Query (com.hazelcast.map.impl.query.Query)1 PagingPredicate (com.hazelcast.query.PagingPredicate)1