|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.harvester.scheduler.jobgen.AbstractJobGenerator
abstract class AbstractJobGenerator
A base class for JobGenerator
implementations.
It is recommended to extend this class to implement a new job generator.
The base algorithm iterates over domain configurations within the harvest definition,
and according to the configuration
(HarvesterSettings.JOBGEN_DOMAIN_CONFIG_SUBSET_SIZE
, constitutes a subset of
domain configurations from which one or more jobs will be generated.
Constructor Summary | |
---|---|
AbstractJobGenerator()
|
Method Summary | |
---|---|
boolean |
canAccept(Job job,
DomainConfiguration cfg)
Tests if a configuration fits into this Job. |
protected abstract boolean |
checkSpecificAcceptConditions(Job job,
DomainConfiguration cfg)
Called by canAccept(Job, DomainConfiguration) . |
protected void |
editJobOrderXml(Job job)
Once the job has been filled with DomainConfiguration s, performs the
following operations:
Edit the harvest template to add/remove deduplicator configuration.
|
int |
generateJobs(HarvestDefinition harvest)
Generates a series of jobs for the given harvest definition. |
protected abstract java.util.Comparator<DomainConfiguration> |
getDomainConfigurationSubsetComparator(HarvestDefinition harvest)
Returns a comparator used to sort the subset of DOMAIN_CONFIG_SUBSET_SIZE
configurations that are scanned at each iteration. |
static Job |
getNewJob(HarvestDefinition harvest,
DomainConfiguration cfg)
Instantiates a new job. |
protected abstract int |
processDomainConfigurationSubset(HarvestDefinition harvest,
java.util.Iterator<DomainConfiguration> domainConfSubset)
Create new jobs from a collection of configurations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
AbstractJobGenerator()
Method Detail |
---|
public int generateJobs(HarvestDefinition harvest)
JobGenerator
generateJobs
in interface JobGenerator
harvest
- the harvest definition to process.
public static Job getNewJob(HarvestDefinition harvest, DomainConfiguration cfg)
cfg
- the DomainConfiguration
being processedharvest
- the HarvestDefinition
being processed
Job
protected abstract java.util.Comparator<DomainConfiguration> getDomainConfigurationSubsetComparator(HarvestDefinition harvest)
DOMAIN_CONFIG_SUBSET_SIZE
configurations that are scanned at each iteration.
harvest
- the HarvestDefinition
being processed.
protected abstract int processDomainConfigurationSubset(HarvestDefinition harvest, java.util.Iterator<DomainConfiguration> domainConfSubset)
harvest
- the HarvestDefinition
being processed.domainConfSubset
- the configurations to use to create the jobs
ArgumentNotValid
- if any of the parameters is null
or if the cfglist does not contain any
configurationspublic boolean canAccept(Job job, DomainConfiguration cfg)
JobGenerator
canAccept
in interface JobGenerator
job
- the job being built.cfg
- the configuration to check
protected abstract boolean checkSpecificAcceptConditions(Job job, DomainConfiguration cfg)
canAccept(Job, DomainConfiguration)
. Tests the
implementation-specific conditions to accept the given DomainConfiguration
in the given Job
.
It is assumed that checkAddDomainConfInvariant(Job, DomainConfiguration)
has already passed.
job
- the Job
n=being builtcfg
- the DomainConfiguration
to test
protected void editJobOrderXml(Job job)
DomainConfiguration
s, performs the
following operations:
job
- the job
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |