com.atlassian.confluence.search.lucene.queue
Class JournalIndexTaskQueue

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.queue.JournalIndexTaskQueue
All Implemented Interfaces:
IndexTaskQueue

public class JournalIndexTaskQueue
extends java.lang.Object
implements IndexTaskQueue

IndexTaskQueue that stores IndexTasks in journal.

Since:
5.6

Nested Class Summary
static class JournalIndexTaskQueue.Type
           
 
Field Summary
static JournalIdentifier JOURNAL_ID
           
 
Constructor Summary
JournalIndexTaskQueue(JournalService journalService, IndexTaskFactory indexTaskFactory, AnyTypeDao anyTypeDao)
           
 
Method Summary
static JournalEntry createEntry(JournalIndexTaskQueue.Type type, java.lang.String handle)
           
 void enqueue(IndexTask task)
          Add a new task to this queue.
 void enqueueAll(java.util.Collection<IndexTask> tasks)
          Add a collection of tasks to this queue.
 java.util.List<IndexTask> flushQueue()
          Deprecated. 
 int flushQueue(com.atlassian.fugue.Effect<IndexTask> action)
          Flush the contents of the queue, applying the given action to each flushed entry.
 int flushQueue(com.atlassian.fugue.Effect<IndexTask> action, int numberOfEntries)
          Flush the contents of the queue, applying the given action to each flushed entry.
 java.util.List<IndexTask> flushQueue(int numberOfEntries)
          Deprecated. 
 java.util.List<IndexTask> getQueuedEntries()
          Retrieve a list of all of the queued entries.
 int getSize()
          Retrieve the number of elements in the queue.
 void reset()
          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
 

Field Detail

JOURNAL_ID

@Internal
public static final JournalIdentifier JOURNAL_ID
Constructor Detail

JournalIndexTaskQueue

public JournalIndexTaskQueue(JournalService journalService,
                             IndexTaskFactory indexTaskFactory,
                             AnyTypeDao anyTypeDao)
Method Detail

getSize

public int getSize()
Description copied from interface: IndexTaskQueue
Retrieve the number of elements in the queue.

Specified by:
getSize in interface IndexTaskQueue
Returns:
size of the queue.

getQueuedEntries

public java.util.List<IndexTask> getQueuedEntries()
Description copied from interface: IndexTaskQueue
Retrieve a list of all of the queued entries.

Specified by:
getQueuedEntries in interface IndexTaskQueue
Returns:
a list of IndexTask instances.

enqueue

public void enqueue(IndexTask task)
Description copied from interface: IndexTaskQueue
Add a new task to this queue.

Specified by:
enqueue in interface IndexTaskQueue

enqueueAll

public void enqueueAll(java.util.Collection<IndexTask> tasks)
Description copied from interface: IndexTaskQueue
Add a collection of tasks to this queue.

Specified by:
enqueueAll in interface IndexTaskQueue

flushQueue

@Deprecated
public java.util.List<IndexTask> 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 interface IndexTaskQueue
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

@Deprecated
public java.util.List<IndexTask> 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 interface IndexTaskQueue
Returns:
the list of entries on the queue when it was flushed.

flushQueue

public int flushQueue(com.atlassian.fugue.Effect<IndexTask> action)
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.flushQueue(com.atlassian.fugue.Effect, int) for an alternative.

Specified by:
flushQueue in interface IndexTaskQueue
Parameters:
action - action to perform for each entry
Returns:
the number of entries that were flushed.

flushQueue

public int flushQueue(com.atlassian.fugue.Effect<IndexTask> action,
                      int numberOfEntries)
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.flushQueue(com.atlassian.fugue.Effect) for an alternative.

Specified by:
flushQueue in interface IndexTaskQueue
Parameters:
action - action to perform for each entry
numberOfEntries - 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()
Description copied from interface: IndexTaskQueue
Remove all queued index tasks from this queue.

Specified by:
reset in interface IndexTaskQueue

createEntry

@Internal
public static JournalEntry createEntry(JournalIndexTaskQueue.Type type,
                                                java.lang.String handle)


Copyright © 2003-2014 Atlassian. All Rights Reserved.