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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLuceneIncrementalIndexManager(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 TypeMethodDescriptionvoidaddTask(ConfluenceIndexTask task) Adds a new task to the index queuebooleanflushQueue(IndexManager.IndexQueueFlushMode flushMode) Flushes the index queue, processing a batch of the tasksbooleanflushQueueWithLockTimeout(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Flushes the index queue with a specified lock timeout.intlongbooleanReturns true if the index queue is currently being flushed.voidRefresh the index immediately, which publishes its most recent changes and makes them available for searching.voidDelete 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, waitMethods 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:IncrementalIndexManagerReturns true if the index queue is currently being flushed.- Specified by:
isFlushingin interfaceIncrementalIndexManager- Returns:
- true if flushing, false otherwise.
-
flushQueue
@Transactional(readOnly=true, propagation=REQUIRED) public boolean flushQueue(IndexManager.IndexQueueFlushMode flushMode) Description copied from interface:IncrementalIndexManagerFlushes the index queue, processing a batch of the tasks- Specified by:
flushQueuein 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
-
flushQueueWithLockTimeout
@Transactional(readOnly=true, propagation=REQUIRED) public boolean flushQueueWithLockTimeout(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Description copied from interface:IncrementalIndexManagerFlushes the index queue with a specified lock timeout. This method processes tasks from the index queue, allowing the caller to define a custom timeout for acquiring a lock on the index.- Specified by:
flushQueueWithLockTimeoutin interfaceIncrementalIndexManager- Parameters:
flushMode- Specifies whether to flush the entire queue or just a batch of tasks. The batch size is determined by the system propertyindex.queue.batch.size.lockTimeout- The maximum time to wait for acquiring the lock, specified as an int value.lockTimeoutUnit- The unit of time for the lock timeout, specified as aTimeUnit.- Returns:
trueif the queue was successfully flushed,falseotherwise.- See Also:
-
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:
resetIndexQueuein interfaceIncrementalIndexManager
-
getLastNonEmptyFlushStats
@Transactional(readOnly=true, propagation=SUPPORTS) public FlushStatistics getLastNonEmptyFlushStats()- Specified by:
getLastNonEmptyFlushStatsin interfaceIncrementalIndexManager- Returns:
- the information about last queue flush.
nullif no flush has occured from system start.
-
getQueueSize
@Transactional(readOnly=true, propagation=SUPPORTS) public int getQueueSize()- Specified by:
getQueueSizein interfaceIncrementalIndexManager- Returns:
- the number of pending items in the corresponding index queue
-
getSizeInBytes
@Transactional(readOnly=true, propagation=SUPPORTS) public long getSizeInBytes()- Specified by:
getSizeInBytesin interfaceIncrementalIndexManager- Returns:
- size of the index in bytes
-
addTask
Description copied from interface:IncrementalIndexManagerAdds a new task to the index queue- Specified by:
addTaskin interfaceIncrementalIndexManager
-
getTargetIndex
-
refreshIndex
Description copied from interface:IncrementalIndexManagerRefresh 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:
refreshIndexin interfaceIncrementalIndexManager- Throws:
IOException
-