public class MapQueryEngineImpl extends Object implements MapQueryEngine
MapQueryEngine
implementation.Modifier and Type | Class and Description |
---|---|
protected class |
MapQueryEngineImpl.QueryPartitionCallable |
Modifier and Type | Field and Description |
---|---|
protected ClusterService |
clusterService |
protected ManagedExecutorService |
executor |
protected LocalMapStatsProvider |
localMapStatsProvider |
protected ILogger |
logger |
protected MapServiceContext |
mapServiceContext |
protected NodeEngine |
nodeEngine |
protected OperationService |
operationService |
protected boolean |
parallelEvaluation |
protected InternalPartitionService |
partitionService |
protected static long |
QUERY_EXECUTION_TIMEOUT_MINUTES |
protected QueryOptimizer |
queryOptimizer |
protected QueryResultSizeLimiter |
queryResultSizeLimiter |
protected SerializationService |
serializationService |
Constructor and Description |
---|
MapQueryEngineImpl(MapServiceContext mapServiceContext,
QueryOptimizer optimizer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addResultsOfPagingPredicate(List<Future<QueryResult>> futures,
Collection result,
Collection<Integer> partitionIds)
Adds results of paging predicates to result set and removes queried partition ids.
|
protected void |
addResultsOfPredicate(List<Future<QueryResult>> futures,
QueryResult result,
Collection<Integer> partitionIds)
Adds results of non-paging predicates to result set and removes queried partition ids.
|
protected void |
checkNotPagingPredicate(Predicate predicate) |
protected Set<Integer> |
createSetWithPopulatedPartitionIds(int partitionCount) |
protected Set<Integer> |
getAllPartitionIds() |
protected List<Integer> |
getLocalPartitionIds() |
protected long |
getNow() |
protected static Collection<Collection<QueryableEntry>> |
getResult(List<Future<Collection<QueryableEntry>>> lsFutures) |
protected boolean |
hasPartitionVersion(int expectedVersion,
Predicate predicate) |
QueryResult |
invokeQueryAllPartitions(String mapName,
Predicate predicate,
IterationType iterationType)
Queries all partitions.
|
QueryResult |
invokeQueryLocalPartitions(String mapName,
Predicate predicate,
IterationType iterationType)
Query all local partitions.
|
protected QueryResult |
newQueryResult(int numberOfPartitions,
IterationType iterationType)
Creates a
QueryResult with configured result limit (according to the number of partitions) if feature is enabled. |
Set |
queryAllPartitionsWithPagingPredicate(String mapName,
PagingPredicate predicate,
IterationType iterationType)
Queries all partitions with a paging predicate.
|
QueryResult |
queryLocalPartition(String mapName,
Predicate predicate,
int partitionId,
IterationType iterationType)
Executes a query 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 predicate,
IterationType iterationType)
Query all local partitions with a paging predicate.
|
protected Future<QueryResult> |
queryOnLocalMember(String mapName,
Predicate predicate,
IterationType iterationType) |
protected List<Future<QueryResult>> |
queryOnMembers(String mapName,
Predicate predicate,
IterationType iterationType) |
protected QueryResult |
queryParallel(String name,
Predicate predicate,
Collection<Integer> partitions,
IterationType iterationType) |
protected QueryResult |
queryParallelForPaging(String name,
PagingPredicate predicate,
Collection<Integer> partitions,
IterationType iterationType) |
protected List<Future<QueryResult>> |
queryPartitions(String mapName,
Predicate predicate,
Collection<Integer> partitionIds,
IterationType iterationType) |
protected QueryResult |
querySequential(String name,
Predicate predicate,
Collection<Integer> partitions,
IterationType iterationType) |
protected Collection<QueryableEntry> |
queryTheLocalPartition(String mapName,
Predicate predicate,
int partitionId) |
protected QueryResult |
queryUsingFullTableScan(String name,
Predicate predicate,
Collection<Integer> partitions,
IterationType iterationType) |
protected Object |
toObject(Object obj) |
protected QueryResult |
tryQueryUsingIndexes(Predicate predicate,
Collection<Integer> partitions,
MapContainer mapContainer,
IterationType iterationType) |
protected void |
updateStatistics(MapContainer mapContainer) |
protected static final long QUERY_EXECUTION_TIMEOUT_MINUTES
protected final MapServiceContext mapServiceContext
protected final NodeEngine nodeEngine
protected final ILogger logger
protected final QueryResultSizeLimiter queryResultSizeLimiter
protected final SerializationService serializationService
protected final InternalPartitionService partitionService
protected final QueryOptimizer queryOptimizer
protected final OperationService operationService
protected final ClusterService clusterService
protected final LocalMapStatsProvider localMapStatsProvider
protected final boolean parallelEvaluation
protected final ManagedExecutorService executor
public MapQueryEngineImpl(MapServiceContext mapServiceContext, QueryOptimizer optimizer)
public QueryResult queryLocalPartitions(String mapName, Predicate predicate, IterationType iterationType) throws ExecutionException, InterruptedException
MapQueryEngine
queryLocalPartitions
in interface MapQueryEngine
mapName
- the name of the mappredicate
- the predicateExecutionException
InterruptedException
protected QueryResult tryQueryUsingIndexes(Predicate predicate, Collection<Integer> partitions, MapContainer mapContainer, IterationType iterationType)
protected void updateStatistics(MapContainer mapContainer)
protected QueryResult queryUsingFullTableScan(String name, Predicate predicate, Collection<Integer> partitions, IterationType iterationType) throws InterruptedException, ExecutionException
protected QueryResult querySequential(String name, Predicate predicate, Collection<Integer> partitions, IterationType iterationType)
protected QueryResult queryParallel(String name, Predicate predicate, Collection<Integer> partitions, IterationType iterationType) throws InterruptedException, ExecutionException
protected QueryResult queryParallelForPaging(String name, PagingPredicate predicate, Collection<Integer> partitions, IterationType iterationType) throws InterruptedException, ExecutionException
protected static Collection<Collection<QueryableEntry>> getResult(List<Future<Collection<QueryableEntry>>> lsFutures)
protected boolean hasPartitionVersion(int expectedVersion, Predicate predicate)
protected Collection<QueryableEntry> queryTheLocalPartition(String mapName, Predicate predicate, int partitionId)
public QueryResult queryLocalPartition(String mapName, Predicate predicate, int partitionId, IterationType iterationType)
MapQueryEngine
queryLocalPartition
in interface MapQueryEngine
mapName
- map name.predicate
- any predicate.partitionId
- partition id.public QueryResult invokeQueryLocalPartitions(String mapName, Predicate predicate, IterationType iterationType)
MapQueryEngine
MapQueryEngine.queryLocalPartitions(String, Predicate, IterationType)
invokeQueryLocalPartitions
in interface MapQueryEngine
mapName
- map name.predicate
- except paging predicate.iterationType
- the IterationTypepublic Set queryLocalPartitionsWithPagingPredicate(String mapName, PagingPredicate predicate, IterationType iterationType)
MapQueryEngine
queryLocalPartitionsWithPagingPredicate
in interface MapQueryEngine
mapName
- map name.predicate
- to queryOnMembers.iterationType
- type of IterationType
SortedQueryResultSet
public Set queryAllPartitionsWithPagingPredicate(String mapName, PagingPredicate predicate, IterationType iterationType)
MapQueryEngine
MapQueryEngine.queryLocalPartitionsWithPagingPredicate(java.lang.String, com.hazelcast.query.PagingPredicate, com.hazelcast.util.IterationType)
queryAllPartitionsWithPagingPredicate
in interface MapQueryEngine
mapName
- map name.predicate
- to queryOnMembers.iterationType
- type of IterationType
SortedQueryResultSet
public QueryResult invokeQueryAllPartitions(String mapName, Predicate predicate, IterationType iterationType)
MapQueryEngine
invokeQueryAllPartitions
in interface MapQueryEngine
mapName
- map name.predicate
- except paging predicate.iterationType
- the IterationTypeprotected QueryResult newQueryResult(int numberOfPartitions, IterationType iterationType)
QueryResult
with configured result limit (according to the number of partitions) if feature is enabled.numberOfPartitions
- number of partitions to calculate result limitQueryResult
protected void checkNotPagingPredicate(Predicate predicate)
protected Future<QueryResult> queryOnLocalMember(String mapName, Predicate predicate, IterationType iterationType)
protected List<Future<QueryResult>> queryOnMembers(String mapName, Predicate predicate, IterationType iterationType)
protected List<Future<QueryResult>> queryPartitions(String mapName, Predicate predicate, Collection<Integer> partitionIds, IterationType iterationType)
protected void addResultsOfPagingPredicate(List<Future<QueryResult>> futures, Collection result, Collection<Integer> partitionIds) throws ExecutionException, InterruptedException
protected void addResultsOfPredicate(List<Future<QueryResult>> futures, QueryResult result, Collection<Integer> partitionIds) throws ExecutionException, InterruptedException
protected Set<Integer> createSetWithPopulatedPartitionIds(int partitionCount)
protected long getNow()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.