Class LuceneIncrementalIndexManager
java.lang.Object
com.atlassian.confluence.internal.search.LuceneIncrementalIndexManager
- All Implemented Interfaces:
IncrementalIndexManager
@LuceneIndependent
@Internal
public class LuceneIncrementalIndexManager
extends Object
implements IncrementalIndexManager
Entry point to the majority of the Lucene indexing subsystem.
- Since:
- 7.9.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLuceneIncrementalIndexManager
(IndexLockService lockService, IndexTaskQueue<ConfluenceIndexTask> taskQueue, SearchIndexAccessor searchIndexAccessor, com.atlassian.event.api.EventPublisher eventPublisher, FullReindexManager fullReindexManager, SearchIndex targetIndex, org.hibernate.SessionFactory sessionFactory, HibernateSessionManager5 sessionManager, JournalService journalService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTask
(ConfluenceIndexTask task) Adds a new task to the index queueboolean
flushQueue
(IndexManager.IndexQueueFlushMode flushMode) Flushes the index queue, processing a batch of the tasksint
long
boolean
Returns true if the index queue is currently being flushed.void
Refresh the index immediately, which publishes its most recent changes and makes them available for searching.void
Delete all of the entries on the index queue.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.internal.search.IncrementalIndexManager
flushQueue
-
Field Details
-
QUEUE_BATCH_SIZE_KEY
- See Also:
-
-
Constructor Details
-
LuceneIncrementalIndexManager
public LuceneIncrementalIndexManager(IndexLockService lockService, IndexTaskQueue<ConfluenceIndexTask> taskQueue, SearchIndexAccessor searchIndexAccessor, com.atlassian.event.api.EventPublisher eventPublisher, FullReindexManager fullReindexManager, SearchIndex targetIndex, org.hibernate.SessionFactory sessionFactory, HibernateSessionManager5 sessionManager, JournalService journalService)
-
-
Method Details
-
isFlushing
@Transactional(readOnly=true, propagation=SUPPORTS) public boolean isFlushing()Description copied from interface:IncrementalIndexManager
Returns true if the index queue is currently being flushed.- Specified by:
isFlushing
in interfaceIncrementalIndexManager
- Returns:
- true if flushing, false otherwise.
-
flushQueue
@Transactional(readOnly=true, propagation=REQUIRED) public boolean flushQueue(IndexManager.IndexQueueFlushMode flushMode) Description copied from interface:IncrementalIndexManager
Flushes the index queue, processing a batch of the tasks- Specified by:
flushQueue
in interfaceIncrementalIndexManager
- Parameters:
flushMode
- - 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
-
resetIndexQueue
@Transactional(propagation=REQUIRED) 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 interfaceIncrementalIndexManager
-
getLastNonEmptyFlushStats
@Transactional(readOnly=true, propagation=SUPPORTS) public FlushStatistics getLastNonEmptyFlushStats()- Specified by:
getLastNonEmptyFlushStats
in interfaceIncrementalIndexManager
- Returns:
- the information about last queue flush.
null
if no flush has occured from system start.
-
getQueueSize
@Transactional(readOnly=true, propagation=SUPPORTS) public int getQueueSize()- Specified by:
getQueueSize
in interfaceIncrementalIndexManager
- Returns:
- the number of pending items in the corresponding index queue
-
getSizeInBytes
@Transactional(readOnly=true, propagation=SUPPORTS) public long getSizeInBytes()- Specified by:
getSizeInBytes
in interfaceIncrementalIndexManager
- Returns:
- size of the index in bytes
-
addTask
Description copied from interface:IncrementalIndexManager
Adds a new task to the index queue- Specified by:
addTask
in interfaceIncrementalIndexManager
-
getTargetIndex
-
refreshIndex
Description copied from interface:IncrementalIndexManager
Refresh the index immediately, which publishes its most recent changes and makes them available for searching. This method is only applicable to the OpenSearch platform.- Specified by:
refreshIndex
in interfaceIncrementalIndexManager
- Throws:
IOException
-