T
- input-object typeS
- shared-state typepublic abstract class Task<T extends InputFromManager,S> extends AnchorBean<Task<T,S>>
A shared-state is created which is then available as common state across all inputs. We
avoid remembering state on a field in Task
itself, so that the Task
itself can be
freely duplicated across nodes when parallelizing processing.
Initially ParametersUnbound
are created as task-wide parameters across inputs, whereas
InputBound
are created in a further step, specific to each input.
e.g. we move from a logger for the experiment as a whole in ParametersUnbound
, to a
logger for the task itself in InputBound
.
The following outputs are produced, and depending on parameterization, written to the file-system:
Output Name | Default? | Description |
---|---|---|
outputs from InputOutputExperiment . |
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
abstract void |
afterAllJobsAreExecuted(S sharedState,
InputOutputContext context)
Called once after all calls to
executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>) . |
abstract S |
beforeAnyJobIsExecuted(Outputter outputter,
ConcurrencyPlan concurrencyPlan,
List<T> inputs,
ParametersExperiment parameters)
Called once before all calls to
executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>) . |
OutputEnabledMutable |
defaultOutputs()
If specified, default rules for determine which outputs are enabled or not.
|
abstract void |
doJobOnInput(InputBound<T,S> input)
Performs the task on a particular input.
|
boolean |
executeJob(ParametersUnbound<T,S> parametersUnbound)
Runs the task on one particular input (a job).
|
abstract boolean |
hasVeryQuickPerInputExecution()
Is the execution-time of the task per-input expected to be very quick to execute?
|
abstract InputTypesExpected |
inputTypesExpected()
Highest class(es) that will function as a valid input.
|
boolean |
isInputCompatibleWith(Class<? extends InputFromManager> inputClass)
Is an input-object type compatible with this particular task?
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public abstract boolean hasVeryQuickPerInputExecution()
public abstract S beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<T> inputs, ParametersExperiment parameters) throws ExperimentExecutionException
executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.outputter
- the output-manager for the experiment (not for an individual job)concurrencyPlan
- available numbers of processors that can call executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
inputs
- a list of inputs, each will result in at least one call to executeJob(ParametersUnbound)
.parameters
- the experiment-parameters.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
and to afterAllJobsAreExecuted(S, org.anchoranalysis.io.output.outputter.InputOutputContext)
.ExperimentExecutionException
- if a fatal error occurs executing this step of the
experiment.public boolean executeJob(ParametersUnbound<T,S> parametersUnbound) throws JobExecutionException
parametersUnbound
- parameters for the input (unbound to any output location).JobExecutionException
- if anything goes wrong with the job which is not logged.public abstract void afterAllJobsAreExecuted(S sharedState, InputOutputContext context) throws ExperimentExecutionException
executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.sharedState
- the shared-statecontext
- IO-context for experiment (not for an individual job)ExperimentExecutionException
- if a fatal error occurs executing this step of the
experiment.public boolean isInputCompatibleWith(Class<? extends InputFromManager> inputClass)
inputClass
- the class of the input-object type to be queried.public abstract InputTypesExpected inputTypesExpected()
This is usually the class of T (or sometimes the absolute base class InputFromManager).
public abstract void doJobOnInput(InputBound<T,S> input) throws JobExecutionException
input
- the input for the job.JobExecutionException
- if an error occurs executing a particular job, that is not
otherwise suppressed.public OutputEnabledMutable defaultOutputs()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.