com.espertech.esper.epl.join.assemble
Class RootCartProdAssemblyNode

java.lang.Object
  extended by com.espertech.esper.epl.join.assemble.BaseAssemblyNode
      extended by com.espertech.esper.epl.join.assemble.RootCartProdAssemblyNode
All Implemented Interfaces:
ResultAssembler

public class RootCartProdAssemblyNode
extends BaseAssemblyNode

Assembly node for an event stream that is a root with a two or more child nodes below it.


Field Summary
 
Fields inherited from class com.espertech.esper.epl.join.assemble.BaseAssemblyNode
childNodes, numStreams, parentNode, streamNum
 
Constructor Summary
RootCartProdAssemblyNode(int streamNum, int numStreams, boolean allSubStreamsOptional, int[] childStreamIndex)
          Ctor.
 
Method Summary
protected static int[][] computeCombined(int[][] subStreamsPerChild)
          Compute an array of supersets of sub stream numbers per stream, for at least 3 or more streams.
 void init(java.util.List<Node>[] result)
          Provides results to assembly nodes for initialization.
 void print(IndentWriter indentWriter)
          Output this node using writer, not outputting child nodes.
 void process(java.util.List<Node>[] result, java.util.Collection<EventBean[]> resultFinalRows, EventBean resultRootEvent)
          Process results.
 void result(EventBean[] row, int fromStreamNum, EventBean myEvent, Node myNode, java.util.Collection<EventBean[]> resultFinalRows, EventBean resultRootEvent)
          Publish a result row.
 
Methods inherited from class com.espertech.esper.epl.join.assemble.BaseAssemblyNode
addChild, getChildNodes, getStreamNum, getSubstreams, setParentAssembler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootCartProdAssemblyNode

public RootCartProdAssemblyNode(int streamNum,
                                int numStreams,
                                boolean allSubStreamsOptional,
                                int[] childStreamIndex)
Ctor.

Parameters:
streamNum - - is the stream number
numStreams - - is the number of streams
allSubStreamsOptional - - true if all substreams are optional and none are required
Method Detail

init

public void init(java.util.List<Node>[] result)
Description copied from class: BaseAssemblyNode
Provides results to assembly nodes for initialization.

Specified by:
init in class BaseAssemblyNode
Parameters:
result - is a list of result nodes per stream

process

public void process(java.util.List<Node>[] result,
                    java.util.Collection<EventBean[]> resultFinalRows,
                    EventBean resultRootEvent)
Description copied from class: BaseAssemblyNode
Process results.

Specified by:
process in class BaseAssemblyNode
Parameters:
result - is a list of result nodes per stream

result

public void result(EventBean[] row,
                   int fromStreamNum,
                   EventBean myEvent,
                   Node myNode,
                   java.util.Collection<EventBean[]> resultFinalRows,
                   EventBean resultRootEvent)
Description copied from interface: ResultAssembler
Publish a result row.

Parameters:
row - is the result to publish
fromStreamNum - is the originitor that publishes the row
myEvent - is optional and is the event that led to the row result
myNode - is optional and is the result node of the event that led to the row result
resultFinalRows - is the final result rows

print

public void print(IndentWriter indentWriter)
Description copied from class: BaseAssemblyNode
Output this node using writer, not outputting child nodes.

Specified by:
print in class BaseAssemblyNode
Parameters:
indentWriter - to use for output

computeCombined

protected static int[][] computeCombined(int[][] subStreamsPerChild)
Compute an array of supersets of sub stream numbers per stream, for at least 3 or more streams.

Parameters:
subStreamsPerChild - is for each stream number a list of direct child sub streams
Returns:
an array in with length (subStreamsPerChild.lenght - 2) in which array[0] contains the streams for subStreamsPerChild[0] and subStreamsPerChild[1] combined, and array[1] contains the streams for subStreamsPerChild[0], subStreamsPerChild[1] and subStreamsPerChild[2] combined

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com