Class FilteredFileTaskQueue
- java.lang.Object
-
- org.dspace.curate.FileTaskQueue
-
- org.dspace.ctask.replicate.FilteredFileTaskQueue
-
- All Implemented Interfaces:
org.dspace.curate.TaskQueue
public class FilteredFileTaskQueue extends org.dspace.curate.FileTaskQueueAn extension of the default FileTaskQueue which ensures that duplicate entries in the queue are filtered out during the "dequeue()" process.In other words, if multiple entries in the queue include the exact same task listing and the exact same object, only the first entry will be processed.
For example, assuming a FileTaskQueue with the following contents:
user1@myu.edu|123456789|transmitaip|10673/0
user1@myu.edu|123456790|transmitaip|10673/1
user2@myu.edu|123456791|transmitaip|10673/0
user1@myu.edu|123456792|transmitaip|10673/0
Only the first TWO entries will be returned by "dequeue()", as entries #3 and #4 would be considered duplicates of entry #1.This FilteredFileTaskQueue is extremely useful to Replication Tasks, as it ensures that AIPs are not (re-)generated multiple times when the queue is actually processed. (NOTE however that some of the Replication store plugins avoid duplicate transfers by ensuring Checksums differ before transferring)
- Author:
- Tim Donohue
-
-
Constructor Summary
Constructors Constructor Description FilteredFileTaskQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<org.dspace.curate.TaskQueueEntry>dequeue(String queueName, long ticket)Returns the set of UNIQUE task entries from the named queue.
-
-
-
Method Detail
-
dequeue
public Set<org.dspace.curate.TaskQueueEntry> dequeue(String queueName, long ticket) throws IOException
Returns the set of UNIQUE task entries from the named queue. Any duplicate task entries in the queue are ignored. The operation locks the queue from any further enqueue or dequeue operations until areleaseis called. The ticket may be any number, but a timestamp should guarantee sufficient uniqueness.- Specified by:
dequeuein interfaceorg.dspace.curate.TaskQueue- Overrides:
dequeuein classorg.dspace.curate.FileTaskQueue- Parameters:
queueName- the name of the queue to readticket- a token which must be presented to release the queue- Returns:
- set the current set of queued unique task entries
- Throws:
IOException- if I/O error
-
-