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


Java OuterJoinType类代码示例

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


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

示例1: runAssertionMultiColumnLeft_OM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
private void runAssertionMultiColumnLeft_OM(EPServiceProvider epService) throws Exception {
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.create("s0.id, s0.p00, s0.p01, s1.id, s1.p10, s1.p11".split(",")));
    FromClause fromClause = FromClause.create(
            FilterStream.create(SupportBean_S0.class.getName(), "s0").addView("keepall"),
            FilterStream.create(SupportBean_S1.class.getName(), "s1").addView("keepall"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s1.p10").add("s1.p11", "s0.p01"));
    model.setFromClause(fromClause);
    model = (EPStatementObjectModel) SerializableObjectCopier.copy(model);

    String stmtText = "select s0.id, s0.p00, s0.p01, s1.id, s1.p10, s1.p11 from " + SupportBean_S0.class.getName() + "#keepall as s0 left outer join " + SupportBean_S1.class.getName() + "#keepall as s1 on s0.p00 = s1.p10 and s1.p11 = s0.p01";
    assertEquals(stmtText, model.toEPL());
    EPStatement stmt = epService.getEPAdministrator().create(model);
    SupportUpdateListener listener = new SupportUpdateListener();
    stmt.addListener(listener);

    assertMultiColumnLeft(epService, listener);

    EPStatementObjectModel modelReverse = epService.getEPAdministrator().compileEPL(stmtText);
    assertEquals(stmtText, modelReverse.toEPL());

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

示例2: runAssertion2TableFullOuterJoinOM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
private void runAssertion2TableFullOuterJoinOM(EPServiceProvider epService) {
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.create("symbol", "volume", "theString", "intPrimitive"));
    model.setFromClause(FromClause.create(FilterStream.create(SupportMarketDataBean.class.getName()).unidirectional(true)));
    model.getFromClause().add(FilterStream.create(SupportBean.class.getName()).addView("keepall"));
    model.getFromClause().add(OuterJoinQualifier.create("theString", OuterJoinType.FULL, "symbol"));

    String stmtText = "select symbol, volume, theString, intPrimitive " +
            "from " + SupportMarketDataBean.class.getName() + " unidirectional " +
            "full outer join " +
            SupportBean.class.getName() +
            "#keepall on theString = symbol";
    assertEquals(stmtText, model.toEPL());

    EPStatement stmt = epService.getEPAdministrator().create(model);

    tryFullOuterPassive2Stream(epService, stmt);

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

示例3: runAssertionLeftOuterJoin_root_s0_OM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
private void runAssertionLeftOuterJoin_root_s0_OM(EPServiceProvider epService) throws Exception {
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.createWildcard());
    FromClause fromClause = FromClause.create(
            FilterStream.create(EVENT_S0, "s0").addView("keepall"),
            FilterStream.create(EVENT_S1, "s1").addView("keepall"),
            FilterStream.create(EVENT_S2, "s2").addView("keepall"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s1.p10"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s2.p20"));
    model.setFromClause(fromClause);
    model = (EPStatementObjectModel) SerializableObjectCopier.copy(model);

    assertEquals("select * from " + SupportBean_S0.class.getName() + "#keepall as s0 left outer join " + SupportBean_S1.class.getName() + "#keepall as s1 on s0.p00 = s1.p10 left outer join " + SupportBean_S2.class.getName() + "#keepall as s2 on s0.p00 = s2.p20", model.toEPL());
    EPStatement stmt = epService.getEPAdministrator().create(model);
    SupportUpdateListener listener = new SupportUpdateListener();
    stmt.addListener(listener);

    tryAssertion(epService, listener);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:20,代码来源:ExecOuterJoinVarA3Stream.java

示例4: testAnalyze

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testAnalyze() throws Exception {
    OuterJoinDesc[] descList = new OuterJoinDesc[2];
    descList[0] = SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s0", "intBoxed", "s1", OuterJoinType.LEFT);
    descList[1] = SupportOuterJoinDescFactory.makeDesc("simpleProperty", "s2", "theString", "s1", OuterJoinType.LEFT);
    // simpleProperty in s2

    QueryGraph graph = new QueryGraph(3, null, false);
    OuterJoinAnalyzer.analyze(descList, graph);
    assertEquals(3, graph.getNumStreams());

    assertTrue(graph.isNavigableAtAll(0, 1));
    assertEquals(1, QueryGraphTestUtil.getStrictKeyProperties(graph, 0, 1).length);
    assertEquals("intPrimitive", QueryGraphTestUtil.getStrictKeyProperties(graph, 0, 1)[0]);
    assertEquals(1, QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 0).length);
    assertEquals("intBoxed", QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 0)[0]);

    assertTrue(graph.isNavigableAtAll(1, 2));
    assertEquals("theString", QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 2)[0]);
    assertEquals("simpleProperty", QueryGraphTestUtil.getStrictKeyProperties(graph, 2, 1)[0]);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:TestOuterJoinAnalyzer.java

