public class ParallelPartitionScanExecutor extends Object implements PartitionScanExecutor
PartitionScanExecutor
which executes the partition scan in a parallel-fashion
delegating to the underlying executor.Constructor and Description |
---|
ParallelPartitionScanExecutor(PartitionScanRunner partitionScanRunner,
ManagedExecutorService executor,
int timeoutInMillis) |
Modifier and Type | Method and Description |
---|---|
List<QueryableEntry> |
execute(String mapName,
Predicate predicate,
Collection<Integer> partitions) |
QueryableEntriesSegment |
execute(String mapName,
Predicate predicate,
int partitionId,
int tableIndex,
int fetchSize)
Executes the predicate on a partition chunk.
|
protected Future<Collection<QueryableEntry>> |
runPartitionScanForPartition(String name,
Predicate predicate,
int partitionId) |
protected List<QueryableEntry> |
runUsingPartitionScanWithoutPaging(String name,
Predicate predicate,
Collection<Integer> partitions) |
public ParallelPartitionScanExecutor(PartitionScanRunner partitionScanRunner, ManagedExecutorService executor, int timeoutInMillis)
public List<QueryableEntry> execute(String mapName, Predicate predicate, Collection<Integer> partitions)
execute
in interface PartitionScanExecutor
public QueryableEntriesSegment execute(String mapName, Predicate predicate, int partitionId, int tableIndex, int fetchSize)
tableIndex
and the soft limit is defined by the fetchSize
. The method returns the matched entries and an
index from which new entries can be fetched which allows for efficient iteration of query results.
NOTE
Iterating the query results using the returned next table index should be done
only when the IMap
is not being mutated and the cluster is
stable (there are no migrations or membership changes).
In other cases, entries are rearranged and the you may get the same query result twice or
may miss some query results that match the predicate.
Parallel execution for a partition chunk query is not supported.
execute
in interface PartitionScanExecutor
mapName
- the map namepredicate
- the predicate which the entries must matchpartitionId
- the partition which is queriedtableIndex
- the index from which entries are queriedfetchSize
- the soft limit for the number of entries to fetchprotected List<QueryableEntry> runUsingPartitionScanWithoutPaging(String name, Predicate predicate, Collection<Integer> partitions)
protected Future<Collection<QueryableEntry>> runPartitionScanForPartition(String name, Predicate predicate, int partitionId)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.