|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder
public class NStreamQueryPlanBuilder
Builds a query plan for 3 or more streams in a join.
Nested Class Summary | |
---|---|
static class |
NStreamQueryPlanBuilder.BestChainResult
Encapsulates the chain information. |
Constructor Summary | |
---|---|
NStreamQueryPlanBuilder()
|
Method Summary | |
---|---|
protected static QueryPlan |
build(QueryGraph queryGraph,
EventType[] typesPerStream,
HistoricalViewableDesc historicalViewableDesc,
DependencyGraph dependencyGraph,
HistoricalStreamIndexList[] historicalStreamIndexLists,
boolean hasForceNestedIter,
java.lang.String[][][] indexedStreamsUniqueProps,
TableMetadata[] tablesPerStream)
Build a query plan based on the stream property relationships indicated in queryGraph. |
protected static int[] |
buildDefaultNestingOrder(int numStreams,
int forStream)
Returns default nesting order for a given number of streams for a certain stream. |
protected static NStreamQueryPlanBuilder.BestChainResult |
computeBestPath(int lookupStream,
QueryGraph queryGraph,
DependencyGraph dependencyGraph)
Compute a best chain or path for lookups to take for the lookup stream passed in and the query property relationships. |
protected static int |
computeNavigableDepth(int lookupStream,
int[] nextStreams,
QueryGraph queryGraph)
Given a chain of streams to look up and indexing information, compute the index within the chain of the first non-index lookup. |
static TableLookupPlan |
createLookupPlan(QueryGraph queryGraph,
int currentLookupStream,
int indexedStream,
QueryPlanIndex indexSpecs,
EventType[] typesPerStream,
TableMetadata indexedStreamTableMeta)
Create the table lookup plan for a from-stream to look up in an indexed stream using the columns supplied in the query graph and looking at the actual indexes available and their index number. |
protected static QueryPlanNode |
createStreamPlan(int lookupStream,
int[] bestChain,
QueryGraph queryGraph,
QueryPlanIndex[] indexSpecsPerStream,
EventType[] typesPerStream,
boolean[] isHistorical,
HistoricalStreamIndexList[] historicalStreamIndexLists,
TableMetadata[] tablesPerStream)
Walks the chain of lookups and constructs lookup strategy and plan specification based on the index specifications. |
protected static boolean |
isDependencySatisfied(int lookupStream,
int[] permutation,
DependencyGraph dependencyGraph)
Determine if the proposed permutation of lookups passes dependencies |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NStreamQueryPlanBuilder()
Method Detail |
---|
protected static QueryPlan build(QueryGraph queryGraph, EventType[] typesPerStream, HistoricalViewableDesc historicalViewableDesc, DependencyGraph dependencyGraph, HistoricalStreamIndexList[] historicalStreamIndexLists, boolean hasForceNestedIter, java.lang.String[][][] indexedStreamsUniqueProps, TableMetadata[] tablesPerStream)
queryGraph
- - navigation info between streamstypesPerStream
- - event types for each streamdependencyGraph
- - dependencies between historical streamshistoricalStreamIndexLists
- - index management, populated for the query plan
protected static QueryPlanNode createStreamPlan(int lookupStream, int[] bestChain, QueryGraph queryGraph, QueryPlanIndex[] indexSpecsPerStream, EventType[] typesPerStream, boolean[] isHistorical, HistoricalStreamIndexList[] historicalStreamIndexLists, TableMetadata[] tablesPerStream)
lookupStream
- - the stream to construct the query plan forbestChain
- - the chain that the lookup follows to make best use of indexesqueryGraph
- - the repository for key properties to indexesindexSpecsPerStream
- - specifications of indexestypesPerStream
- - event types for each streamisHistorical
- - indicator for each stream if it is a historical streams or nothistoricalStreamIndexLists
- - index management, populated for the query plan
public static TableLookupPlan createLookupPlan(QueryGraph queryGraph, int currentLookupStream, int indexedStream, QueryPlanIndex indexSpecs, EventType[] typesPerStream, TableMetadata indexedStreamTableMeta)
queryGraph
- - contains properties joining the 2 streamscurrentLookupStream
- - stream to use key values fromindexedStream
- - stream to look up inindexSpecs
- - index specification defining indexes to be created for streamtypesPerStream
- - event types for each stream
protected static NStreamQueryPlanBuilder.BestChainResult computeBestPath(int lookupStream, QueryGraph queryGraph, DependencyGraph dependencyGraph)
NumberSetPermutationEnumeration
until a path is found in which all streams can be accessed via an index.
If not such path is found, the method returns the path with the greatest depth, ie. where
the first one or more streams are index accesses.
If no depth other then zero is found, returns the default nesting order.
lookupStream
- - stream to start look upqueryGraph
- - navigability between streamsdependencyGraph
- - dependencies between historical streams
protected static boolean isDependencySatisfied(int lookupStream, int[] permutation, DependencyGraph dependencyGraph)
lookupStream
- stream to initiatepermutation
- permutation of lookupsdependencyGraph
- dependencies
protected static int computeNavigableDepth(int lookupStream, int[] nextStreams, QueryGraph queryGraph)
lookupStream
- - stream to start lookup fornextStreams
- - list of stream numbers next in lookupqueryGraph
- - indexing information
protected static int[] buildDefaultNestingOrder(int numStreams, int forStream)
numStreams
- - number of streamsforStream
- - stream to generate a nesting order for
|
© 2006-2016 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |