java.lang.Object
com.espertech.esper.common.internal.epl.join.assemble.BaseAssemblyNode
All Implemented Interfaces:
ResultAssembler
Direct Known Subclasses:
BranchOptionalAssemblyNode, BranchRequiredAssemblyNode, CartesianProdAssemblyNode, LeafAssemblyNode, RootCartProdAssemblyNode, RootOptionalAssemblyNode, RootRequiredAssemblyNode

public abstract class BaseAssemblyNode extends Object implements ResultAssembler
Represents a node in a tree responsible for assembling outer join query results.

The tree is double-linked, child nodes know each parent and parent know all child nodes.

Each specific subclass of this abstract assembly node is dedicated to assembling results for a certain event stream.

  • Field Details

    • parentNode

      protected ResultAssembler parentNode
      Parent node.
    • childNodes

      protected final List<BaseAssemblyNode> childNodes
      Child nodes.
    • streamNum

      protected final int streamNum
      Stream number.
    • numStreams

      protected final int numStreams
      Number of streams in statement.
  • Constructor Details

    • BaseAssemblyNode

      protected BaseAssemblyNode(int streamNum, int numStreams)
      Ctor.
      Parameters:
      streamNum - - stream number of the event stream that this node assembles results for.
      numStreams - - number of streams
  • Method Details

    • init

      public abstract void init(List<Node>[] result)
      Provides results to assembly nodes for initialization.
      Parameters:
      result - is a list of result nodes per stream
    • process

      public abstract void process(List<Node>[] result, Collection<EventBean[]> resultFinalRows, EventBean resultRootEvent)
      Process results.
      Parameters:
      result - is a list of result nodes per stream
      resultFinalRows - final row collection
      resultRootEvent - root event
    • print

      public abstract void print(IndentWriter indentWriter)
      Output this node using writer, not outputting child nodes.
      Parameters:
      indentWriter - to use for output
    • setParentAssembler

      public void setParentAssembler(ResultAssembler resultAssembler)
      Set parent node.
      Parameters:
      resultAssembler - is the parent node
    • addChild

      public void addChild(BaseAssemblyNode childNode)
      Add a child node.
      Parameters:
      childNode - to add
    • getStreamNum

      protected int getStreamNum()
      Returns the stream number.
      Returns:
      stream number
    • getChildNodes

      protected List<BaseAssemblyNode> getChildNodes()
      Returns child nodes.
      Returns:
      child nodes
    • getSubstreams

      protected int[] getSubstreams()
      Returns an array of stream numbers that lists all child node's stream numbers.
      Returns:
      child node stream numbers