java.lang.Object
com.espertech.esper.common.internal.epl.join.querygraph.QueryGraphForge

public class QueryGraphForge extends Object
Model of relationships between streams based on properties in both streams that are specified as equal in a filter expression.
  • Field Details

  • Constructor Details

    • QueryGraphForge

      public QueryGraphForge(int numStreams, ExcludePlanHint optionalHint, boolean nToZeroAnalysis)
      Ctor.
      Parameters:
      numStreams - - number of streams
      optionalHint - hint if any
      nToZeroAnalysis - indicator for star-eval
  • Method Details

    • getNumStreams

      public int getNumStreams()
      Returns the number of streams.
      Returns:
      number of streams
    • addStrictEquals

      public boolean addStrictEquals(int streamLeft, String propertyLeft, ExprIdentNode nodeLeft, int streamRight, 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
      nodeLeft - left expr
      nodeRight - right expr
      Returns:
      true if added and did not exist, false if already known
    • isNavigableAtAll

      public boolean isNavigableAtAll(int streamFrom, int streamTo)
    • getNavigableStreams

      public Set<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 QueryGraphValueForge getGraphValue(int streamLookup, int streamIndexed)
    • fillEquivalentNav

      public static void fillEquivalentNav(EventType[] typesPerStream, QueryGraphForge 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
      typesPerStream - type info
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addRangeStrict

      public void addRangeStrict(int streamNumStart, ExprIdentNode propertyStartExpr, int streamNumEnd, ExprIdentNode propertyEndExpr, int streamNumValue, ExprIdentNode propertyValueExpr, QueryGraphRangeEnum rangeOp)
    • 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, Integer optionalStartStreamNum, ExprNode endNode, Integer optionalEndStreamNum, QueryGraphRangeEnum rangeOp)
    • addRelationalOp

      public void addRelationalOp(int indexedStream, ExprIdentNode indexedProp, 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)
    • addCustomIndex

      public void addCustomIndex(String operationName, ExprNode[] indexExpressions, List<Pair<ExprNode,int[]>> streamKeys, int streamValue)
    • make

      public CodegenExpression make(CodegenMethod method, SAIFFInitializeSymbol symbols, CodegenClassScope classScope)