Pepper
3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
|
This class represents a single, but entire conversion process in Pepper, containing the entire workflow like import, manipulation and export. More...
Inherits org.corpus_tools.pepper.common.PepperJob.
Public Member Functions | |
PepperJobImpl (String jobId) | |
Initializes a PepperJobImpl and sets its unique identifier. More... | |
SaltProject | getSaltProject () |
Returns the SaltProject which is converted by this job.
| |
void | setSaltProject (SaltProject saltProject) |
Sets the SaltProject which is converted by this job. More... | |
PepperConfiguration | getConfiguration () |
returns the properties to customize the behavior of conversion for this single job. More... | |
void | setConfiguration (PepperConfiguration conf) |
Sets the properties to customize the behavior of conversion for this single job. More... | |
ModuleResolver | getModuleResolver () |
Returns a reference to the OSGi module resolver, to find modules matching to the step description. More... | |
void | setModuleResolver (ModuleResolver moduleResolver) |
Sets a reference to the OSGi module resolver, to find modules matching to the step description. More... | |
List< Step > | getManipulationSteps () |
Returns the list of all steps belonging to the manipulation phase. More... | |
List< Step > | getImportSteps () |
Returns the list of all steps belonging to the import phase. More... | |
List< Step > | getExportSteps () |
Returns the list of all steps belonging to the export phase. More... | |
List< Step > | getAllSteps () |
Returns a of all steps belonging no matter, to which phase they belong. More... | |
synchronized void | addStepDesc (StepDesc stepDesc) |
Overrides method PepperJob#addStepDesc(StepDesc), but calls it via super and than calls addStep(Step). More... | |
synchronized Step | addStep (StepDesc stepDesc) |
Creates a new Step object containing all values of the passed StepDesc object and adds it to the workflow covered by this PepperJobImpl. More... | |
synchronized void | addStep (Step step) |
Adds the passed Step object to the workflow covered by this PepperJobImpl object and tries to resolve the described PepperModule. More... | |
List< DocumentController > | getDocumentControllers () |
Returns a list of all DocumentControllerImpl objects corresponding to each SDocument belonging to this job. More... | |
String | getStatusReport () |
{@inheritDoc PepperJob::getStatusReport()} | |
Long | getProcessingTime () |
Returns the amount of time the job already took. More... | |
void | convert () |
Starts the conversion of this job. More... | |
void | convertFrom () |
Imports a SaltProject from any format.For conversion a process can be modeled, similar to convert() with the difference, that no PepperExporter could be defined. The imported Salt model can be accessed via getSaltProject(). | |
void | convertTo () |
Exports the SaltProject into any format.For conversion, a normal process could be created, except the use of an importer. Here the do-nothing importer is used, and it is expected, that the getSaltProject() is already 'filled'. | |
void | cancelConversion () |
Cancels the current conversion. More... | |
boolean | isCancellationRequested () |
Get if someone requested to cancel this job. More... | |
MEMORY_POLICY | getMemPolicy () |
Returns the set memory policy. More... | |
int | getMaxNumberOfDocuments () |
Returns the maximal number of SDocument objects which could be processed at the same time. More... | |
int | getNumOfActiveDocuments () |
Returns the current number of SDocument objects which could be processed at the same time. More... | |
Set< DocumentController > | getActiveDocuments () |
Returns a set of all currently active documents. | |
boolean | getPermissionForProcessDoument (DocumentController controller) |
Returns true, if a SDocument or more precisely spoken a SDocumentGraph could be woken up or imported. More... | |
void | releaseDocument (DocumentController controller) |
Releases a document and reduces the internal counter for the number of currently processed documents (getNumOfActiveDocuments()). | |
URI | save (URI uri) |
{@inheritDoc PepperJob::save(URI)} | |
void | clear () |
{@inheritDoc PepperJob::clear()} | |
void | load (URI uri) |
{@inheritDoc PepperJob::load(URI)} | |
String | toString () |
Returns a textual representation of this Pepper job. More... | |
Public Member Functions inherited from org.corpus_tools.pepper.common.PepperJob | |
String | getId () |
Returns the unique identifier for this job. More... | |
void | setBaseDir (URI baseDir) |
Sets the base directory for this ModuleController. More... | |
URI | getBaseDir () |
Returns the base directory for this ModuleController. More... | |
JOB_STATUS | getStatus () |
Returns the current status of this job. More... | |
List< StepDesc > | getStepDescs () |
Returns a list of all step descriptions. More... | |
StepDesc | createStepDesc () |
Creates a StepDesc object an returns it, without adding the created StepDesc object to this PepperJob object. More... | |
Protected Member Functions | |
List< DocumentBus > | getDocumentBuses () |
synchronized void | wire () |
Wires all Step objects being contained by this object to be ready for start(). More... | |
synchronized void | importCorpusStructures () |
Imports corpus structures of all registered ImportCorpusStructureTest steps. More... | |
List< Identifier > | unifyProposedImportOrders (SCorpusGraph sCorpusGraph) |
Returns a list of Identifiers corresponding to the SDocument objects contained in the passed SCorpusGraph object. More... | |
synchronized Collection< Pair< Step, Collection< String > > > | checkReadyToStart () |
Checks for each PepperModule in all steps, if it is ready to start, via calling PepperModule#isReadyToStart(). More... | |
void | setMemPolicy (MEMORY_POLICY memPolicy) |
Sets the memory policy. More... | |
void | setMaxNumerOfDocuments (int maxNumOfDocuments) |
Protected Attributes | |
SaltProject | saltProject = null |
The SaltProject which is converted by this job. | |
ModuleResolver | moduleResolver = null |
A reference to the OSGi module resolver, to find modules matching to the step description. | |
List< DocumentBus > | documentBuses = null |
A list of all buses between the ModuleControllerImpl objects. | |
List< DocumentBus > | initialDocumentBuses = null |
all documentBusses which are connected with PepperImporter modules | |
boolean | isWired = false |
Determines, if steps are already wired. More... | |
volatile boolean | isImportedCorpusStructure = false |
flag to determine, if corpus structure has already been imported | |
List< DocumentController > | documentControllers = null |
A list of all DocumentControllerImpl objects corresponding to each SDocument belonging to this job. | |
boolean | isReadyToStart = false |
Determines if checkReadyToStart() was already called. | |
volatile ReentrantLock | inProgress = new ReentrantLock() |
Specifies if this job currently runs a conversion. More... | |
volatile MEMORY_POLICY | memPolicy = MEMORY_POLICY.MODERATE |
Protected Attributes inherited from org.corpus_tools.pepper.common.PepperJob | |
String | id = null |
Identifier of this job. More... | |
JOB_STATUS | status = JOB_STATUS.NOT_STARTED |
status of job | |
Vector< StepDesc > | stepDescs = null |
list of all step descriptions | |
This class represents a single, but entire conversion process in Pepper, containing the entire workflow like import, manipulation and export.
This object contains a list of single steps. Each of such steps represent one task in processing by a specific module. Such a step is represented by the Step class. To get the list of all steps, see getSteps(). Note: Do not use this list to add a further step. Use addStep(PepperModule) instead.
If you do not follow this order in calling, and for instance call task 3 fist, than task 1 and task 2 will be done automatically.
org.corpus_tools.pepper.core.PepperJobImpl.PepperJobImpl | ( | String | jobId | ) |
Initializes a PepperJobImpl and sets its unique identifier.
jobId | unique identifier for this job. The id is not changeable |
synchronized void org.corpus_tools.pepper.core.PepperJobImpl.addStep | ( | Step | step | ) |
Adds the passed Step object to the workflow covered by this PepperJobImpl object and tries to resolve the described PepperModule.
step | Step object to be added to internal list |
Creates a new Step object containing all values of the passed StepDesc object and adds it to the workflow covered by this PepperJobImpl.
Further tries to resolve the described PepperModule.
stepDesc | StepDesc object to be added to internal list |
synchronized void org.corpus_tools.pepper.core.PepperJobImpl.addStepDesc | ( | StepDesc | stepDesc | ) |
Overrides method PepperJob#addStepDesc(StepDesc), but calls it via super and than calls addStep(Step).
{@inheritDoc PepperJob::addStepDesc(StepDesc)}
Reimplemented from org.corpus_tools.pepper.common.PepperJob.
void org.corpus_tools.pepper.core.PepperJobImpl.cancelConversion | ( | ) |
Cancels the current conversion.
This might not stop immediately, but might finish the running document controller jobs first.
Reimplemented from org.corpus_tools.pepper.common.PepperJob.
|
protected |
Checks for each PepperModule in all steps, if it is ready to start, via calling PepperModule#isReadyToStart().
void org.corpus_tools.pepper.core.PepperJobImpl.convert | ( | ) |
Starts the conversion of this job.
Reimplemented from org.corpus_tools.pepper.common.PepperJob.
List<Step> org.corpus_tools.pepper.core.PepperJobImpl.getAllSteps | ( | ) |
Returns a of all steps belonging no matter, to which phase they belong.
This computation could be expensive, when working more than once with the list, make a local copy and don't call this method twice.
PepperConfiguration org.corpus_tools.pepper.core.PepperJobImpl.getConfiguration | ( | ) |
returns the properties to customize the behavior of conversion for this single job.
List<DocumentController> org.corpus_tools.pepper.core.PepperJobImpl.getDocumentControllers | ( | ) |
Returns a list of all DocumentControllerImpl objects corresponding to each SDocument belonging to this job.
List<Step> org.corpus_tools.pepper.core.PepperJobImpl.getExportSteps | ( | ) |
Returns the list of all steps belonging to the export phase.
List<Step> org.corpus_tools.pepper.core.PepperJobImpl.getImportSteps | ( | ) |
Returns the list of all steps belonging to the import phase.
List<Step> org.corpus_tools.pepper.core.PepperJobImpl.getManipulationSteps | ( | ) |
Returns the list of all steps belonging to the manipulation phase.
int org.corpus_tools.pepper.core.PepperJobImpl.getMaxNumberOfDocuments | ( | ) |
Returns the maximal number of SDocument objects which could be processed at the same time.
MEMORY_POLICY org.corpus_tools.pepper.core.PepperJobImpl.getMemPolicy | ( | ) |
Returns the set memory policy.
ModuleResolver org.corpus_tools.pepper.core.PepperJobImpl.getModuleResolver | ( | ) |
Returns a reference to the OSGi module resolver, to find modules matching to the step description.
int org.corpus_tools.pepper.core.PepperJobImpl.getNumOfActiveDocuments | ( | ) |
Returns the current number of SDocument objects which could be processed at the same time.
boolean org.corpus_tools.pepper.core.PepperJobImpl.getPermissionForProcessDoument | ( | DocumentController | controller | ) |
Returns true, if a SDocument or more precisely spoken a SDocumentGraph could be woken up or imported.
This is the case, as long as:
getNumOfActiveDocuments() < getMaxNumberOfDocuments().
Must be synchronized,
Long org.corpus_tools.pepper.core.PepperJobImpl.getProcessingTime | ( | ) |
Returns the amount of time the job already took.
|
protected |
Imports corpus structures of all registered ImportCorpusStructureTest steps.
After calling PepperImporter#importCorpusStructure(SCorpusGraph) , all following modules will be asked, if they want to influence the order of importing documents. If this is the case, an order is created and put to all PepperImporter objects.
This method produces as much as SCorpusGraph objects as Step given in import step list getImportSteps(). The position of SCorpusGraph corresponding to PepperImporter (importing that graph) in SaltProject#getCorpusGraphs() is equivalent to position of Step in list getImportSteps().
boolean org.corpus_tools.pepper.core.PepperJobImpl.isCancellationRequested | ( | ) |
Get if someone requested to cancel this job.
void org.corpus_tools.pepper.core.PepperJobImpl.setConfiguration | ( | PepperConfiguration | conf | ) |
Sets the properties to customize the behavior of conversion for this single job.
conf | for customization |
|
protected |
Sets the memory policy.
Don't change the memory policy, when job was started.
memPolicy |
void org.corpus_tools.pepper.core.PepperJobImpl.setModuleResolver | ( | ModuleResolver | moduleResolver | ) |
Sets a reference to the OSGi module resolver, to find modules matching to the step description.
moduleResolver | reference to resolver to resolve PepperModule objects |
void org.corpus_tools.pepper.core.PepperJobImpl.setSaltProject | ( | SaltProject | saltProject | ) |
Sets the SaltProject which is converted by this job.
saltProject | new SaltProject |
String org.corpus_tools.pepper.core.PepperJobImpl.toString | ( | ) |
Returns a textual representation of this Pepper job.
Note: This representation could not be used for serialization/deserialization purposes.
Reimplemented from org.corpus_tools.pepper.common.PepperJob.
|
protected |
Returns a list of Identifiers corresponding to the SDocument objects contained in the passed SCorpusGraph object.
If all registered modules, do not make a proposal, the natural one (the one given by the order of SDocuments in SCorpusGraph) is taken. Note: Currently, this method does not a real unification, if more than one proposals are given, the first one is taken.
sCorpusGraph | the SCorpusGraph for which the list has to be unified |
|
protected |
Wires all Step objects being contained by this object to be ready for start().
Which means, that:
|
protected |
Specifies if this job currently runs a conversion.
If this is the case, some other operations, like adding Steps cannot be done simultaneously.
|
protected |
Determines, if steps are already wired.
This is necessary for start().