本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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]);
}
示例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);
}
示例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]);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}