Class FilteredFileTaskQueue

  • All Implemented Interfaces:
    org.dspace.curate.TaskQueue

    public class FilteredFileTaskQueue
    extends org.dspace.curate.FileTaskQueue
    An 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 Detail

      • FilteredFileTaskQueue

        public FilteredFileTaskQueue()
    • 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 a release is called. The ticket may be any number, but a timestamp should guarantee sufficient uniqueness.
        Specified by:
        dequeue in interface org.dspace.curate.TaskQueue
        Overrides:
        dequeue in class org.dspace.curate.FileTaskQueue
        Parameters:
        queueName - the name of the queue to read
        ticket - 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