com.atlassian.confluence.search.lucene.queue
Class DatabaseQueueFlushedEntryCache
java.lang.Object
com.atlassian.confluence.search.lucene.queue.DatabaseQueueFlushedEntryCache
public class DatabaseQueueFlushedEntryCache
- extends java.lang.Object
Provides a cache of IndexQueueEntry objects that were added to the queue close to an index flush.
Because the entry timestamps are stored in the database with only accuracy to the nearest second,
these entries may be returned when the next flush runs, and we want to prevent rerunning them.
The cacheWindowMillis controls the retention of the cache, and should be set to twice the
database accuracy (typically 2000).
Entries are added/kept if created within cacheWindowMillis milliseconds of a flush.
Entries are removed if created outside cacheWindowMillis milliseconds of a flush.
Field Summary |
static org.apache.log4j.Logger |
log
Deprecated. |
Method Summary |
void |
add(IndexQueueEntry entry)
Should only be used for testing. |
void |
addEntries(java.util.List entriesOldestFirst,
java.util.Date relativeTo)
Adds entries to the cache created on or after (relativeTo - cacheWindowMillis) |
boolean |
contains(IndexQueueEntry entry)
|
void |
removeOldEntries(java.util.Date relativeTo)
Removes items from the cache created before (relativeTo - cacheWindowMillis) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
@Deprecated
public static final org.apache.log4j.Logger log
- Deprecated.
DatabaseQueueFlushedEntryCache
public DatabaseQueueFlushedEntryCache(long cacheWindowMillis)
- Parameters:
cacheWindowMillis
- Controls timing for entry retention.
Entries are added/kept if created within cacheWindowMillis milliseconds of a flush.
Entries are removed if created outside cacheWindowMillis milliseconds of a flush.
add
public void add(IndexQueueEntry entry)
- Should only be used for testing. Use addEntries() in production code.
contains
public boolean contains(IndexQueueEntry entry)
removeOldEntries
public void removeOldEntries(java.util.Date relativeTo)
- Removes items from the cache created before (relativeTo - cacheWindowMillis)
- Parameters:
relativeTo
- typically when the current flush started
addEntries
public void addEntries(java.util.List entriesOldestFirst,
java.util.Date relativeTo)
- Adds entries to the cache created on or after (relativeTo - cacheWindowMillis)
- Parameters:
entriesOldestFirst
- a list of entries sorted by creationDate ascendingrelativeTo
- typically when the current flush started
Copyright © 2003-2013 Atlassian. All Rights Reserved.