T
- input-object typeS
- shared-state typepublic abstract class JobProcessor<T extends InputFromManager,S> extends AnchorBean<JobProcessor<T,S>> implements ReplaceTask<T,S>
Constructor and Description |
---|
JobProcessor() |
Modifier and Type | Method and Description |
---|---|
protected abstract TaskStatistics |
execute(Outputter rootOutputter,
List<T> inputs,
ParametersExperiment parametersExperiment)
Executes the task on all
inputs . |
TaskStatistics |
executeLogStatistics(Outputter rootOutputter,
List<T> inputs,
ParametersExperiment parametersExperiment)
Executes the task on all
inputs and logs statistics about this to the file-systen. |
Task<T,S> |
getTask()
The task to be applied to inputs.
|
boolean |
hasVeryQuickPerInputExecution()
Is the execution-time of the task per-input expected to be very quick to execute?
|
boolean |
isInputCompatibleWith(Class<? extends InputFromManager> inputClass)
Is an input-type compatible with this particular task?
|
boolean |
isSuppressExceptions()
When true, any exception thrown processing and input is caught and logged.
|
void |
replaceTask(Task<T,S> taskToReplace)
Replace the currently-assigned
Task with another. |
void |
setSuppressExceptions(boolean suppressExceptions)
When true, any exception thrown processing and input is caught and logged.
|
void |
setTask(Task<T,S> task)
The task to be applied to inputs.
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public TaskStatistics executeLogStatistics(Outputter rootOutputter, List<T> inputs, ParametersExperiment parametersExperiment) throws ExperimentExecutionException
inputs
and logs statistics about this to the file-systen.rootOutputter
- an outputter, bound to the base (root) output directory into which
outputed files are written.inputs
- the inputs to apply task
on.parametersExperiment
- parameters that exist pertaining to the experiment that is
underway.ExperimentExecutionException
- if anything goes wrong executing the experiment (but not
necessarily if a processing a particular input fails when suppressExceptions ==
true
.public void replaceTask(Task<T,S> taskToReplace) throws OperationFailedException
ReplaceTask
Task
with another.replaceTask
in interface ReplaceTask<T extends InputFromManager,S>
taskToReplace
- the task to replace.OperationFailedException
- if the task cannot be successfully replaced.public boolean isInputCompatibleWith(Class<? extends InputFromManager> inputClass)
inputClass
- a class describing the type of input, that is checked for compatibility.public boolean hasVeryQuickPerInputExecution()
protected abstract TaskStatistics execute(Outputter rootOutputter, List<T> inputs, ParametersExperiment parametersExperiment) throws ExperimentExecutionException
inputs
.
It is expected that elements are removed from inputs
as they are consumed so as to
allow garbage-collection of these items before all jobs are processed (as the list might be
quite large).
rootOutputter
- an outputter, bound to the base (root) output directory into which
outputted files are written.inputs
- the inputs to apply task
on.parametersExperiment
- parameters that exist pertaining to the experiment that is
underway.ExperimentExecutionException
- if anything goes wrong executing the experiment (but not
necessarily if a processing a particular input fails when suppressExceptions ==
true
.public boolean isSuppressExceptions()
This stops processing the affected input, but otherwise allows processing of other inputs to continue.
When false, an exception throw for a single input is immediately thrown, so all processing stops.
public void setSuppressExceptions(boolean suppressExceptions)
This stops processing the affected input, but otherwise allows processing of other inputs to continue.
When false, an exception throw for a single input is immediately thrown, so all processing stops.
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.