Class HarvestJobGenerator
- java.lang.Object
-
- dk.netarkivet.harvester.scheduler.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. TheHarvestJobGenerator
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.
-
Constructor Summary
Constructors Constructor Description HarvestJobGenerator(HarvestChannelRegistry harvestChannelRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
shutdown()
The inverse of thestart()
method.void
start()
Starts the job generation scheduler.
-
-
-
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.
-
-
Constructor Detail
-
HarvestJobGenerator
public HarvestJobGenerator(HarvestChannelRegistry harvestChannelRegistry)
-
-
Method Detail
-
start
public void start()
Starts the job generation scheduler.- Specified by:
start
in interfaceComponentLifeCycle
-
shutdown
public void shutdown()
Description copied from interface:ComponentLifeCycle
The inverse of thestart()
method. Contains functionality for deallocation of ressources, clearing data, closing connections, stopping threads, etc- Specified by:
shutdown
in interfaceComponentLifeCycle
-
-