Interface IncrementalIndexManager
- All Known Implementing Classes:
LuceneIncrementalIndexManager
This manager is responsible for manipulating single Lucene directory and single index queue. All operations which
are local to this index and don't depend on other indexes should live here.
- Since:
- 7.9.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTask
(ConfluenceIndexTask task) Adds a new task to the index queuedefault boolean
Flushes the index queue, processing all of the tasks.boolean
flushQueue
(IndexManager.IndexQueueFlushMode flushMode) Flushes the index queue, processing a batch of the tasksboolean
flushQueueWithLockTimeout
(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Flushes the index queue with a specified lock timeout.@Nullable FlushStatistics
int
long
boolean
Returns true if the index queue is currently being flushed.default void
Refresh the index immediately, which publishes its most recent changes and makes them available for searching.void
Resets the index queue removes all entries from the queue without processing them.
-
Method Details
-
isFlushing
boolean isFlushing()Returns true if the index queue is currently being flushed.- Returns:
- true if flushing, false otherwise.
-
flushQueue
Flushes the index queue, processing a batch of the tasks- 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
boolean flushQueueWithLockTimeout(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Flushes 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.- 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:
true
if the queue was successfully flushed,false
otherwise.- See Also:
-
flushQueue
default boolean flushQueue()Flushes the index queue, processing all of the tasks.- Returns:
- whether the flush actually took place
-
resetIndexQueue
void resetIndexQueue()Resets the index queue removes all entries from the queue without processing them. -
getLastNonEmptyFlushStats
@Nullable FlushStatistics getLastNonEmptyFlushStats()- Returns:
- the information about last queue flush.
null
if no flush has occured from system start.
-
getQueueSize
int getQueueSize()- Returns:
- the number of pending items in the corresponding index queue
- Since:
- 7.9.0
-
addTask
Adds a new task to the index queue -
refreshIndex
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.- Throws:
IOException
-
getSizeInBytes
long getSizeInBytes()- Returns:
- size of the index in bytes
- Since:
- 8.8.0
-