当前位置: 首页>>代码示例>>Java>>正文


Java QueryPlanIndexDescOnExpr类代码示例

本文整理汇总了Java中com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr的典型用法代码示例。如果您正苦于以下问题:Java QueryPlanIndexDescOnExpr类的具体用法?Java QueryPlanIndexDescOnExpr怎么用?Java QueryPlanIndexDescOnExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QueryPlanIndexDescOnExpr类属于com.espertech.esper.epl.join.util包,在下文中一共展示了QueryPlanIndexDescOnExpr类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assertIndexChoice

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
private void assertIndexChoice(EPServiceProvider epService, String hint, String expectedIndexName) {
    String epl = IndexBackingTableInfo.INDEX_CALLBACK_HOOK + hint +
            "on SupportSpatialAABB as aabb select mpw.id as c0 from MyPointWindow as mpw " +
            "where aabb.category = mpw.category and point(px, py).inside(rectangle(x, y, width, height))\n";
    EPStatement stmt = epService.getEPAdministrator().createEPL(epl);
    SupportUpdateListener listener = new SupportUpdateListener();
    stmt.addListener(listener);

    QueryPlanIndexDescOnExpr plan = SupportQueryPlanIndexHook.assertOnExprAndReset();
    assertEquals(expectedIndexName, plan.getTables()[0].getIndexName());

    epService.getEPRuntime().sendEvent(new SupportSpatialAABB("R1", 9, 14, 1.0001, 1.0001, "Y"));
    assertEquals("P2", listener.assertOneGetNewAndReset().get("c0"));

    stmt.destroy();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:17,代码来源:ExecSpatialPointRegionQuadTreeEventIndex.java

示例2: runAssertionDocSample

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
private void runAssertionDocSample(EPServiceProvider epService) {
    epService.getEPAdministrator().getConfiguration().addEventType(AEvent.class);
    epService.getEPAdministrator().getConfiguration().addEventType(BEvent.class);

    String[] hints = new String[]{
        "@hint('exclude_plan(true)')",
        "@hint('exclude_plan(opname=\"equals\")')",
        "@hint('exclude_plan(opname=\"equals\" and from_streamname=\"a\")')",
        "@hint('exclude_plan(opname=\"equals\" and from_streamname=\"b\")')",
        "@hint('exclude_plan(exprs[0]=\"aprop\")')"};
    for (String hint : hints) {
        epService.getEPAdministrator().createEPL("@Audit " + hint +
                "select * from AEvent#keepall as a, BEvent#keepall as b where aprop = bprop");
    }

    // test subquery
    SupportQueryPlanIndexHook.reset();
    epService.getEPAdministrator().createEPL(INDEX_CALLBACK_HOOK + "@hint('exclude_plan(true)') select (select * from S0#unique(p00) as s0 where s1.p10 = p00) from S1 as s1");
    QueryPlanIndexDescSubquery subq = SupportQueryPlanIndexHook.getAndResetSubqueries().get(0);
    assertEquals(SubordFullTableScanLookupStrategyFactory.class.getSimpleName(), subq.getTableLookupStrategy());

    // test named window
    epService.getEPAdministrator().createEPL("create window S0Window#keepall as S0");
    epService.getEPAdministrator().createEPL(INDEX_CALLBACK_HOOK + "@hint('exclude_plan(true)') on S1 as s1 select * from S0Window as s0 where s1.p10 = s0.p00");
    QueryPlanIndexDescOnExpr onExpr = SupportQueryPlanIndexHook.getAndResetOnExpr();
    assertEquals(SubordWMatchExprLookupStrategyFactoryAllFiltered.class.getSimpleName(), onExpr.getStrategyName());

    epService.getEPAdministrator().destroyAllStatements();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:30,代码来源:ExecEPLPlanExcludeHint.java

示例3: assertOnExprAndReset

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
public static void assertOnExprAndReset(String tableName, String indexBackingClass) {
    Assert.assertTrue(onexprs.size() == 1);
    QueryPlanIndexDescOnExpr onexp = onexprs.get(0);
    Assert.assertEquals(tableName, onexp.getTableName());
    Assert.assertEquals(indexBackingClass, onexp.getIndexBackingClass());
    reset();
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:8,代码来源:SupportQueryPlanIndexHook.java

示例4: runAssertionMultiIdxMultipleInAndMultirow

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
private void runAssertionMultiIdxMultipleInAndMultirow(EPServiceProvider epService) {
    // assert join
    SupportQueryPlanIndexHook.reset();
    String epl = INDEX_CALLBACK_HOOK + "select * from S0 as s0 unidirectional, S1#keepall as s1 " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmt = epService.getEPAdministrator().createEPL(epl);
    SupportUpdateListener listener = new SupportUpdateListener();
    stmt.addListener(listener);

    Map<TableLookupIndexReqKey, QueryPlanIndexItem> items = SupportQueryPlanIndexHook.assertJoinAndReset().getIndexSpecs()[1].getItems();
    assertEquals("[p10][p11]", SupportQueryPlanIndexHelper.getIndexedExpressions(items));

    tryAssertionMultiIdx(epService, listener);
    epService.getEPAdministrator().destroyAllStatements();

    // assert named window
    epService.getEPAdministrator().createEPL("create window S1Window#keepall as S1");
    epService.getEPAdministrator().createEPL("insert into S1Window select * from S1");

    String eplNamedWindow = INDEX_CALLBACK_HOOK + "on S0 as s0 select * from S1Window as s1 " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmtNamedWindow = epService.getEPAdministrator().createEPL(eplNamedWindow);
    stmtNamedWindow.addListener(listener);

    QueryPlanIndexDescOnExpr onExprNamedWindow = SupportQueryPlanIndexHook.assertOnExprAndReset();
    assertEquals(SubordInKeywordMultiTableLookupStrategyFactory.class.getSimpleName(), onExprNamedWindow.getTableLookupStrategy());

    tryAssertionMultiIdx(epService, listener);

    // assert table
    epService.getEPAdministrator().createEPL("create table S1Table(id int primary key, p10 string primary key, p11 string primary key, p12 string primary key, p13 string primary key)");
    epService.getEPAdministrator().createEPL("insert into S1Table select * from S1");
    epService.getEPAdministrator().createEPL("create index S1Idx1 on S1Table(p10)");
    epService.getEPAdministrator().createEPL("create index S1Idx2 on S1Table(p11)");
    epService.getEPAdministrator().createEPL("create index S1Idx3 on S1Table(p12)");
    epService.getEPAdministrator().createEPL("create index S1Idx4 on S1Table(p13)");

    String eplTable = INDEX_CALLBACK_HOOK + "on S0 as s0 select * from S1Table as s1 " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmtTable = epService.getEPAdministrator().createEPL(eplTable);
    stmtTable.addListener(listener);

    QueryPlanIndexDescOnExpr onExprTable = SupportQueryPlanIndexHook.assertOnExprAndReset();
    assertEquals(SubordInKeywordMultiTableLookupStrategyFactory.class.getSimpleName(), onExprTable.getTableLookupStrategy());

    tryAssertionMultiIdx(epService, listener);

    epService.getEPAdministrator().destroyAllStatements();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:50,代码来源:ExecEPLPlanInKeywordQuery.java

示例5: runAssertionSingleIdxMultipleInAndMultirow

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
private void runAssertionSingleIdxMultipleInAndMultirow(EPServiceProvider epService) {
    // assert join
    SupportQueryPlanIndexHook.reset();
    String epl = INDEX_CALLBACK_HOOK + "select * from S0#keepall as s0, S1 as s1 unidirectional " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmt = epService.getEPAdministrator().createEPL(epl);
    SupportUpdateListener listener = new SupportUpdateListener();
    stmt.addListener(listener);

    Map<TableLookupIndexReqKey, QueryPlanIndexItem> items = SupportQueryPlanIndexHook.assertJoinAndReset().getIndexSpecs()[0].getItems();
    assertEquals("[p00]", SupportQueryPlanIndexHelper.getIndexedExpressions(items));

    tryAssertionSingleIdx(epService, listener);
    epService.getEPAdministrator().destroyAllStatements();

    // assert named window
    epService.getEPAdministrator().createEPL("create window S0Window#keepall as S0");
    epService.getEPAdministrator().createEPL("insert into S0Window select * from S0");

    String eplNamedWindow = INDEX_CALLBACK_HOOK + "on S1 as s1 select * from S0Window as s0 " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmtNamedWindow = epService.getEPAdministrator().createEPL(eplNamedWindow);
    stmtNamedWindow.addListener(listener);

    QueryPlanIndexDescOnExpr onExprNamedWindow = SupportQueryPlanIndexHook.assertOnExprAndReset();
    assertEquals(SubordInKeywordSingleTableLookupStrategyFactory.class.getSimpleName(), onExprNamedWindow.getTableLookupStrategy());

    tryAssertionSingleIdx(epService, listener);

    // assert table
    epService.getEPAdministrator().createEPL("create table S0Table(id int primary key, p00 string primary key, p01 string primary key, p02 string primary key, p03 string primary key)");
    epService.getEPAdministrator().createEPL("insert into S0Table select * from S0");
    epService.getEPAdministrator().createEPL("create index S0Idx1 on S0Table(p00)");
    epService.getEPAdministrator().createEPL("create index S0Idx2 on S0Table(p01)");

    String eplTable = INDEX_CALLBACK_HOOK + "on S1 as s1 select * from S0Table as s0 " +
            "where p00 in (p10, p11) and p01 in (p12, p13)";
    EPStatement stmtTable = epService.getEPAdministrator().createEPL(eplTable);
    stmtTable.addListener(listener);

    QueryPlanIndexDescOnExpr onExprTable = SupportQueryPlanIndexHook.assertOnExprAndReset();
    assertEquals(SubordInKeywordSingleTableLookupStrategyFactory.class.getSimpleName(), onExprTable.getTableLookupStrategy());

    tryAssertionSingleIdx(epService, listener);

    epService.getEPAdministrator().destroyAllStatements();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:48,代码来源:ExecEPLPlanInKeywordQuery.java

示例6: namedWindowOnExpr

import com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr; //导入依赖的package包/类
public void namedWindowOnExpr(QueryPlanIndexDescOnExpr onexprdesc) {
    onexprs.add(onexprdesc);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:4,代码来源:SupportQueryPlanIndexHook.java


注:本文中的com.espertech.esper.epl.join.util.QueryPlanIndexDescOnExpr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。