Class ChildPipelineBuilder

java.lang.Object
nz.org.riskscape.engine.steps.ChildPipelineBuilder

public class ChildPipelineBuilder extends Object

Helper class for realizing a child pipeline that gets 'smooshed' back in to a parent as part of realizing a step

  • Constructor Summary

    Constructors
    Constructor
    Description
    ChildPipelineBuilder(nz.org.riskscape.engine.pipeline.RealizationInput input, nz.org.riskscape.rl.ast.PipelineDeclaration childAst)
    Constructs a new ChildPipelineBuilder for realizing and integrating a child pipeline into a parent pipeline.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addInputStep(nz.org.riskscape.engine.pipeline.RealizedStep stepFromParent, String stubName)
    Adds an input step from the parent pipeline into the child pipeline by creating a stub step.
    nz.org.riskscape.engine.pipeline.RealizedPipeline
    addWellKnownOutput(nz.org.riskscape.engine.pipeline.RealizedStep outputStep, List<nz.org.riskscape.problem.Problem> warnings)
    Adds a step to the combined pipeline named after the input's prototype step (so will have the expected name) for any dependencies that are chained to this step.
    protected boolean
     
    nz.org.riskscape.engine.pipeline.RealizedPipeline
    Combines the realized child pipeline back into the parent pipeline.
    boolean
     
    nz.org.riskscape.engine.pipeline.RealizedPipeline
     
    nz.org.riskscape.rl.ast.PipelineDeclaration
     
    nz.org.riskscape.engine.pipeline.RealizedStep
    getChildInputStep(nz.org.riskscape.engine.pipeline.RealizedStep originalInputStep)
    Retrieves the stub step that was created in the child pipeline for a given parent input step.
     
    nz.org.riskscape.engine.pipeline.RealizedPipeline
     
    nz.org.riskscape.engine.pipeline.RealizationInput
     
    Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep>
     
    nz.org.riskscape.engine.pipeline.RealizedPipeline
     
    Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep>
     
    nz.org.riskscape.engine.pipeline.RealizedStep
    getRebuiltStep(nz.org.riskscape.engine.pipeline.RealizedStep childStep)
     
    nz.org.riskscape.engine.steps.ChildPipelineBuilder.State
     
    int
     
    boolean
     
    nz.org.riskscape.engine.pipeline.RealizedPipeline
    Realizes the child pipeline using the configured AST and input steps.
    void
    setBuilding(nz.org.riskscape.engine.pipeline.RealizedPipeline building)
     
    void
    setChildStepPrefix(String childStepPrefix)
     
    void
    setCombined(nz.org.riskscape.engine.pipeline.RealizedPipeline combined)
     
    void
    setRebuilt(Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep> rebuilt)
     
    void
    setState(nz.org.riskscape.engine.steps.ChildPipelineBuilder.State state)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChildPipelineBuilder

      public ChildPipelineBuilder(nz.org.riskscape.engine.pipeline.RealizationInput input, nz.org.riskscape.rl.ast.PipelineDeclaration childAst)

      Constructs a new ChildPipelineBuilder for realizing and integrating a child pipeline into a parent pipeline.

      Parameters:
      input - the realization input containing the parent pipeline and context
      childAst - the AST declaration of the child pipeline to be realized
  • Method Details

    • addInputStep

      public void addInputStep(nz.org.riskscape.engine.pipeline.RealizedStep stepFromParent, String stubName)

      Adds an input step from the parent pipeline into the child pipeline by creating a stub step. The stub step mirrors the parent step's output schema but won't be executed during child pipeline realization.

      Parameters:
      stepFromParent - the realized step from the parent pipeline to use as input
      stubName - the name to give the stub step in the child pipeline - this is how the child pipeline will refer to it
    • getChildInputStep

      public nz.org.riskscape.engine.pipeline.RealizedStep getChildInputStep(nz.org.riskscape.engine.pipeline.RealizedStep originalInputStep)

      Retrieves the stub step that was created in the child pipeline for a given parent input step.

      Parameters:
      originalInputStep - the original step from the parent pipeline
      Returns:
      the corresponding stub step in the child pipeline, or null if not found
    • realizeChild

      public nz.org.riskscape.engine.pipeline.RealizedPipeline realizeChild()

      Realizes the child pipeline using the configured AST and input steps. This method must be called after all input steps have been added via addInputStep(nz.org.riskscape.engine.pipeline.RealizedStep, java.lang.String).

      Returns:
      the realized child pipeline, which may contain failures if realization encountered problems
    • combine

      public nz.org.riskscape.engine.pipeline.RealizedPipeline combine()

      Combines the realized child pipeline back into the parent pipeline.

      If the child pipeline failed to realize, a failure step is added to the resulting pipeline to represent those errors

      All child steps are prefixed with the parent step name to ensure unique naming.

      Returns:
      the combined pipeline containing both parent and child steps
    • addWellKnownOutput

      public nz.org.riskscape.engine.pipeline.RealizedPipeline addWellKnownOutput(nz.org.riskscape.engine.pipeline.RealizedStep outputStep, List<nz.org.riskscape.problem.Problem> warnings)

      Adds a step to the combined pipeline named after the input's prototype step (so will have the expected name) for any dependencies that are chained to this step.

    • getCombined

      public nz.org.riskscape.engine.pipeline.RealizedPipeline getCombined()
    • isChildFailed

      public boolean isChildFailed()
      Returns:
      true if the child pipeline has failures.
    • getRebuiltStep

      public nz.org.riskscape.engine.pipeline.RealizedStep getRebuiltStep(nz.org.riskscape.engine.pipeline.RealizedStep childStep)
      Returns:
      the step in combined pipeline that was rebuilt for the child step, i.e. it is the child step, but renamed and in the combined pipeline
    • getState

      public nz.org.riskscape.engine.steps.ChildPipelineBuilder.State getState()
    • getInput

      public nz.org.riskscape.engine.pipeline.RealizationInput getInput()
    • getParent

      public nz.org.riskscape.engine.pipeline.RealizedPipeline getParent()
    • getChildAst

      public nz.org.riskscape.rl.ast.PipelineDeclaration getChildAst()
    • getInputSteps

      public Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep> getInputSteps()
    • getRebuilt

      public Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep> getRebuilt()
    • getBuilding

      public nz.org.riskscape.engine.pipeline.RealizedPipeline getBuilding()
    • setState

      public void setState(nz.org.riskscape.engine.steps.ChildPipelineBuilder.State state)
    • setRebuilt

      public void setRebuilt(Map<nz.org.riskscape.engine.pipeline.RealizedStep,nz.org.riskscape.engine.pipeline.RealizedStep> rebuilt)
    • setBuilding

      public void setBuilding(nz.org.riskscape.engine.pipeline.RealizedPipeline building)
    • setCombined

      public void setCombined(nz.org.riskscape.engine.pipeline.RealizedPipeline combined)
    • setChildStepPrefix

      public void setChildStepPrefix(String childStepPrefix)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getChildStepPrefix

      public String getChildStepPrefix()