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

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.queue.IndexQueueTracker

public class IndexQueueTracker
extends java.lang.Object

This tracker allows us to check whether there are any unflushed index queue entries without doing a database query. By avoiding database queries we significantly reduce the load generated by idle instances that don't have any index tasks being added to the queue.

This relies on local transaction synchronisation and also on the fact the IDs of index queue entries always increase on a single node, so we always require flushing if we are in a clustered environment.

This component should be initialised (see initialiseLastQueueEntry(long entryId)) so that it is aware of the starting state of the index queue. If initialisation is missed then the index queue will not be processed until the first enqueue(IndexQueueEntry) call is made.


Constructor Summary
IndexQueueTracker(SynchronizationManager synchronizationManager, ClusterManager clusterManager)
           
 
Method Summary
 void enqueue(IndexQueueEntry e)
           
 void flush(java.util.Collection<IndexQueueEntry> entries)
           
 boolean needsFlushing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexQueueTracker

public IndexQueueTracker(SynchronizationManager synchronizationManager,
                         ClusterManager clusterManager)
Method Detail

enqueue

public void enqueue(IndexQueueEntry e)

needsFlushing

public boolean needsFlushing()

flush

public void flush(java.util.Collection<IndexQueueEntry> entries)


Copyright © 2003-2013 Atlassian. All Rights Reserved.