public class NStreamOuterQueryPlanBuilder extends Object
Constructor and Description |
---|
NStreamOuterQueryPlanBuilder() |
Modifier and Type | Method and Description |
---|---|
protected static QueryPlan |
build(QueryGraph queryGraph,
OuterJoinDesc[] outerJoinDescList,
String[] streamNames,
EventType[] typesPerStream,
HistoricalViewableDesc historicalViewableDesc,
DependencyGraph dependencyGraph,
HistoricalStreamIndexList[] historicalStreamIndexLists,
ExprEvaluatorContext exprEvaluatorContext,
String[][][] indexedStreamsUniqueProps,
TableMetadata[] tablesPerStream,
EngineImportService engineImportService,
boolean isFireAndForget)
Build a query plan based on the stream property relationships indicated in queryGraph.
|
protected static OuterInnerDirectionalGraph |
graphOuterJoins(int numStreams,
OuterJoinDesc[] outerJoinDescList)
Builds a graph of outer joins given the outer join information from the statement.
|
static String |
print(Map<Integer,int[]> streamsJoinedPerStream)
Returns textual presentation of stream-substream relationships.
|
protected static void |
recursiveBuild(int streamNum,
Stack<Integer> streamCallStack,
QueryGraph queryGraph,
OuterInnerDirectionalGraph outerInnerGraph,
InnerJoinGraph innerJoinGraph,
Set<Integer> completedStreams,
LinkedHashMap<Integer,int[]> substreamsPerStream,
boolean[] requiredPerStream,
DependencyGraph dependencyGraph)
Recusivly builds a substream-per-stream ordered tree graph using the
join information supplied for outer joins and from the query graph (where clause).
|
protected static void |
recursiveBuildInnerJoin(int streamNum,
Stack<Integer> streamCallStack,
QueryGraph queryGraph,
Set<Integer> completedStreams,
LinkedHashMap<Integer,int[]> substreamsPerStream,
DependencyGraph dependencyGraph)
Recusivly builds a substream-per-stream ordered tree graph using the
join information supplied for outer joins and from the query graph (where clause).
|
static void |
verifyJoinedPerStream(int rootStream,
Map<Integer,int[]> streamsJoinedPerStream)
Verifies that the tree-like structure representing which streams join (lookup) into which sub-streams
is correct, ie.
|
protected static QueryPlan build(QueryGraph queryGraph, OuterJoinDesc[] outerJoinDescList, String[] streamNames, EventType[] typesPerStream, HistoricalViewableDesc historicalViewableDesc, DependencyGraph dependencyGraph, HistoricalStreamIndexList[] historicalStreamIndexLists, ExprEvaluatorContext exprEvaluatorContext, String[][][] indexedStreamsUniqueProps, TableMetadata[] tablesPerStream, EngineImportService engineImportService, boolean isFireAndForget) throws ExprValidationException
queryGraph
- - navigation info between streamsstreamNames
- - stream namesouterJoinDescList
- - descriptors for all outer joinstypesPerStream
- - event types for each streamdependencyGraph
- - dependencies between historical streamshistoricalStreamIndexLists
- - index management, populated for the query planexprEvaluatorContext
- context for expression evaluationhistoricalViewableDesc
- historicalsindexedStreamsUniqueProps
- unique propstablesPerStream
- tablesisFireAndForget
- fire-and-forget flagengineImportService
- engine importsExprValidationException
- if the query planning failedprotected static void recursiveBuild(int streamNum, Stack<Integer> streamCallStack, QueryGraph queryGraph, OuterInnerDirectionalGraph outerInnerGraph, InnerJoinGraph innerJoinGraph, Set<Integer> completedStreams, LinkedHashMap<Integer,int[]> substreamsPerStream, boolean[] requiredPerStream, DependencyGraph dependencyGraph) throws ExprValidationException
Required streams are considered first and their lookup is placed first in the list to gain performance.
streamNum
- is the root stream number that supplies the incoming event to build the tree forqueryGraph
- contains where-clause stream relationship infoouterInnerGraph
- contains the outer join stream relationship infocompletedStreams
- is a temporary holder for streams already consideredsubstreamsPerStream
- is the ordered, tree-like structure to be filledrequiredPerStream
- indicates which streams are required and which are optionalstreamCallStack
- the query plan call stack of streams available via cursordependencyGraph
- - dependencies between historical streamsinnerJoinGraph
- inner join graphExprValidationException
- if the query planning failedprotected static void recursiveBuildInnerJoin(int streamNum, Stack<Integer> streamCallStack, QueryGraph queryGraph, Set<Integer> completedStreams, LinkedHashMap<Integer,int[]> substreamsPerStream, DependencyGraph dependencyGraph) throws ExprValidationException
Required streams are considered first and their lookup is placed first in the list to gain performance.
streamNum
- is the root stream number that supplies the incoming event to build the tree forqueryGraph
- contains where-clause stream relationship infocompletedStreams
- is a temporary holder for streams already consideredsubstreamsPerStream
- is the ordered, tree-like structure to be filledstreamCallStack
- the query plan call stack of streams available via cursordependencyGraph
- - dependencies between historical streamsExprValidationException
- if the query planning failedprotected static OuterInnerDirectionalGraph graphOuterJoins(int numStreams, OuterJoinDesc[] outerJoinDescList)
numStreams
- - is the number of streamsouterJoinDescList
- - list of outer join stream numbers and property namespublic static void verifyJoinedPerStream(int rootStream, Map<Integer,int[]> streamsJoinedPerStream)
rootStream
- is the stream supplying the incoming eventstreamsJoinedPerStream
- is keyed by the from-stream number and contains as values all
stream numbers of lookup into to-streams.