Interface JobGenerator
-
- All Known Implementing Classes:
DefaultJobGenerator
,FixedDomainConfigurationCountJobGenerator
public interface JobGenerator
This interface defines the core methods that should be provided by a job generator. It is designed to allow alternate implementations of job generation, depending on curators and/or production engineers specific needs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canAccept(Job job, DomainConfiguration cfg, DomainConfiguration previousCfg)
Tests if a configuration fits into this Job.int
generateJobs(HarvestDefinition harvest)
Generates a series of jobs for the given harvest definition.boolean
ignoreConfiguration(DomainConfiguration cfg)
Test if this configuration should be ignored
-
-
-
Method Detail
-
generateJobs
int generateJobs(HarvestDefinition harvest)
Generates a series of jobs for the given harvest definition. Note that a job generator is expected to follow the singleton pattern, so implementations of this method should be thread-safe.- Parameters:
harvest
- the harvest definition to process.- Returns:
- the number of jobs that were generated.
-
canAccept
boolean canAccept(Job job, DomainConfiguration cfg, DomainConfiguration previousCfg)
Tests if a configuration fits into this Job. First tests if it's the right type of order-template and bytelimit, and whether the bytelimit is right for the job. The Job limits are compared against the configuration estimates and if no limits are exceeded true is returned otherwise false is returned.- Parameters:
job
- the job being built.cfg
- the configuration to checkpreviousCfg
- if not null, the configuration added to this job immediately prior- Returns:
- true if adding the configuration to this Job does not exceed any of the Job limits.
- Throws:
ArgumentNotValid
- if cfg is null
-
ignoreConfiguration
boolean ignoreConfiguration(DomainConfiguration cfg)
Test if this configuration should be ignored- Parameters:
cfg
- a domain configuration- Returns:
- true if we should ignore this configuration (It could be that it is disabled in some way, or all seeds are prefixed with a '#' and so there are no active seeds
-
-