Class SubplanPattern

java.lang.Object
org.apache.wayang.core.plan.wayangplan.OperatorBase
org.apache.wayang.core.mapping.SubplanPattern
All Implemented Interfaces:
Serializable, Operator

public class SubplanPattern extends OperatorBase
A subplan pattern describes a class of subplans in a WayangPlan.

NB: Currently, only such patterns are tested and supported that form a chain of operators, i.e., no DAGs are allowed and at most one input and one output operator.

See Also:
  • Method Details

    • createSingleton

      public static final SubplanPattern createSingleton(OperatorPattern operatorPattern)
      Creates a new instance that matches only a single operator.
      Parameters:
      operatorPattern - the only operator pattern
      Returns:
      the new instance
    • fromOperatorPatterns

      public static final SubplanPattern fromOperatorPatterns(OperatorPattern inputOperatorPattern, OperatorPattern outputOperatorPattern)
      Creates a new instance that matches a graph of operator patterns.
      Parameters:
      inputOperatorPattern - the only operator pattern that has inputs wrt. the subplan pattern
      outputOperatorPattern - the only operator pattern that has outputs wrt. the subplan pattern
      Returns:
      the new instance
    • match

      public List<SubplanMatch> match(WayangPlan plan, int minEpoch)
      Match this pattern against a plan.
      Parameters:
      plan - the plan to match against
      minEpoch - the (inclusive) minimum epoch value for matched subplans
      Returns:
      all matches
    • getInputPattern

      public OperatorPattern getInputPattern()
    • getOutputPattern

      public OperatorPattern getOutputPattern()
    • accept

      public <Payload, Return> Return accept(TopDownPlanVisitor<Payload,Return> visitor, OutputSlot<?> outputSlot, Payload payload)
      Description copied from interface: Operator
      This method is part of the visitor pattern and calls the appropriate visit method on visitor.
      Specified by:
      accept in interface Operator
      Overrides:
      accept in class OperatorBase