當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。