Class HarvestJobGenerator

  • All Implemented Interfaces:
    ComponentLifeCycle

    public class HarvestJobGenerator
    extends java.lang.Object
    implements ComponentLifeCycle
    Handles the generation of new jobs based on the harvest definitions in persistent storage. The HarvestJobGenerator continuously scans the harvest definition database for harvest which should be run now. If a HD defines a harvest which should be run, a Harvest Job is created in the harvest job database.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.Set<java.lang.Long> harvestDefinitionsBeingScheduled
      The set of HDs (or rather their OIDs) that are currently being scheduled in a separate thread.
      protected static java.util.Map<java.lang.Long,​java.lang.Long> schedulingStartedMap
      Used the store the currenttimeMillis when the scheduling of a particular harvestdefinition # started or when last a warning was issued.
      protected static java.util.Map<java.lang.Long,​dk.netarkivet.harvester.scheduler.HarvestJobGenerator.JobGeneratorTask.JobGeneratorThread> threadMap
      A map giving access to the thread generating jobs for a given harvest definition.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void shutdown()
      The inverse of the start() method.
      void start()
      Starts the job generation scheduler.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • harvestDefinitionsBeingScheduled

        protected static java.util.Set<java.lang.Long> harvestDefinitionsBeingScheduled
        The set of HDs (or rather their OIDs) that are currently being scheduled in a separate thread. This set is a SynchronizedSet
      • threadMap

        protected static java.util.Map<java.lang.Long,​dk.netarkivet.harvester.scheduler.HarvestJobGenerator.JobGeneratorTask.JobGeneratorThread> threadMap
        A map giving access to the thread generating jobs for a given harvest definition.
      • schedulingStartedMap

        protected static java.util.Map<java.lang.Long,​java.lang.Long> schedulingStartedMap
        Used the store the currenttimeMillis when the scheduling of a particular harvestdefinition # started or when last a warning was issued.
    • Method Detail

      • shutdown

        public void shutdown()
        Description copied from interface: ComponentLifeCycle
        The inverse of the start() method. Contains functionality for deallocation of ressources, clearing data, closing connections, stopping threads, etc
        Specified by:
        shutdown in interface ComponentLifeCycle