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

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

public class DatabaseIndexTaskQueue
extends java.lang.Object
implements IndexTaskQueue

An implementation of the IndexTaskQueue backed by the database.


Field Summary
static org.apache.log4j.Category log
           
 
Constructor Summary
DatabaseIndexTaskQueue()
           
 
Method Summary
 java.util.Date calculateLastFlushTime()
           
 void deleteOldEntries()
          Delete all entries older then 2 days from the database.
 void enqueue(IndexTask task)
          Add a new index task to the queue.
 void enqueueAll(java.util.Collection tasks)
          Add a collection of index tasks to the queue.
 java.util.List flushQueue()
          Flush the contents of the queue, returning those elements currently queued as the result.
 java.util.Date getExactLastFlushTimeFromDisk()
           
 java.util.List getQueuedEntries()
          Retrieve the list of index tasks currently queued.
 int getSize()
          Retrieve the number of tasks currently queued.
 void reset()
          Reseting the queue removes all queued index tasks from the queue without flushing.
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
 void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)
           
 void setQueueEntryDao(bucket.search.persistence.dao.IndexQueueEntryDao queueEntryDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log
Constructor Detail

DatabaseIndexTaskQueue

public DatabaseIndexTaskQueue()
Method Detail

enqueue

public void enqueue(IndexTask task)
Add a new index task to the queue.

Specified by:
enqueue in interface IndexTaskQueue

enqueueAll

public void enqueueAll(java.util.Collection tasks)
Add a collection of index tasks to the queue.

Specified by:
enqueueAll in interface IndexTaskQueue
Parameters:
tasks -

getSize

public int getSize()
Retrieve the number of tasks currently queued.

Specified by:
getSize in interface IndexTaskQueue
Returns:
an int count of the number of index tasks in the queue.

getQueuedEntries

public java.util.List getQueuedEntries()
Retrieve the list of index tasks currently queued.

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

flushQueue

public java.util.List flushQueue()
Description copied from interface: IndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.

Specified by:
flushQueue in interface IndexTaskQueue
Returns:
the list of entries on the queue when it was flushed.

calculateLastFlushTime

public java.util.Date calculateLastFlushTime()

getExactLastFlushTimeFromDisk

public java.util.Date getExactLastFlushTimeFromDisk()

deleteOldEntries

public void deleteOldEntries()
Delete all entries older then 2 days from the database. This should be triggered by a regularly scheduled maintenance task.


reset

public void reset()
Reseting the queue removes all queued index tasks from the queue without flushing.

Specified by:
reset in interface IndexTaskQueue

setQueueEntryDao

public void setQueueEntryDao(bucket.search.persistence.dao.IndexQueueEntryDao queueEntryDao)

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

setIndexTaskFactory

public void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.