com.atlassian.bonnie.index
Class BaseMultiThreadedIndexer
java.lang.Object
com.atlassian.bonnie.index.BaseMultiThreadedIndexer
- All Implemented Interfaces:
- BatchOpIndexer
- Direct Known Subclasses:
- OnlineMultiThreadedIndexer
public abstract class BaseMultiThreadedIndexer
- extends Object
- implements BatchOpIndexer
Multiple-thread implementation of a BatchOpIndexer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
luceneConnection
protected ILuceneConnection luceneConnection
BaseMultiThreadedIndexer
public BaseMultiThreadedIndexer()
reindex
public final void reindex(ObjectQueue queue,
BatchOpIndexer.DocumentWritingScheme documentWritingScheme,
com.atlassian.core.util.ProgressMeter meter,
boolean truncate)
- Description copied from interface:
BatchOpIndexer
- Indexes objects in batch.
- Specified by:
reindex in interface BatchOpIndexer
- Parameters:
queue - queue of objects to indexdocumentWritingScheme - document writing scheme to usemeter - progress meter indicating index progresstruncate - should the original index be truncated?
getQueueProcessingRunnable
protected Runnable getQueueProcessingRunnable(ObjectQueue queue,
BatchOpIndexer.DocumentWritingScheme documentWritingScheme)
truncateIndex
public void truncateIndex()
throws IOException
- Description copied from interface:
BatchOpIndexer
- Truncate the index. Depending on implementations, this can mean deleting the documents one by one,
or other more efficient ways of removing documents from the index. Either way, this method results in an
empty (but valid) Lucene index.
- Specified by:
truncateIndex in interface BatchOpIndexer
- Throws:
IOException
allThreadsComplete
protected abstract void allThreadsComplete(BatchOpIndexer.DocumentWritingScheme scheme,
boolean truncate,
com.atlassian.core.util.ProgressWrapper progress)
- Perform clean-up operations such as closing writers, optimizing, merging with original index, etc.
- Parameters:
scheme - schemetruncate - should the original index be truncated
calculateNumberOfThreads
protected int calculateNumberOfThreads(int numObjects)
- Determine how many threads to use.
- Parameters:
numObjects - the number of objects to index
- Returns:
- number of threads
isReindexing
protected boolean isReindexing()
- Is reindexing currently underway?
- Returns:
- true if the reindex method is currently running.
setReindexing
public void setReindexing(boolean reindexing)
Copyright © 2006-2010 Atlassian Software Systems Pty Ltd. All Rights Reserved.