/// <summary> /// Constructs the executable from the plan. /// </summary> /// <param name="statementName">statement name</param> /// <param name="statementId">statement id</param> /// <param name="annotations">annotations</param> /// <param name="indexesPerStream">is the index objects for use in lookups</param> /// <param name="streamTypes">is the types of each stream</param> /// <param name="streamViews">the viewable representing each stream</param> /// <param name="historicalStreamIndexLists">index management for historical streams @return executable instruction</param> /// <param name="viewExternal">virtual data window</param> /// <returns>instruction exec</returns> public LookupInstructionExec MakeExec( string statementName, int statementId, Attribute[] annotations, IDictionary <TableLookupIndexReqKey, EventTable>[] indexesPerStream, EventType[] streamTypes, Viewable[] streamViews, HistoricalStreamIndexList[] historicalStreamIndexLists, VirtualDWView[] viewExternal) { var strategies = new JoinExecTableLookupStrategy[LookupPlans.Length]; for (int i = 0; i < LookupPlans.Length; i++) { if (LookupPlans[i] != null) { strategies[i] = LookupPlans[i].MakeStrategy( statementName, statementId, annotations, indexesPerStream, streamTypes, viewExternal); } else { strategies[i] = HistoricalPlans[i].MakeOuterJoinStategy( streamViews, FromStream, historicalStreamIndexLists); } } return(new LookupInstructionExec(FromStream, FromStreamName, ToStreams, strategies, RequiredPerStream)); }
/// <summary> /// Ctor. /// </summary> /// <param name="indexedStream">stream indexed for lookup</param> /// <param name="lookupStrategy">strategy to use for lookup (full table/indexed)</param> public TableOuterLookupExecNode( int indexedStream, JoinExecTableLookupStrategy lookupStrategy) { IndexedStream = indexedStream; this.lookupStrategy = lookupStrategy; }
public TableOuterLookupExecNodeTableLocking( int indexedStream, JoinExecTableLookupStrategy lookupStrategy, ILockable @lock) : base(indexedStream, lookupStrategy) { this.@lock = @lock; }
public override ExecNode MakeExec(string statementName, int statementId, Attribute[] annotations, IDictionary <TableLookupIndexReqKey, EventTable>[] indexesPerStream, EventType[] streamTypes, Viewable[] streamViews, HistoricalStreamIndexList[] historicalStreamIndexLists, VirtualDWView[] viewExternal, ILockable[] tableSecondaryIndexLocks) { JoinExecTableLookupStrategy lookupStrategy = _tableLookupPlan.MakeStrategy(statementName, statementId, annotations, indexesPerStream, streamTypes, viewExternal); int indexedStream = _tableLookupPlan.IndexedStream; if (tableSecondaryIndexLocks[indexedStream] != null) { return(new TableLookupExecNodeTableLocking(indexedStream, lookupStrategy, tableSecondaryIndexLocks[indexedStream])); } return(new TableLookupExecNode(indexedStream, lookupStrategy)); }
public void TestLookup() { FullTableScanLookupPlan spec = new FullTableScanLookupPlan(0, 1, new TableLookupIndexReqKey("idx2")); IDictionary <TableLookupIndexReqKey, EventTable>[] indexes = new IDictionary <TableLookupIndexReqKey, EventTable> [2]; indexes[0] = new Dictionary <TableLookupIndexReqKey, EventTable>(); indexes[1] = new Dictionary <TableLookupIndexReqKey, EventTable>(); indexes[1].Put(new TableLookupIndexReqKey("idx2"), _unindexedEventIndex); JoinExecTableLookupStrategy lookupStrategy = spec.MakeStrategy("ABC", "001", null, indexes, null, new VirtualDWView[2]); FullTableScanLookupStrategy strategy = (FullTableScanLookupStrategy)lookupStrategy; Assert.AreEqual(_unindexedEventIndex, strategy.EventIndex); }
public LookupInstructionExec MakeExec( AgentInstanceContext agentInstanceContext, IDictionary<TableLookupIndexReqKey, EventTable>[] indexesPerStream, EventType[] streamTypes, Viewable[] streamViews, VirtualDWView[] viewExternal) { var strategies = new JoinExecTableLookupStrategy[LookupPlans.Length]; for (var i = 0; i < LookupPlans.Length; i++) { if (LookupPlans[i] != null) { strategies[i] = LookupPlans[i] .MakeStrategy(agentInstanceContext, indexesPerStream, streamTypes, viewExternal); } else { strategies[i] = historicalPlans[i].MakeOuterJoinStategy(streamViews); } } return new LookupInstructionExec(FromStream, FromStreamName, ToStreams, strategies, RequiredPerStream); }
public void TestLookup() { List <QueryGraphValueEntryHashKeyed> keys = new List <QueryGraphValueEntryHashKeyed>(); keys.Add(new QueryGraphValueEntryHashKeyedProp(new ExprIdentNodeImpl(_types[0], "IntBoxed", 0), "IntBoxed")); IndexedTableLookupPlanMulti spec = new IndexedTableLookupPlanMulti(0, 1, new TableLookupIndexReqKey("idx1"), keys); IDictionary <TableLookupIndexReqKey, EventTable>[] indexes = new IDictionary <TableLookupIndexReqKey, EventTable> [2]; indexes[0] = new Dictionary <TableLookupIndexReqKey, EventTable>(); indexes[1] = new Dictionary <TableLookupIndexReqKey, EventTable>(); indexes[1][new TableLookupIndexReqKey("idx1")] = _propertyMapEventIndex; JoinExecTableLookupStrategy lookupStrategy = spec.MakeStrategy("ABC", "001", null, indexes, _types, new VirtualDWView[2]); IndexedTableLookupStrategy strategy = (IndexedTableLookupStrategy)lookupStrategy; Assert.AreEqual(_types[0], strategy.EventType); Assert.AreEqual(_propertyMapEventIndex, strategy.Index); Assert.IsTrue(Collections.AreEqual(new String[] { "IntBoxed" }, strategy.Properties)); }
public void QIndexJoinLookup(JoinExecTableLookupStrategy strategy, EventTable index) { }