示例5: testGetPlan

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testGetPlan() throws Exception {
    OuterJoinDesc[] descList = new OuterJoinDesc[]{
            SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s0", "intBoxed", "s1", OuterJoinType.LEFT)
    };

    QueryGraph queryGraph = new QueryGraph(2, null, false);
    EngineImportService engineImportService = SupportEngineImportServiceFactory.make();
    QueryPlan plan = QueryPlanBuilder.getPlan(typesPerStream, new OuterJoinDesc[0], queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null, engineImportService, false);
    assertPlan(plan);

    plan = QueryPlanBuilder.getPlan(typesPerStream, descList, queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null, engineImportService, false);
    assertPlan(plan);

    FilterExprAnalyzer.analyze(SupportExprNodeFactory.makeEqualsNode(), queryGraph, false);
    plan = QueryPlanBuilder.getPlan(typesPerStream, descList, queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null, engineImportService, false);
    assertPlan(plan);

    plan = QueryPlanBuilder.getPlan(typesPerStream, new OuterJoinDesc[0], queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null, engineImportService, false);
    assertPlan(plan);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:TestQueryPlanBuilder.java

示例6: testAnalyze

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testAnalyze() throws Exception
{
    List<OuterJoinDesc> descList = new LinkedList<OuterJoinDesc>();
    descList.add(SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s0", "intBoxed", "s1", OuterJoinType.LEFT));
    descList.add(SupportOuterJoinDescFactory.makeDesc("simpleProperty", "s2", "theString", "s1", OuterJoinType.LEFT));
    // simpleProperty in s2

    QueryGraph graph = new QueryGraph(3);
    OuterJoinAnalyzer.analyze(descList, graph);
    assertEquals(3, graph.getNumStreams());

    assertTrue(graph.isNavigableAtAll(0, 1));
    assertEquals(1, QueryGraphTestUtil.getStrictKeyProperties(graph, 0, 1).length);
    assertEquals("intPrimitive", QueryGraphTestUtil.getStrictKeyProperties(graph, 0, 1)[0]);
    assertEquals(1, QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 0).length);
    assertEquals("intBoxed", QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 0)[0]);

    assertTrue(graph.isNavigableAtAll(1, 2));
    assertEquals("theString", QueryGraphTestUtil.getStrictKeyProperties(graph, 1, 2)[0]);
    assertEquals("simpleProperty", QueryGraphTestUtil.getStrictKeyProperties(graph, 2, 1)[0]);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:22,代码来源:TestOuterJoinAnalyzer.java

示例7: testGetPlan

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testGetPlan() throws Exception
{
    List<OuterJoinDesc> descList = new LinkedList<OuterJoinDesc>();
    OuterJoinDesc joinDesc = SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s0", "intBoxed", "s1", OuterJoinType.LEFT);
    descList.add(joinDesc);

    QueryGraph queryGraph = new QueryGraph(2);
    QueryPlan plan = QueryPlanBuilder.getPlan(typesPerStream, new LinkedList<OuterJoinDesc>(), queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null);
    assertPlan(plan);

    plan = QueryPlanBuilder.getPlan(typesPerStream, descList, queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null);
    assertPlan(plan);

    FilterExprAnalyzer.analyze(SupportExprNodeFactory.makeEqualsNode(), queryGraph, false);
    plan = QueryPlanBuilder.getPlan(typesPerStream, descList, queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null);
    assertPlan(plan);

    plan = QueryPlanBuilder.getPlan(typesPerStream, new LinkedList<OuterJoinDesc>(), queryGraph, null, new HistoricalViewableDesc(5), dependencyGraph, null, new StreamJoinAnalysisResult(2), true, null, null);
    assertPlan(plan);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:21,代码来源:TestQueryPlanBuilder.java

示例8: test2TableFullOuterJoinOM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void test2TableFullOuterJoinOM()
{
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.create("symbol", "volume", "theString", "intPrimitive"));
    model.setFromClause(FromClause.create(FilterStream.create(SupportMarketDataBean.class.getName()).unidirectional(true)));
    model.getFromClause().add(FilterStream.create(SupportBean.class.getName()).addView("win", "keepall"));
    model.getFromClause().add(OuterJoinQualifier.create("theString", OuterJoinType.FULL, "symbol"));

    String stmtText = "select symbol, volume, theString, intPrimitive " +
                  "from " + SupportMarketDataBean.class.getName() + " unidirectional " +
                  "full outer join " +
                  SupportBean.class.getName() +
                  ".win:keepall() on theString = symbol";
    assertEquals(stmtText, model.toEPL());

    EPStatement stmt = epService.getEPAdministrator().create(model);

    tryFullOuterPassive2Stream(stmt);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:20,代码来源:TestUnidirectionalStreamJoin.java

示例9: testMultiColumnLeft_OM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testMultiColumnLeft_OM() throws Exception
{
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.create("s0.id, s0.p00, s0.p01, s1.id, s1.p10, s1.p11".split(",")));
    FromClause fromClause = FromClause.create(
            FilterStream.create(SupportBean_S0.class.getName(), "s0").addView("win", "keepall"),
            FilterStream.create(SupportBean_S1.class.getName(), "s1").addView("win", "keepall"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s1.p10").add("s1.p11", "s0.p01"));
    model.setFromClause(fromClause);
    model = (EPStatementObjectModel) SerializableObjectCopier.copy(model);

    String stmtText = "select s0.id, s0.p00, s0.p01, s1.id, s1.p10, s1.p11 from com.espertech.esper.support.bean.SupportBean_S0.win:keepall() as s0 left outer join com.espertech.esper.support.bean.SupportBean_S1.win:keepall() as s1 on s0.p00 = s1.p10 and s1.p11 = s0.p01";
    assertEquals(stmtText, model.toEPL());
    EPStatement outerJoinView = epService.getEPAdministrator().create(model);
    outerJoinView.addListener(listener);

    assertMultiColumnLeft();

    EPStatementObjectModel modelReverse = epService.getEPAdministrator().compileEPL(stmtText);
    assertEquals(stmtText, modelReverse.toEPL());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:22,代码来源:Test2StreamOuterJoin.java

示例10: testLeftOuterJoin_root_s0_OM

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public void testLeftOuterJoin_root_s0_OM() throws Exception
{
    EPStatementObjectModel model = new EPStatementObjectModel();
    model.setSelectClause(SelectClause.createWildcard());
    FromClause fromClause = FromClause.create(
            FilterStream.create(EVENT_S0, "s0").addView("win", "keepall"),
            FilterStream.create(EVENT_S1, "s1").addView("win", "keepall"),
            FilterStream.create(EVENT_S2, "s2").addView("win", "keepall"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s1.p10"));
    fromClause.add(OuterJoinQualifier.create("s0.p00", OuterJoinType.LEFT, "s2.p20"));
    model.setFromClause(fromClause);
    model = (EPStatementObjectModel) SerializableObjectCopier.copy(model);

    assertEquals("select * from com.espertech.esper.support.bean.SupportBean_S0.win:keepall() as s0 left outer join com.espertech.esper.support.bean.SupportBean_S1.win:keepall() as s1 on s0.p00 = s1.p10 left outer join com.espertech.esper.support.bean.SupportBean_S2.win:keepall() as s2 on s0.p00 = s2.p20", model.toEPL());
    EPStatement joinView = epService.getEPAdministrator().create(model);
    joinView.addListener(updateListener);

    runAsserts();
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:20,代码来源:Test3StreamOuterJoinVarA.java

示例11: consistsOfAllInnerJoins

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public static boolean consistsOfAllInnerJoins(OuterJoinDesc[] outerJoinDescList) {
    for (OuterJoinDesc desc : outerJoinDescList) {
        if (desc.getOuterJoinType() != OuterJoinType.INNER) {
            return false;
        }
    }
    return true;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:OuterJoinDesc.java

示例12: optionalStreamsIfAny

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public static boolean optionalStreamsIfAny(OuterJoinDesc[] outerJoinDescList) {
    if (outerJoinDescList == null || outerJoinDescList.length == 0) {
        return false;
    }
    for (OuterJoinDesc outerJoinDesc : outerJoinDescList) {
        if (outerJoinDesc.getOuterJoinType() != OuterJoinType.INNER) {
            return true;
        }
    }
    return false;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:OuterJoinAnalyzer.java

示例13: build

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
/**
 * Build query plan.
 *
 * @param queryGraph            - navigability info
 * @param optionalOuterJoinType - outer join type, null if not an outer join
 * @param typesPerStream        - event types for each stream
 * @param tablesPerStream       - table info
 * @param uniqueIndexProps      props of unique indexes
 * @return query plan
 */
public static QueryPlan build(EventType[] typesPerStream, QueryGraph queryGraph, OuterJoinType optionalOuterJoinType, String[][][] uniqueIndexProps, TableMetadata[] tablesPerStream) {
    QueryPlanIndex[] indexSpecs = QueryPlanIndexBuilder.buildIndexSpec(queryGraph, typesPerStream, uniqueIndexProps);

    QueryPlanNode[] execNodeSpecs = new QueryPlanNode[2];
    TableLookupPlan[] lookupPlans = new TableLookupPlan[2];

    // plan lookup from 1 to zero
    lookupPlans[1] = NStreamQueryPlanBuilder.createLookupPlan(queryGraph, 1, 0, indexSpecs[0], typesPerStream, tablesPerStream[0]);

    // plan lookup from zero to 1
    lookupPlans[0] = NStreamQueryPlanBuilder.createLookupPlan(queryGraph, 0, 1, indexSpecs[1], typesPerStream, tablesPerStream[1]);
    execNodeSpecs[0] = new TableLookupNode(lookupPlans[0]);
    execNodeSpecs[1] = new TableLookupNode(lookupPlans[1]);

    if (optionalOuterJoinType != null) {
        if ((optionalOuterJoinType.equals(OuterJoinType.LEFT)) ||
                (optionalOuterJoinType.equals(OuterJoinType.FULL))) {
            execNodeSpecs[0] = new TableOuterLookupNode(lookupPlans[0]);
        }
        if ((optionalOuterJoinType.equals(OuterJoinType.RIGHT)) ||
                (optionalOuterJoinType.equals(OuterJoinType.FULL))) {
            execNodeSpecs[1] = new TableOuterLookupNode(lookupPlans[1]);
        }
    }

    return new QueryPlan(indexSpecs, execNodeSpecs);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:38,代码来源:TwoStreamQueryPlanBuilder.java

示例14: graphInnerJoins

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
public static InnerJoinGraph graphInnerJoins(int numStreams, OuterJoinDesc[] outerJoinDescList) {
    if ((outerJoinDescList.length + 1) != numStreams) {
        throw new IllegalArgumentException("Number of outer join descriptors and number of streams not matching up");
    }

    Set<InterchangeablePair<Integer, Integer>> graph = new HashSet<InterchangeablePair<Integer, Integer>>();

    boolean allInnerJoin = true;
    for (int i = 0; i < outerJoinDescList.length; i++) {
        OuterJoinDesc desc = outerJoinDescList[i];
        int streamMax = i + 1;       // the outer join must references streams less then streamMax

        // Check outer join on-expression, if provided
        if (desc.getOptLeftNode() != null) {
            int streamOne = desc.getOptLeftNode().getStreamId();
            int streamTwo = desc.getOptRightNode().getStreamId();

            if ((streamOne > streamMax) || (streamTwo > streamMax) ||
                    (streamOne == streamTwo)) {
                throw new IllegalArgumentException("Outer join descriptors reference future streams, or same streams");
            }

            if (desc.getOuterJoinType() == OuterJoinType.INNER) {
                graph.add(new InterchangeablePair<Integer, Integer>(streamOne, streamTwo));
            }
        }

        if (desc.getOuterJoinType() != OuterJoinType.INNER) {
            allInnerJoin = false;
        }
    }

    if (allInnerJoin) {
        return new InnerJoinGraph(numStreams, true);
    }
    return new InnerJoinGraph(numStreams, graph);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:38,代码来源:InnerJoinGraph.java

示例15: isFullOuterJoinAllStreams

import com.espertech.esper.type.OuterJoinType; //导入依赖的package包/类
private static boolean isFullOuterJoinAllStreams(StatementSpecCompiled statementSpec) {
    if (statementSpec.getOuterJoinDescList() == null || statementSpec.getOuterJoinDescList().length == 0) {
        return false;
    }
    for (int stream = 0; stream < statementSpec.getStreamSpecs().length - 1; stream++) {
        if (statementSpec.getOuterJoinDescList()[stream].getOuterJoinType() != OuterJoinType.FULL) {
            return false;
        }
    }
    return true;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:EPStatementStartMethodSelectUtil.java


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