com.atlassian.confluence.plugins.edgeindex.lucene
Class InMemoryEdgeIndexTaskQueue

java.lang.Object
  extended by com.atlassian.confluence.plugins.edgeindex.lucene.InMemoryEdgeIndexTaskQueue
All Implemented Interfaces:
EdgeIndexTaskQueue

public class InMemoryEdgeIndexTaskQueue
extends java.lang.Object
implements EdgeIndexTaskQueue

Bounded index tasks queue. When the limit is reached, the queue discard new task.


Constructor Summary
InMemoryEdgeIndexTaskQueue()
           
 
Method Summary
 void enqueue(EdgeIndexTask task)
          Add a new task to this queue.
 void enqueueAll(java.util.Collection<EdgeIndexTask> tasks)
          Add a collection of tasks to this queue.
 java.util.List<EdgeIndexTask> flushQueue()
          Flush the contents of the queue, returning those elements currently queued as the result.
 java.util.List<EdgeIndexTask> flushQueue(int numberOfEntries)
          Flush the contents of the queue, returning those elements currently queued as the result.
 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
 

Constructor Detail

InMemoryEdgeIndexTaskQueue

public InMemoryEdgeIndexTaskQueue()
Method Detail

getSize

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

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

enqueue

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

Specified by:
enqueue in interface EdgeIndexTaskQueue

enqueueAll

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

Specified by:
enqueueAll in interface EdgeIndexTaskQueue

flushQueue

public java.util.List<EdgeIndexTask> flushQueue(int numberOfEntries)
Description copied from interface: EdgeIndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.

Specified by:
flushQueue in interface EdgeIndexTaskQueue
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 java.util.List<EdgeIndexTask> flushQueue()
Description copied from interface: EdgeIndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.

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

reset

public void reset()
Description copied from interface: EdgeIndexTaskQueue
Remove all queued index tasks from this queue.

Specified by:
reset in interface EdgeIndexTaskQueue


Copyright © 2003-2014 Atlassian. All Rights Reserved.