Class CompositeIndexManager
java.lang.Object
com.atlassian.confluence.impl.search.CompositeIndexManager
- All Implemented Interfaces:
IndexManager
Allows us to use multiple
IndexManagers under the hood whilst maintaining backwards compatibility- Since:
- 7.9.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.search.IndexManager
IndexManager.IndexQueueFlushMode -
Field Summary
Fields inherited from interface com.atlassian.confluence.search.IndexManager
REINDEX_SPACES_DARK_FEATURE -
Constructor Summary
ConstructorsConstructorDescriptionCompositeIndexManager(List<IncrementalIndexManager> incrementalManagers, IndexTaskQueue<ConfluenceIndexTask> compositeTaskQueue, FullReindexManager fullReindexManager) -
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.intDeprecated.since 7.9.0.booleanReturns true if the index queue is currently being flushed.booleanReturns true if the system is currently being reindexed.voidRefresh the index immediately, which publishes its most recent changes and makes them available for searching.reIndex()Triggers a system wide reindex of all content.reIndex(EnumSet<ReIndexOption> options) Triggers a system wide reindex with specified options, entities are loaded from the database.reIndex(EnumSet<ReIndexOption> options, SearchQuery searchQuery) Triggers a system wide re-index.reIndex(EnumSet<ReIndexOption> options, @NonNull List<String> spaceKeys) voidResets the index queue removes all entries from the queue without processing them.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.search.IndexManager
flushQueue
-
Constructor Details
-
CompositeIndexManager
public CompositeIndexManager(List<IncrementalIndexManager> incrementalManagers, IndexTaskQueue<ConfluenceIndexTask> compositeTaskQueue, FullReindexManager fullReindexManager)
-
-
Method Details
-
isFlushing
public boolean isFlushing()Description copied from interface:IndexManagerReturns true if the index queue is currently being flushed.- Specified by:
isFlushingin interfaceIndexManager- Returns:
- true if flushing, false otherwise.
-
flushQueue
@Transactional(readOnly=true, propagation=REQUIRED) public boolean flushQueue(IndexManager.IndexQueueFlushMode flushMode) Description copied from interface:IndexManagerFlushes the index queue, processing a batch of the tasks- Specified by:
flushQueuein interfaceIndexManager- 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:IndexManagerFlushes the index queue with a specified lock timeout. This method processes a batch of tasks from the index queue, allowing the caller to define a custom timeout for acquiring a lock on the index.- Specified by:
flushQueueWithLockTimeoutin interfaceIndexManager- 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 integer value.lockTimeoutUnit- The unit of time for the lock timeout, specified as aTimeUnit.- Returns:
trueif the queue was successfully flushed,falseotherwise.- See Also:
-
reIndex
Description copied from interface:IndexManagerTriggers a system wide reindex of all content.- Specified by:
reIndexin interfaceIndexManager
-
reIndex
Description copied from interface:IndexManagerTriggers a system wide reindex with specified options, entities are loaded from the database.- Specified by:
reIndexin interfaceIndexManager
-
reIndex
Description copied from interface:IndexManagerTriggers a system wide re-index.- Specified by:
reIndexin interfaceIndexManager- Parameters:
options- Optional. Allows a subset of all searchable content to be re-indexed.searchQuery- A query that is used to load the entities to be re-indexed.
-
reIndex
- Specified by:
reIndexin interfaceIndexManager
-
unIndexAll
public void unIndexAll()- Specified by:
unIndexAllin interfaceIndexManager
-
getLastReindexingTask
- Specified by:
getLastReindexingTaskin interfaceIndexManager
-
isReIndexing
public boolean isReIndexing()Description copied from interface:IndexManagerReturns true if the system is currently being reindexed.- Specified by:
isReIndexingin interfaceIndexManager- Returns:
- true if flushing, false otherwise.
-
resetIndexQueue
public void resetIndexQueue()Description copied from interface:IndexManagerResets the index queue removes all entries from the queue without processing them.- Specified by:
resetIndexQueuein interfaceIndexManager
-
getTaskQueue
Deprecated.since 7.9.0. Please useIndexManager.getQueueSize()andIndexManager.addTask(ConfluenceIndexTask)Description copied from interface:IndexManagerRetrieves the index task queue that is being used by this manager.- Specified by:
getTaskQueuein interfaceIndexManager
-
getLastNonEmptyFlushStats
- Specified by:
getLastNonEmptyFlushStatsin interfaceIndexManager
-
getQueueSize
public int getQueueSize()- Specified by:
getQueueSizein interfaceIndexManager- Returns:
- the number of pending items in the corresponding index queue
-
addTask
Description copied from interface:IndexManagerAdds a new task to the index queue- Specified by:
addTaskin interfaceIndexManager
-
refreshIndex
Description copied from interface:IndexManagerRefresh 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 interfaceIndexManager- Throws:
IOException
-