org.compass.gps.device.support.parallel
Class ConcurrentParallelIndexExecutor
java.lang.Object
org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor
- All Implemented Interfaces:
- ParallelIndexExecutor
public class ConcurrentParallelIndexExecutor
- extends Object
- implements ParallelIndexExecutor
Executes the indexing process using sevearl threads based on the partitioned
list of index entities.
By default (with maxThreads set to -1) creates N threads
during the indexing process where N is the number of partitioned index entities
groups (one therad per group). If maxThreads is set to a positive integer
number, the index executor will use it as the number of threads to create, regardless
of the number of partitioned entities groups.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcurrentParallelIndexExecutor
public ConcurrentParallelIndexExecutor()
- Constructs a new concurrent index executor with
maxThreads
defaults to -1.
ConcurrentParallelIndexExecutor
public ConcurrentParallelIndexExecutor(int maxThreads)
- Constructs a new concurrent index executor with the given max threads.
- Parameters:
maxThreads - The number of threads to use or -1 for dynamic threads
performIndex
public void performIndex(IndexEntity[][] entities,
IndexEntitiesIndexer indexEntitiesIndexer,
CompassGpsInterfaceDevice compassGps)
- Performs the indexing process using the provided index entities indexer. Creates a pool of N
threads (if
maxThreads is set to -1, N is the numer of entities groups, otherwise
N is the number of maxThreads).
- Specified by:
performIndex in interface ParallelIndexExecutor
- Parameters:
entities - The partitioned index entities groups and index entities to indexindexEntitiesIndexer - The entities indexer to usecompassGps - Compass gps interface for meta information
Copyright (c) 2004-2008 The Compass Project.