com.atlassian.confluence.search.lucene
Class DefaultConfluenceIndexManager

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager
All Implemented Interfaces:
ConfluenceIndexManager

public class DefaultConfluenceIndexManager
extends Object
implements ConfluenceIndexManager

The Confluence Index Manager is the entry point to the majority of the indexing subsystem..


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.search.lucene.ConfluenceIndexManager
ConfluenceIndexManager.IndexQueueFlushMode
 
Field Summary
static String QUEUE_BATCH_SIZE_KEY
           
 
Constructor Summary
DefaultConfluenceIndexManager()
           
 
Method Summary
 boolean flushQueue()
          Flush the index queue, processing all of the tasks.
 boolean flushQueue(boolean batch)
          Trigger a index queue flush.
 boolean flushQueue(ConfluenceIndexManager.IndexQueueFlushMode flushMode)
          Flush the index queue, processing a batch of the tasks
 FlushStatistics getLastNonEmptyFlushStats()
           
 IndexingTask getLastReindexingTask()
          Retrieve the last reindexing task.
 IndexTaskQueue getTaskQueue()
          Retrieve the index task queue that is being used by Confluence.
 boolean isFlushing()
          Is the index queue currently being flushed?
 boolean isReIndexing()
          Check whether or not reindexing is currently in progress.
 void optimizeIndex()
          Enqueues an Optimize Index Task
 void reIndex()
          Trigger an asynchronous reindex of the system.
 void resetIndexQueue()
          Delete all of the entries on the index queue.
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)
           
 void setIndexTaskPerformer(IndexTaskPerformer indexTaskPerformer)
           
 void setLuceneConnection(com.atlassian.bonnie.ILuceneConnection luceneConnection)
           
 void setTaskQueue(IndexTaskQueue taskQueue)
           
 void unIndexAll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_BATCH_SIZE_KEY

public static final String QUEUE_BATCH_SIZE_KEY
See Also:
Constant Field Values
Constructor Detail

DefaultConfluenceIndexManager

public DefaultConfluenceIndexManager()
Method Detail

isFlushing

public boolean isFlushing()
Is the index queue currently being flushed?

Specified by:
isFlushing in interface ConfluenceIndexManager
Returns:
true if the queue flush is in progress, false otherwise.

flushQueue

public boolean flushQueue()
Description copied from interface: ConfluenceIndexManager
Flush the index queue, processing all of the tasks.

Specified by:
flushQueue in interface ConfluenceIndexManager
Returns:
whether the flush actually took place

flushQueue

public boolean flushQueue(boolean batch)
Trigger a index queue flush.

Specified by:
flushQueue in interface ConfluenceIndexManager
Parameters:
batch - - whether to flush the entire queue, or just one batch of batchsize as specified by the system property index.queue.batch.size
Returns:
whether the flush actually took place

flushQueue

public boolean flushQueue(ConfluenceIndexManager.IndexQueueFlushMode flushMode)
Description copied from interface: ConfluenceIndexManager
Flush the index queue, processing a batch of the tasks

Specified by:
flushQueue in interface ConfluenceIndexManager
Returns:
whether the flush actually took place

resetIndexQueue

public void resetIndexQueue()
Delete all of the entries on the index queue. This should NOT be called during the normal running of confluence since all pending Index Tasks will be deleted WITHOUT being processed.

Specified by:
resetIndexQueue in interface ConfluenceIndexManager

optimizeIndex

public void optimizeIndex()
Description copied from interface: ConfluenceIndexManager
Enqueues an Optimize Index Task

Specified by:
optimizeIndex in interface ConfluenceIndexManager

reIndex

public void reIndex()
Trigger an asynchronous reindex of the system. The progress of this task can be monitored via the getLastReindexingTask().

Specified by:
reIndex in interface ConfluenceIndexManager

isReIndexing

public boolean isReIndexing()
Check whether or not reindexing is currently in progress.

Specified by:
isReIndexing in interface ConfluenceIndexManager
Returns:
true if reindexing is running, false otherwise.

getLastReindexingTask

public IndexingTask getLastReindexingTask()
Retrieve the last reindexing task. This task will provide all of the information required to track the progress/state of the reindexing process.

Specified by:
getLastReindexingTask in interface ConfluenceIndexManager
Returns:
the last executed reindex task, or null if no reindex has occured.

unIndexAll

public void unIndexAll()
Specified by:
unIndexAll in interface ConfluenceIndexManager

getTaskQueue

public IndexTaskQueue getTaskQueue()
Retrieve the index task queue that is being used by Confluence. This instance can also be retrieved by spring.

Specified by:
getTaskQueue in interface ConfluenceIndexManager

getLastNonEmptyFlushStats

public FlushStatistics getLastNonEmptyFlushStats()
Specified by:
getLastNonEmptyFlushStats in interface ConfluenceIndexManager

setIndexTaskFactory

public void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)

setIndexTaskPerformer

public void setIndexTaskPerformer(IndexTaskPerformer indexTaskPerformer)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)

setTaskQueue

public void setTaskQueue(IndexTaskQueue taskQueue)
Parameters:
taskQueue - set by dependency injection, required

setLuceneConnection

public void setLuceneConnection(com.atlassian.bonnie.ILuceneConnection luceneConnection)
Parameters:
luceneConnection - set by dependency injection, required


Copyright © 2003-2013 Atlassian. All Rights Reserved.