Esempio n. 1
0
        public void TestInKeywordMultiIndex()
        {
            _epServiceRetained.EPAdministrator.Configuration.AddEventType <SupportBean_S0>("S0");

            String stmtText = INDEX_CALLBACK_HOOK + "select * from S0 s0, " +
                              " sql:MyDB ['select mycol1, mycol2, mycol3 from mytesttable_large'] as s1 " +
                              " where p00 in (mycol2, mycol1)";
            EPStatement statement = _epServiceRetained.EPAdministrator.CreateEPL(stmtText);

            _listener         = new SupportUpdateListener();
            statement.Events += _listener.Update;

            QueryPlanIndexDescHistorical historical = SupportQueryPlanIndexHook.AssertHistoricalAndReset();

            Assert.That(historical.IndexName, Is.EqualTo(typeof(PollResultIndexingStrategyIndexSingleArray).Name));
            Assert.That(historical.StrategyName, Is.EqualTo(typeof(HistoricalIndexLookupStrategyInKeywordMulti).Name));

            var delta = PerformanceObserver.TimeMillis(
                () =>
            {
                for (int i = 0; i < 2000; i++)
                {
                    _epServiceRetained.EPRuntime.SendEvent(new SupportBean_S0(i, "815"));
                    Assert.AreEqual(815, _listener.AssertOneGetNewAndReset().Get("s1.mycol3"));
                }
            });

            Log.Info("delta=" + delta);
            Assert.That(delta, Is.LessThan(500));
        }
        public static QueryPlanIndexDescHistorical AssertHistoricalAndReset()
        {
            QueryPlanIndexDescHistorical item = _historical[0];

            Reset();
            return(item);
        }
 public void Historical(QueryPlanIndexDescHistorical historicalPlan)
 {
     _historical.Add(historicalPlan);
 }
 public void Historical(QueryPlanIndexDescHistorical historicalPlan)
 {
     HISTORICALS.Add(historicalPlan);
 }