public interface MapQueryEngine
Modifier and Type | Method and Description |
---|---|
QueryResult |
invokeQueryAllPartitions(String mapName,
Predicate predicate,
IterationType iterationType)
Queries all partitions.
|
QueryResult |
invokeQueryLocalPartitions(String mapName,
Predicate predicate,
IterationType iterationType)
Query all local partitions.
|
Set |
queryAllPartitionsWithPagingPredicate(String mapName,
PagingPredicate pagingPredicate,
IterationType iterationType)
Queries all partitions with a paging predicate.
|
QueryResult |
queryLocalPartition(String mapName,
Predicate predicate,
int partitionId,
IterationType iterationType)
Executes a query on a specific local partition.
|
QueryResult |
queryLocalPartitions(String mapName,
Predicate predicate,
IterationType iterationType)
Executes a query on all the local partitions.
|
Set |
queryLocalPartitionsWithPagingPredicate(String mapName,
PagingPredicate pagingPredicate,
IterationType iterationType)
Query all local partitions with a paging predicate.
|
QueryResult queryLocalPartitions(String mapName, Predicate predicate, IterationType iterationType) throws ExecutionException, InterruptedException
- Uses Indexes
- Accepts PagingPredicate
- Query executed in the calling thread
- predicate evaluation will be parallelized if QUERY_PREDICATE_PARALLEL_EVALUATION is enabled or a PagingPredicate is used.
- may return empty QueryResult (with a properly initialized result limit size) if query is executed during migrations and
migration conditions do not allow for safe retrieval of results (ie. there are migrations in flight or partition state
version is different at the end of query vs the version observed at the beginning of query). In this case, partitionIds
are not set on the QueryResult, so callers will ignore these results and fallback to QueryPartitionOperation
s.
mapName
- the name of the mappredicate
- the predicateExecutionException
InterruptedException
QueryResult queryLocalPartition(String mapName, Predicate predicate, int partitionId, IterationType iterationType)
- Does NOT use Indexes - Accepts PagingPredicate - Sequential full table scan - Query executed in the calling thread
todo: what happens when the partition is not local?
mapName
- map name.predicate
- any predicate.partitionId
- partition id.QueryResult invokeQueryLocalPartitions(String mapName, Predicate predicate, IterationType iterationType)
- Does NOT accept PagingPredicate
- Query executed in an Operation on this member (NOT in the calling thread)
- Calls queryLocalPartitions(String, Predicate, IterationType)
in an operation
mapName
- map name.predicate
- except paging predicate.iterationType
- the IterationTypeQueryResult invokeQueryAllPartitions(String mapName, Predicate predicate, IterationType iterationType)
queryLocalPartitions(String, Predicate, IterationType)
in an operationmapName
- map name.predicate
- except paging predicate.iterationType
- the IterationTypeSet queryLocalPartitionsWithPagingPredicate(String mapName, PagingPredicate pagingPredicate, IterationType iterationType)
- Query executed in an Operation on this member (or other members if some partitions are not local)
TODO: it would be better to have a single queryLocal... method and let the implementation figure out how to deal with a regular predicate and a paging predicate. No need to have that in the interface. The problem is that currently the signatures don't match up. This implementation detail should not be exposed through the interface.
mapName
- map name.pagingPredicate
- to queryOnMembers.iterationType
- type of IterationType
SortedQueryResultSet
Set queryAllPartitionsWithPagingPredicate(String mapName, PagingPredicate pagingPredicate, IterationType iterationType)
- Query executed in an Operation on each member (NOT in the calling thread)
TODO:
it would be better to have single queryAll method and let the implementation figure out how to deal
with a paging predicate. See comment in queryLocalPartitionsWithPagingPredicate(java.lang.String, com.hazelcast.query.PagingPredicate, com.hazelcast.util.IterationType)
mapName
- map name.pagingPredicate
- to queryOnMembers.iterationType
- type of IterationType
SortedQueryResultSet
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.