|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.AbstractGpsDevice
org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
public abstract class AbstractParallelGpsDevice
A base class for gps device that can parallel the index operation.
When the device starts up, the doGetIndexEntities() callback
is called (should be implemented by sub classes) in order to get the
IndexEntityies. The
IndexEntitiesPartitioner is
then used in order to partition the index entities into several groups
that can be parallel indexed. An IndexEntitiesIndexer
is also obtained using the doGetIndexEntitiesIndexer() that can
index entities into the search engine and is provided by sub classes as well.
The IndexEntitiesPartitioner
defaults to the SubIndexIndexEntitiesPartitioner
that partition the index entities based on the sub index. This is the only meanigful
way to partition the index entities, as it allows for the best concurrent support
(locking is performed on the sub index level).
The index(org.compass.gps.IndexPlan) operation uses the ParallelIndexExecutor
in order to execute the indexing process. The default implementation used is
ConcurrentParallelIndexExecutor.
| Field Summary |
|---|
| Fields inherited from class org.compass.gps.device.AbstractGpsDevice |
|---|
compassGps, log |
| Constructor Summary | |
|---|---|
AbstractParallelGpsDevice()
|
|
| Method Summary | |
|---|---|
protected abstract IndexEntity[] |
doGetIndexEntities()
Returns all the indexed entities for this device. |
protected abstract IndexEntitiesIndexer |
doGetIndexEntitiesIndexer()
Returns an index entities indexer that knows how to index indexable entities. |
protected void |
doIndex(CompassSession session,
IndexPlan indexPlan)
Overriding this method and throws an IllegalStateException as it should
not be called. |
void |
index(IndexPlan indexPlan)
Index the indexable entities. |
void |
setIndexEntitiesPartitioner(IndexEntitiesPartitioner indexEntitiesPartitioner)
Sets the index entities partitioner. |
void |
setParallelIndexExecutor(ParallelIndexExecutor parallelIndexExecutor)
Sets the parallel index executor. |
void |
start()
Starts the device. |
| Methods inherited from class org.compass.gps.device.AbstractGpsDevice |
|---|
buildMessage, doStart, doStop, getGps, getName, injectGps, isFilteredForIndex, isPerformingIndexOperation, isRunning, refresh, setFilteredEntitiesForIndex, setName, shouldMirrorDataChanges, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractParallelGpsDevice()
| Method Detail |
|---|
public void start()
throws CompassGpsException
doGetIndexEntities() in order to get all the
indexeable entities and uses the IndexEntitiesPartitioner
to partition them index groups that can be parallel indexed. Also calls
doGetIndexEntitiesIndexer() in order to obtain the index entities indexer.
start in interface CompassGpsDevicestart in class AbstractGpsDeviceCompassGpsException
public void index(IndexPlan indexPlan)
throws CompassGpsException
ParallelIndexExecutor
in order to index the different groups of indexed entities partitioned at startup.
index in interface CompassGpsDeviceindex in class AbstractGpsDeviceCompassGpsException
protected abstract IndexEntity[] doGetIndexEntities()
throws CompassGpsException
CompassGpsExceptionprotected abstract IndexEntitiesIndexer doGetIndexEntitiesIndexer()
protected final void doIndex(CompassSession session,
IndexPlan indexPlan)
throws CompassGpsException
IllegalStateException as it should
not be called. The index(org.compass.gps.IndexPlan) operation is implemented here and does not
call this method.
doIndex in class AbstractGpsDeviceCompassGpsExceptionpublic void setParallelIndexExecutor(ParallelIndexExecutor parallelIndexExecutor)
ConcurrentParallelIndexExecutor.
index(org.compass.gps.IndexPlan)public void setIndexEntitiesPartitioner(IndexEntitiesPartitioner indexEntitiesPartitioner)
SubIndexIndexEntitiesPartitioner.
start()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||