Class DocumentCleanupQueue
- java.lang.Object
-
- org.apache.manifoldcf.crawler.system.DocumentCleanupQueue
-
public class DocumentCleanupQueue extends java.lang.Object
This class describes a cleanup document queue, which has a "stuffer" thread and many "reader" threads. The queue manages thread synchronization so that (a) the "stuffer" thread blocks until queue is empty, and (b) the "reader" threads block if queue is empty. The objects being queued are all QueuedDocumentSet objects.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected java.util.List<DocumentCleanupSet>
queue
protected boolean
resetFlag
-
Constructor Summary
Constructors Constructor Description DocumentCleanupQueue()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDocuments(DocumentCleanupSet dd)
Add a document set to the queue.boolean
checkIfEmpty(int n)
Check if "empty".void
clear()
Clear.DocumentCleanupSet
getDocuments()
Pull a document set off the queue, and wait if there is nothing there.void
reset()
Wake up all threads waiting on this queue.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
queue
protected final java.util.List<DocumentCleanupSet> queue
-
resetFlag
protected boolean resetFlag
-
-
Method Detail
-
reset
public void reset()
Wake up all threads waiting on this queue. This happens at the beginning of a reset.
-
clear
public void clear()
Clear. This is only used on reset.
-
checkIfEmpty
public boolean checkIfEmpty(int n)
Check if "empty".- Parameters:
n
- is the low-water mark; if the number falls below this, then this method will return true.
-
addDocuments
public void addDocuments(DocumentCleanupSet dd)
Add a document set to the queue. This will be a set of n documents (where n is some chunk size set by experiment).- Parameters:
dd
- is the document set.
-
getDocuments
public DocumentCleanupSet getDocuments() throws java.lang.InterruptedException
Pull a document set off the queue, and wait if there is nothing there.- Returns:
- the document.
- Throws:
java.lang.InterruptedException
-
-