com.espertech.esper.epl.join.plan
Class QueryGraph

java.lang.Object
  extended by com.espertech.esper.epl.join.plan.QueryGraph

public class QueryGraph
extends java.lang.Object

Model of relationships between streams based on properties in both streams that are specified as equal in a filter expression.


Constructor Summary
QueryGraph(int numStreams, ExcludePlanHint optionalHint, boolean nToZeroAnalysis)
          Ctor.
 
Method Summary
 void addInSetMultiIndex(int testStreamNum, ExprNode testPropExpr, int setStreamNum, ExprNode[] setPropExpr)
           
 void addInSetMultiIndexUnkeyed(ExprNode testPropExpr, int setStreamNum, ExprNode[] setPropExpr)
           
 void addInSetSingleIndex(int testStreamNum, ExprNode testPropExpr, int setStreamNum, ExprNode[] setPropExpr)
           
 void addInSetSingleIndexUnkeyed(int testStreamNum, ExprNode testPropExpr, ExprNode[] setPropExpr)
           
 void addKeyedExpression(int indexedStream, ExprIdentNode indexedProp, int keyExprStream, ExprNode exprNodeNoIdent)
           
 void addRangeExpr(int indexedStream, ExprIdentNode indexedProp, ExprNode startNode, java.lang.Integer optionalStartStreamNum, ExprNode endNode, java.lang.Integer optionalEndStreamNum)
           
 void addRangeStrict(int streamNumStart, ExprIdentNode propertyStartExpr, int streamNumEnd, ExprIdentNode propertyEndExpr, int streamNumValue, ExprIdentNode propertyValueExpr, boolean includeStart, boolean includeEnd, boolean isInverted)
           
 void addRelationalOp(int indexedStream, ExprIdentNode indexedProp, java.lang.Integer keyStreamNum, ExprNode exprNodeNoIdent, RelationalOpEnum relationalOpEnum)
           
 void addRelationalOpStrict(int streamIdLeft, ExprIdentNode propertyLeftExpr, int streamIdRight, ExprIdentNode propertyRightExpr, RelationalOpEnum relationalOpEnum)
           
 boolean addStrictEquals(int streamLeft, java.lang.String propertyLeft, ExprIdentNode nodeLeft, int streamRight, java.lang.String propertyRight, ExprIdentNode nodeRight)
          Add properties for 2 streams that are equal.
 void addUnkeyedExpression(int indexedStream, ExprIdentNode indexedProp, ExprNode exprNodeNoIdent)
           
static void fillEquivalentNav(EventType[] typesPerStream, QueryGraph queryGraph)
          Fill in equivalent key properties (navigation entries) on all streams.
 QueryGraphValue getGraphValue(int streamLookup, int streamIndexed)
           
 java.util.Set<java.lang.Integer> getNavigableStreams(int streamFrom)
          Returns set of streams that the given stream is navigable to.
 int getNumStreams()
          Returns the number of streams.
 boolean isNavigableAtAll(int streamFrom, int streamTo)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryGraph

public QueryGraph(int numStreams,
                  ExcludePlanHint optionalHint,
                  boolean nToZeroAnalysis)
Ctor.

Parameters:
numStreams - - number of streams
Method Detail

getNumStreams

public int getNumStreams()
Returns the number of streams.

Returns:
number of streams

addStrictEquals

public boolean addStrictEquals(int streamLeft,
                               java.lang.String propertyLeft,
                               ExprIdentNode nodeLeft,
                               int streamRight,
                               java.lang.String propertyRight,
                               ExprIdentNode nodeRight)
Add properties for 2 streams that are equal.

Parameters:
streamLeft - - left hand stream
propertyLeft - - left hand stream property
streamRight - - right hand stream
propertyRight - - right hand stream property
Returns:
true if added and did not exist, false if already known

isNavigableAtAll

public boolean isNavigableAtAll(int streamFrom,
                                int streamTo)

getNavigableStreams

public java.util.Set<java.lang.Integer> getNavigableStreams(int streamFrom)
Returns set of streams that the given stream is navigable to.

Parameters:
streamFrom - - from stream number
Returns:
set of streams related to this stream, or empty set if none

getGraphValue

public QueryGraphValue getGraphValue(int streamLookup,
                                     int streamIndexed)

fillEquivalentNav

public static void fillEquivalentNav(EventType[] typesPerStream,
                                     QueryGraph queryGraph)
Fill in equivalent key properties (navigation entries) on all streams. For example, if a=b and b=c then addRelOpInternal a=c. The method adds new equalivalent key properties until no additional entries to be added are found, ie. several passes can be made.

Parameters:
queryGraph - - navigablity info between streamss

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addRangeStrict

public void addRangeStrict(int streamNumStart,
                           ExprIdentNode propertyStartExpr,
                           int streamNumEnd,
                           ExprIdentNode propertyEndExpr,
                           int streamNumValue,
                           ExprIdentNode propertyValueExpr,
                           boolean includeStart,
                           boolean includeEnd,
                           boolean isInverted)

addRelationalOpStrict

public void addRelationalOpStrict(int streamIdLeft,
                                  ExprIdentNode propertyLeftExpr,
                                  int streamIdRight,
                                  ExprIdentNode propertyRightExpr,
                                  RelationalOpEnum relationalOpEnum)

addUnkeyedExpression

public void addUnkeyedExpression(int indexedStream,
                                 ExprIdentNode indexedProp,
                                 ExprNode exprNodeNoIdent)

addKeyedExpression

public void addKeyedExpression(int indexedStream,
                               ExprIdentNode indexedProp,
                               int keyExprStream,
                               ExprNode exprNodeNoIdent)

addRangeExpr

public void addRangeExpr(int indexedStream,
                         ExprIdentNode indexedProp,
                         ExprNode startNode,
                         java.lang.Integer optionalStartStreamNum,
                         ExprNode endNode,
                         java.lang.Integer optionalEndStreamNum)

addRelationalOp

public void addRelationalOp(int indexedStream,
                            ExprIdentNode indexedProp,
                            java.lang.Integer keyStreamNum,
                            ExprNode exprNodeNoIdent,
                            RelationalOpEnum relationalOpEnum)

addInSetSingleIndex

public void addInSetSingleIndex(int testStreamNum,
                                ExprNode testPropExpr,
                                int setStreamNum,
                                ExprNode[] setPropExpr)

addInSetSingleIndexUnkeyed

public void addInSetSingleIndexUnkeyed(int testStreamNum,
                                       ExprNode testPropExpr,
                                       ExprNode[] setPropExpr)

addInSetMultiIndex

public void addInSetMultiIndex(int testStreamNum,
                               ExprNode testPropExpr,
                               int setStreamNum,
                               ExprNode[] setPropExpr)

addInSetMultiIndexUnkeyed

public void addInSetMultiIndexUnkeyed(ExprNode testPropExpr,
                                      int setStreamNum,
                                      ExprNode[] setPropExpr)

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