Class CompositeIndexManager
- java.lang.Object
-
- com.atlassian.confluence.impl.search.CompositeIndexManager
-
- All Implemented Interfaces:
IndexManager
public class CompositeIndexManager extends Object implements IndexManager
Allows us to use multipleIndexManager
s 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
Constructors Constructor Description CompositeIndexManager(List<IncrementalIndexManager> incrementalManagers, IndexTaskQueue<ConfluenceIndexTask> compositeTaskQueue, FullReindexManager fullReindexManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addTask(ConfluenceIndexTask task)
Adds a new task to the index queueboolean
flushQueue(IndexManager.IndexQueueFlushMode flushMode)
Flushes the index queue, processing a batch of the tasksFlushStatistics
getLastNonEmptyFlushStats()
ReIndexTask
getLastReindexingTask()
int
getQueueSize()
IndexTaskQueue<ConfluenceIndexTask>
getTaskQueue()
Deprecated.since 7.9.0.boolean
isFlushing()
Returns true if the index queue is currently being flushed.boolean
isReIndexing()
Returns true if the system is currently being reindexed.void
refreshIndex()
Refresh the index immediately, which publishes its most recent changes and makes them available for searching.ReIndexTask
reIndex()
Triggers a system wide reindex of all content.ReIndexTask
reIndex(EnumSet<ReIndexOption> options)
Triggers a system wide reindex with specified options, entities are loaded from the database.ReIndexTask
reIndex(EnumSet<ReIndexOption> options, @NonNull List<String> spaceKeys)
ReIndexTask
reIndex(EnumSet<ReIndexOption> options, SearchQuery searchQuery)
Triggers a system wide re-index.void
resetIndexQueue()
Resets the index queue removes all entries from the queue without processing them.void
unIndexAll()
-
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.search.IndexManager
flushQueue
-
-
-
-
Constructor Detail
-
CompositeIndexManager
public CompositeIndexManager(List<IncrementalIndexManager> incrementalManagers, IndexTaskQueue<ConfluenceIndexTask> compositeTaskQueue, FullReindexManager fullReindexManager)
-
-
Method Detail
-
isFlushing
public boolean isFlushing()
Description copied from interface:IndexManager
Returns true if the index queue is currently being flushed.- Specified by:
isFlushing
in interfaceIndexManager
- Returns:
- true if flushing, false otherwise.
-
flushQueue
@Transactional(readOnly=true, propagation=REQUIRED) public boolean flushQueue(IndexManager.IndexQueueFlushMode flushMode)
Description copied from interface:IndexManager
Flushes the index queue, processing a batch of the tasks- Specified by:
flushQueue
in 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
-
reIndex
public ReIndexTask reIndex()
Description copied from interface:IndexManager
Triggers a system wide reindex of all content.- Specified by:
reIndex
in interfaceIndexManager
-
reIndex
public ReIndexTask reIndex(EnumSet<ReIndexOption> options)
Description copied from interface:IndexManager
Triggers a system wide reindex with specified options, entities are loaded from the database.- Specified by:
reIndex
in interfaceIndexManager
-
reIndex
public ReIndexTask reIndex(EnumSet<ReIndexOption> options, SearchQuery searchQuery)
Description copied from interface:IndexManager
Triggers a system wide re-index.- Specified by:
reIndex
in 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
public ReIndexTask reIndex(EnumSet<ReIndexOption> options, @NonNull List<String> spaceKeys)
- Specified by:
reIndex
in interfaceIndexManager
-
unIndexAll
public void unIndexAll()
- Specified by:
unIndexAll
in interfaceIndexManager
-
getLastReindexingTask
public ReIndexTask getLastReindexingTask()
- Specified by:
getLastReindexingTask
in interfaceIndexManager
-
isReIndexing
public boolean isReIndexing()
Description copied from interface:IndexManager
Returns true if the system is currently being reindexed.- Specified by:
isReIndexing
in interfaceIndexManager
- Returns:
- true if flushing, false otherwise.
-
resetIndexQueue
public void resetIndexQueue()
Description copied from interface:IndexManager
Resets the index queue removes all entries from the queue without processing them.- Specified by:
resetIndexQueue
in interfaceIndexManager
-
getTaskQueue
@Deprecated public IndexTaskQueue<ConfluenceIndexTask> getTaskQueue()
Deprecated.since 7.9.0. Please useIndexManager.getQueueSize()
andIndexManager.addTask(ConfluenceIndexTask)
Description copied from interface:IndexManager
Retrieves the index task queue that is being used by this manager.- Specified by:
getTaskQueue
in interfaceIndexManager
-
getLastNonEmptyFlushStats
public FlushStatistics getLastNonEmptyFlushStats()
- Specified by:
getLastNonEmptyFlushStats
in interfaceIndexManager
-
getQueueSize
public int getQueueSize()
- Specified by:
getQueueSize
in interfaceIndexManager
- Returns:
- the number of pending items in the corresponding index queue
-
addTask
@Transactional(propagation=REQUIRED) public void addTask(ConfluenceIndexTask task)
Description copied from interface:IndexManager
Adds a new task to the index queue- Specified by:
addTask
in interfaceIndexManager
-
refreshIndex
public void refreshIndex() throws IOException
Description copied from interface:IndexManager
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 interfaceIndexManager
- Throws:
IOException
-
-