Class Pipeline
A user-configurable data processing pipeline for performing hazard analysis. A pipeline gives the basic shape of some possible data transformation and computation, with parameters for adjusting the specifics of the modeling, such as setting the source data, filtering and output options.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge with the given parameters to the pipeline.addParameter
(String paramKey, Object paramValue) Add a parameter value to parameters.addParameter
(NamedStep step, String paramName, Object paramValue) Convenience version ofthat will construct the parameterKey to be <step-name>.<paramName></p>
protected boolean
clone()
static Pipeline
empty()
boolean
getAst()
The AST that this pipeline was built from.getDependencies
(@NonNull NamedStep step) Get a list of dependencies that are required to provide the input(s) to step in the same order as the inputs are defined in step parameters.getEdges()
getEdgesFrom
(@NonNull NamedStep fromStep) getEdgesTo
(@NonNull NamedStep toStep) getParameter
(String key) getSteps()
Unbound parameters, can be set with pipeline default values.int
hashCode()
boolean
setParameter
(String paramKey, List<?> paramValues) Sets the parameter values, discarding any values that already existed for that parameter.setParameter
(NamedStep step, String paramName, List<?> paramValues) Convenience version ofthat will construct the parameterKey to be <step-name>.<paramName></p>
static Pipeline
Create a pipeline with the given ast as metadata - it won't necessarily have been built from the ast yet.<T> List<T>
visit
(BiFunction<NamedStep, List<T>, T> visitor) Visit all steps in the DAG in dependency order.
-
Field Details
-
NO_DESCRIPTION
- See Also:
-
START
-
-
Constructor Details
-
Pipeline
-
-
Method Details
-
usingAst
Create a pipeline with the given ast as metadata - it won't necessarily have been built from the ast yet.
-
empty
-
addEdge
-
addEdge
-
addEdge
-
addEdge
-
addEdge
-
addEdge
-
addEdge
-
addEdge
public Pipeline addEdge(@NonNull @NonNull NamedStep from, @NonNull @NonNull NamedStep to, @NonNull @NonNull Optional<String> namedInput) throws PipelineDefinitionException Adds an edge with the given parameters to the pipeline. In terms of pipeline execution, this will mean data will move from the
from
step to theto
step. If a named input is given, data will move to this named input in particular. SeeStep.getInputNames()
for more infprmation about named inputs.- Parameters:
from
- a named step that may or may not already exist in this pipeline.to
- a named step taht may or may not already exist in this pipeline.namedInput
- an optional named input to target with this edge. Some steps declare named inputs, which tend to have a particular purpose. This needs to be present if the target step declares named inputs (NamedStep.requiresNamedInputs()
will return true).- Returns:
- this pipeline, for fluid builder-style use
- Throws:
PipelineDefinitionException
- if adding this edge would invalidate the pipeline
-
addStep
-
addStep
-
getStep
-
getEdgesFrom
-
getEdgesTo
-
getSteps
-
getDependencies
Get a list of dependencies that are required to provide the input(s) to step in the same order as the inputs are defined in step parameters.
- Parameters:
step
- to get dependencies of- Returns:
- dependencies in input order
-
getEdges
-
getParameterNames
-
getParameters
-
addParameter
Convenience version of
that will construct the parameterKey to be <step-name>.<paramName></p>
-
addParameter
Add a parameter value to parameters.
If the parameter map already contains an entry for this parameter then paramValue is appended to the value list. Otherwise a new list is inserted containing only paramValue.
- Parameters:
paramKey
- fully qualified parameter keyparamValue
- parameter value- Returns:
- pipeline
-
setParameter
Convenience version of
that will construct the parameterKey to be <step-name>.<paramName></p>
-
setParameter
Sets the parameter values, discarding any values that already existed for that parameter.
- Parameters:
paramKey
- fully qualified parameter keyparamValues
- values to set- Returns:
- pipeline
-
visit
Visit all steps in the DAG in dependency order.
- Parameters:
visitor
- a function that gets given all the steps, along with any built things from dependent steps- Returns:
- a list of all the elements returned from the visitor function, in the order they were created
- Throws:
PipelineCycleException
- if the pipeline contains a cycle - this will be picked up before the visitor is called
-
clone
-
addAll
-
getParameter
-
hasStep
- Returns:
- true if the pipeline contains a step with the given name
-
getStepsRequiringInput
-
getStartSteps
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getAst
The AST that this pipeline was built from.
-
getUnboundParameters
Unbound parameters, can be set with pipeline default values.
-