Class TrivialJobIndexCache

  • All Implemented Interfaces:
    JobIndexCache

    public class TrivialJobIndexCache
    extends Object
    implements JobIndexCache
    A trivial JobIndexCache implementation that just assumes somebody places the indexes in the right place (in TrivialJobIndexCache under the cache dir).
    • Constructor Detail

      • TrivialJobIndexCache

        public TrivialJobIndexCache​(RequestType t)
        Construct a trivial cache that requires manual setup of files.

        The directory that the files are to be put into will be created by this method.

        Parameters:
        t - The type of requests handled
    • Method Detail

      • getIndex

        public Index<Set<Long>> getIndex​(Set<Long> jobIDs)
        Get an index for the given list of job IDs. The resulting file contains a suitably sorted list. This method should always be safe for asynchronous calling. This method may use a cached version of the file.
        Specified by:
        getIndex in interface JobIndexCache
        Parameters:
        jobIDs - Set of job IDs to generate index for.
        Returns:
        A file containing the index, and always the full set. The file must not be modified or deleted, since it is part of the cache of data.
        Throws:
        IOFailure - if there is no cache file for the set.
      • requestIndex

        public void requestIndex​(Set<Long> jobSet,
                                 Long harvestId)
        Description copied from interface: JobIndexCache
        Request an index from the indexserver. Prepare the index but don't give it to me.
        Specified by:
        requestIndex in interface JobIndexCache
        Parameters:
        jobSet - Set of job IDs to generate index for.
        harvestId - Harvestdefinition associated with this set of jobs