|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.distribute.HarvesterMessageHandler dk.netarkivet.harvester.scheduler.HarvestDispatcher
public class HarvestDispatcher
This class handles dispatching of scheduled Harvest jobs to the Harvest servers
The scheduler loads all active harvest definitions on a regular basis and extracts the scheduling information for each definition. When a harvest definition is scheduled to start the scheduler creates the corresponding harvest jobs and submits these to the active HarvestServers.
The dispatching of jobs occurs when the internal state (built by processing
HarvesterStatusMessage
s) tracksq at least one available harvester
for a given priority. A job of the same priority is then issued for each
available harvester.
Note: Only one HarvestDispatcher
should be running at a time.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
The logger to use. |
Constructor Summary | |
---|---|
HarvestDispatcher()
Create new instance of the HarvestDispatcher. |
Method Summary | |
---|---|
(package private) void |
dispatchJobs()
Dispatches new jobs. |
void |
doOneCrawl(Job job,
java.lang.String origHarvestName,
java.lang.String origHarvestDesc,
java.lang.String origHarvestSchedule,
java.util.List<MetadataEntry> metadata)
Submit an doOneCrawl request to a HarvestControllerServer with correct priority. |
void |
shutdown()
Release allocated resources (JMS connections) and stops dispatching harvest jobs, all without logging. |
void |
start()
Start the thread responsible for reading Harvest definitions from the database, and dispatching the harvest job to the servers. |
(package private) void |
submitNewJobs()
For each JobPriority , submits as many jobs
as the internal state records available harvesters. |
void |
visit(HarvesterStatusMessage msg)
This method should be overridden and implemented by a sub class if message handling is wanted. |
Methods inherited from class dk.netarkivet.harvester.distribute.HarvesterMessageHandler |
---|
onMessage, visit, visit, visit, visit, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jms.MessageListener |
---|
onMessage |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public HarvestDispatcher()
Method Detail |
---|
public void start()
start
in interface ComponentLifeCycle
void dispatchJobs()
void submitNewJobs()
JobPriority
, submits as many jobs
as the internal state records available harvesters.
public void doOneCrawl(Job job, java.lang.String origHarvestName, java.lang.String origHarvestDesc, java.lang.String origHarvestSchedule, java.util.List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure
job
- the specific job to sendorigHarvestName
- the harvest definition's nameorigHarvestDesc
- the harvest definition's descriptionorigHarvestSchedule
- the harvest definition schedule namemetadata
- pre-harvest metadata to store in arcfile.
ArgumentNotValid
- one of the parameters are null
IOFailure
- if unable to send the doOneCrawl request to a
harvestControllerServerpublic void shutdown()
shutdown
in interface ComponentLifeCycle
public void visit(HarvesterStatusMessage msg)
HarvesterMessageHandler
visit
in interface HarvesterMessageVisitor
visit
in class HarvesterMessageHandler
msg
- a HarvesterStatusMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |