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)
          Ctor.
 
Method Summary
 void addKeyedExpression(int indexedStream, java.lang.String indexedProp, int keyExprStream, ExprNode exprNodeNoIdent)
           
 void addRangeExpr(int indexedStream, java.lang.String indexedProp, ExprNode startNode, java.lang.Integer optionalStartStreamNum, ExprNode endNode, java.lang.Integer optionalEndStreamNum)
           
 void addRangeStrict(int streamNumStart, java.lang.String propertyStart, ExprIdentNode propertyStartExpr, int streamNumEnd, java.lang.String propertyEnd, ExprIdentNode propertyEndExpr, int streamNumValue, java.lang.String propertyValue, ExprIdentNode propertyValueExpr, boolean includeStart, boolean includeEnd, boolean isInverted)
           
 void addRelationalOp(int indexedStream, java.lang.String indexedProp, java.lang.Integer keyStreamNum, ExprNode exprNodeNoIdent, RelationalOpEnum relationalOpEnum)
           
 void addRelationalOpStrict(int streamIdLeft, java.lang.String propertyLeft, ExprNode propertyLeftExpr, int streamIdRight, java.lang.String propertyRight, ExprNode 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, java.lang.String 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)
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,
                           java.lang.String propertyStart,
                           ExprIdentNode propertyStartExpr,
                           int streamNumEnd,
                           java.lang.String propertyEnd,
                           ExprIdentNode propertyEndExpr,
                           int streamNumValue,
                           java.lang.String propertyValue,
                           ExprIdentNode propertyValueExpr,
                           boolean includeStart,
                           boolean includeEnd,
                           boolean isInverted)

addRelationalOpStrict

public void addRelationalOpStrict(int streamIdLeft,
                                  java.lang.String propertyLeft,
                                  ExprNode propertyLeftExpr,
                                  int streamIdRight,
                                  java.lang.String propertyRight,
                                  ExprNode propertyRightExpr,
                                  RelationalOpEnum relationalOpEnum)

addUnkeyedExpression

public void addUnkeyedExpression(int indexedStream,
                                 java.lang.String indexedProp,
                                 ExprNode exprNodeNoIdent)

addKeyedExpression

public void addKeyedExpression(int indexedStream,
                               java.lang.String indexedProp,
                               int keyExprStream,
                               ExprNode exprNodeNoIdent)

addRangeExpr

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

addRelationalOp

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

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