Class CompositeIndexTaskQueue<T extends IndexTask>
- java.lang.Object
-
- com.atlassian.confluence.impl.search.queue.CompositeIndexTaskQueue<T>
-
- All Implemented Interfaces:
IndexTaskQueue<T>
@Deprecated public class CompositeIndexTaskQueue<T extends IndexTask> extends Object implements IndexTaskQueue<T>
Deprecated.since 7.9 UseIndexManager
methods instead of calling corresponding methods on queue directly. This class is deprecated because Confluence will no longer have only one index queue.Backwards compatible index queue that allows us to have a 'single' queue while using multiple queues under the hood- Since:
- 7.9.0
-
-
Constructor Summary
Constructors Constructor Description CompositeIndexTaskQueue(Map<SearchIndex,IndexTaskQueue<T>> taskQueueBySearchIndex, IndexTaskQueue<T> fallbackQueue)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
enqueue(T task)
Deprecated.Add a new task to this queue.void
enqueueAll(Collection<T> tasks)
Deprecated.Add a collection of tasks to this queue.List<T>
flushQueue()
Deprecated.Flush the contents of the queue, returning those elements currently queued as the result.List<T>
flushQueue(int numberOfEntries)
Deprecated.Flush the contents of the queue, returning those elements currently queued as the result.int
flushQueue(com.atlassian.fugue.Effect<T> actionOnTask)
Deprecated.Flush the contents of the queue, applying the given action to each flushed entry.int
flushQueue(com.atlassian.fugue.Effect<T> actionOnTask, int numberOfEntries)
Deprecated.Flush the contents of the queue, applying the given action to each flushed entry.int
flushQueueWithActionOnIterableOfTasks(Consumer<Iterable<T>> actionOnIterableOfTasks, int numberOfTasks)
Deprecated.Flush the contents of the queue, applying the given action to an iterable of tasks.List<T>
getQueuedEntries()
Deprecated.Retrieve a list of all queued entries.List<T>
getQueuedEntries(int limit)
Deprecated.Retrieve a list of the N of queued entries.int
getSize()
Deprecated.Retrieve the number of elements in the queue.void
reset()
Deprecated.Remove all queued index tasks from this 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.search.IndexTaskQueue
flushAndExecute, flushAndExecute
-
-
-
-
Constructor Detail
-
CompositeIndexTaskQueue
public CompositeIndexTaskQueue(Map<SearchIndex,IndexTaskQueue<T>> taskQueueBySearchIndex, IndexTaskQueue<T> fallbackQueue)
Deprecated.
-
-
Method Detail
-
getSize
public int getSize()
Deprecated.Description copied from interface:IndexTaskQueue
Retrieve the number of elements in the queue.- Specified by:
getSize
in interfaceIndexTaskQueue<T extends IndexTask>
- Returns:
- size of the queue.
-
getQueuedEntries
public List<T> getQueuedEntries()
Deprecated.Description copied from interface:IndexTaskQueue
Retrieve a list of all queued entries.- Specified by:
getQueuedEntries
in interfaceIndexTaskQueue<T extends IndexTask>
- Returns:
- a list of IndexTask instances.
-
getQueuedEntries
public List<T> getQueuedEntries(int limit)
Deprecated.Description copied from interface:IndexTaskQueue
Retrieve a list of the N of queued entries.- Specified by:
getQueuedEntries
in interfaceIndexTaskQueue<T extends IndexTask>
- Parameters:
limit
- first N entries to retrieve.- Returns:
- a list of IndexTask instances.
-
enqueue
public void enqueue(T task)
Deprecated.Description copied from interface:IndexTaskQueue
Add a new task to this queue.- Specified by:
enqueue
in interfaceIndexTaskQueue<T extends IndexTask>
-
enqueueAll
public void enqueueAll(Collection<T> tasks)
Deprecated.Description copied from interface:IndexTaskQueue
Add a collection of tasks to this queue.- Specified by:
enqueueAll
in interfaceIndexTaskQueue<T extends IndexTask>
-
flushQueue
public List<T> flushQueue(int numberOfEntries)
Deprecated.Description copied from interface:IndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.Tasks that were added immediately before calling this method are not returned. See
IndexTaskQueue.flushQueue()
for an alternative.- Specified by:
flushQueue
in interfaceIndexTaskQueue<T extends IndexTask>
- Parameters:
numberOfEntries
- the maximum number of entries to return. This should return the n first entries in the queue.- Returns:
- the list of entries on the queue when it was flushed.
-
flushQueue
public List<T> flushQueue()
Deprecated.Description copied from interface:IndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.This method waits until tasks that we added immediately before calling this method are available. See
IndexTaskQueue.flushQueue(int)
for an alternative.- Specified by:
flushQueue
in interfaceIndexTaskQueue<T extends IndexTask>
- Returns:
- the list of entries on the queue when it was flushed.
-
flushQueue
public int flushQueue(com.atlassian.fugue.Effect<T> actionOnTask)
Deprecated.Description copied from interface:IndexTaskQueue
Flush the contents of the queue, applying the given action to each flushed entry.This method waits until tasks that we added immediately before calling this method are available. See
IndexTaskQueue.flushAndExecute(Consumer, int)
for an alternative.- Specified by:
flushQueue
in interfaceIndexTaskQueue<T extends IndexTask>
- Parameters:
actionOnTask
- action to perform for each entry- Returns:
- the number of entries that were flushed.
-
flushQueue
public int flushQueue(com.atlassian.fugue.Effect<T> actionOnTask, int numberOfEntries)
Deprecated.Description copied from interface:IndexTaskQueue
Flush the contents of the queue, applying the given action to each flushed entry.Tasks that were added immediately before calling this method are not returned. See
IndexTaskQueue.flushAndExecute(Consumer)
for an alternative.- Specified by:
flushQueue
in interfaceIndexTaskQueue<T extends IndexTask>
- Parameters:
actionOnTask
- action to perform for each entrynumberOfEntries
- the maximum number of entries to flush. This should flush the n first entries in the queue.- Returns:
- the number of entries that were flushed.
-
reset
public void reset()
Deprecated.Description copied from interface:IndexTaskQueue
Remove all queued index tasks from this queue.- Specified by:
reset
in interfaceIndexTaskQueue<T extends IndexTask>
-
flushQueueWithActionOnIterableOfTasks
public int flushQueueWithActionOnIterableOfTasks(Consumer<Iterable<T>> actionOnIterableOfTasks, int numberOfTasks)
Deprecated.Description copied from interface:IndexTaskQueue
Flush the contents of the queue, applying the given action to an iterable of tasks.IndexTaskQueue.flushQueue(Effect, int)
applys an action to an individual task. In contrast, this method applies an action to an iterable of tasks.If the specified action throws a RuntimeException, tasks are returned to the queue so that they can be processed again. The exception will be propagated so clients must handle it accordingly.
- Specified by:
flushQueueWithActionOnIterableOfTasks
in interfaceIndexTaskQueue<T extends IndexTask>
- Parameters:
actionOnIterableOfTasks
- action on iterable of tasksnumberOfTasks
- the maximum number of tasks to retrieve from the queue- Returns:
- the number of tasks that were flushed to the index.
-
-