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 |
---|---|
void |
execute(String mapName,
Predicate predicate,
Collection<Integer> partitions,
Result result) |
QueryableEntriesSegment |
execute(String mapName,
Predicate predicate,
int partitionId,
int tableIndex,
int fetchSize)
Executes the predicate on a partition chunk.
|
protected Future<Result> |
runPartitionScanForPartition(String name,
Predicate predicate,
int partitionId,
Result result) |
protected void |
runUsingPartitionScanWithoutPaging(String name,
Predicate predicate,
Collection<Integer> partitions,
Result result) |
public ParallelPartitionScanExecutor(PartitionScanRunner partitionScanRunner, ManagedExecutorService executor, int timeoutInMillis)
public void execute(String mapName, Predicate predicate, Collection<Integer> partitions, Result result)
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 void runUsingPartitionScanWithoutPaging(String name, Predicate predicate, Collection<Integer> partitions, Result result)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.