本文整理汇总了Java中com.espertech.esper.epl.spec.OuterJoinDesc类的典型用法代码示例。如果您正苦于以下问题:Java OuterJoinDesc类的具体用法?Java OuterJoinDesc怎么用?Java OuterJoinDesc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OuterJoinDesc类属于com.espertech.esper.epl.spec包,在下文中一共展示了OuterJoinDesc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyze
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
/**
* Analyzes the outer join descriptor list to build a query graph model.
*
* @param outerJoinDescList - list of outer join descriptors
* @param queryGraph - model containing relationships between streams that is written into
* @return queryGraph object
*/
public static QueryGraph analyze(OuterJoinDesc[] outerJoinDescList, QueryGraph queryGraph) {
for (OuterJoinDesc outerJoinDesc : outerJoinDescList) {
// add optional on-expressions
if (outerJoinDesc.getOptLeftNode() != null) {
ExprIdentNode identNodeLeft = outerJoinDesc.getOptLeftNode();
ExprIdentNode identNodeRight = outerJoinDesc.getOptRightNode();
add(queryGraph, identNodeLeft, identNodeRight);
if (outerJoinDesc.getAdditionalLeftNodes() != null) {
for (int i = 0; i < outerJoinDesc.getAdditionalLeftNodes().length; i++) {
add(queryGraph, outerJoinDesc.getAdditionalLeftNodes()[i], outerJoinDesc.getAdditionalRightNodes()[i]);
}
}
}
}
return queryGraph;
}
示例2: testAnalyze
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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]);
}
示例3: testGetPlan
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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);
}
示例4: getFilterExpressionInclOnClause
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
private ExprNode getFilterExpressionInclOnClause(ExprNode optionalFilterNode, List<OuterJoinDesc> outerJoinDescList)
{
if (optionalFilterNode == null) { // no need to add as query planning is fully based on on-clause
return null;
}
if (outerJoinDescList.isEmpty()) { // not an outer-join syntax
return optionalFilterNode;
}
if (!OuterJoinDesc.consistsOfAllInnerJoins(outerJoinDescList)) { // all-inner joins
return optionalFilterNode;
}
ExprAndNode andNode = new ExprAndNodeImpl();
andNode.addChildNode(optionalFilterNode);
for (OuterJoinDesc outerJoinDesc : outerJoinDescList) {
andNode.addChildNode(outerJoinDesc.makeExprNode(null));
}
try {
andNode.validate(null);
}
catch (ExprValidationException ex) {
throw new RuntimeException("Unexpected exception validating expression: " + ex.getMessage(), ex);
}
return andNode;
}
示例5: testAnalyze
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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]);
}
示例6: testGetPlan
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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);
}
示例7: JoinSetComposerPrototypeHistorical2StreamImpl
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
public JoinSetComposerPrototypeHistorical2StreamImpl(ExprEvaluator optionalFilterEval, EventType[] streamTypes, ExprEvaluatorContext exprEvaluatorContext, int polledViewNum, int streamViewNum, boolean outerJoin, ExprEvaluator outerJoinEqualsEval, Pair<HistoricalIndexLookupStrategy, PollResultIndexingStrategy> indexStrategies, boolean allHistoricalNoSubordinate, OuterJoinDesc[] outerJoinDescList, boolean allowIndexInit) {
this.optionalFilterEval = optionalFilterEval;
this.streamTypes = streamTypes;
this.exprEvaluatorContext = exprEvaluatorContext;
this.polledViewNum = polledViewNum;
this.streamViewNum = streamViewNum;
isOuterJoin = outerJoin;
this.outerJoinEqualsEval = outerJoinEqualsEval;
this.indexStrategies = indexStrategies;
isAllHistoricalNoSubordinate = allHistoricalNoSubordinate;
this.outerJoinDescList = outerJoinDescList;
this.allowIndexInit = allowIndexInit;
}
示例8: getFilterExpressionInclOnClause
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
private ExprNode getFilterExpressionInclOnClause(ExprNode optionalFilterNode, OuterJoinDesc[] outerJoinDescList) {
if (optionalFilterNode == null) { // no need to add as query planning is fully based on on-clause
return null;
}
if (outerJoinDescList.length == 0) { // not an outer-join syntax
return optionalFilterNode;
}
if (!OuterJoinDesc.consistsOfAllInnerJoins(outerJoinDescList)) { // all-inner joins
return optionalFilterNode;
}
boolean hasOnClauses = OuterJoinDesc.hasOnClauses(outerJoinDescList);
if (!hasOnClauses) {
return optionalFilterNode;
}
List<ExprNode> expressions = new ArrayList<>();
expressions.add(optionalFilterNode);
for (OuterJoinDesc outerJoinDesc : outerJoinDescList) {
if (outerJoinDesc.getOptLeftNode() != null) {
expressions.add(outerJoinDesc.makeExprNode(null));
}
}
ExprAndNode andNode = ExprNodeUtilityRich.connectExpressionsByLogicalAnd(expressions);
try {
andNode.validate(null);
} catch (ExprValidationException ex) {
throw new RuntimeException("Unexpected exception validating expression: " + ex.getMessage(), ex);
}
return andNode;
}
示例9: optionalStreamsIfAny
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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;
}
示例10: graphInnerJoins
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的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);
}
示例11: makeDesc
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
public static OuterJoinDesc makeDesc(String propOne, String streamOne, String propTwo, String streamTwo, OuterJoinType type) throws Exception {
ExprIdentNode identNodeOne = new ExprIdentNodeImpl(propOne, streamOne);
ExprIdentNode identNodeTwo = new ExprIdentNodeImpl(propTwo, streamTwo);
ExprValidationContext context = SupportExprValidationContextFactory.make(new SupportStreamTypeSvc3Stream());
identNodeOne.validate(context);
identNodeTwo.validate(context);
OuterJoinDesc desc = new OuterJoinDesc(type, identNodeOne, identNodeTwo, null, null);
return desc;
}
示例12: testGraphOuterJoins
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
public void testGraphOuterJoins() throws Exception {
OuterJoinDesc[] descList = new OuterJoinDesc[2];
descList[0] = SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s0", "intBoxed", "s1", OuterJoinType.RIGHT);
descList[1] = SupportOuterJoinDescFactory.makeDesc("simpleProperty", "s2", "theString", "s1", OuterJoinType.FULL);
OuterInnerDirectionalGraph graph = NStreamOuterQueryPlanBuilder.graphOuterJoins(3, descList);
// assert the inner and outer streams for each stream
assertInners(new int[][]{null, {0, 2}, {1}}, graph);
assertOuters(new int[][]{{1}, {2}, {1}}, graph);
descList[0] = SupportOuterJoinDescFactory.makeDesc("intPrimitive", "s1", "intBoxed", "s0", OuterJoinType.LEFT);
descList[1] = SupportOuterJoinDescFactory.makeDesc("simpleProperty", "s2", "theString", "s1", OuterJoinType.RIGHT);
graph = NStreamOuterQueryPlanBuilder.graphOuterJoins(3, descList);
// assert the inner and outer streams for each stream
assertInners(new int[][]{{1}, null, {1}}, graph);
assertOuters(new int[][]{null, {0, 2}, null}, graph);
try {
NStreamOuterQueryPlanBuilder.graphOuterJoins(3, new OuterJoinDesc[0]);
fail();
} catch (IllegalArgumentException ex) {
// expected
}
}
示例13: JoinSetComposerPrototypeHistorical2StreamImpl
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
public JoinSetComposerPrototypeHistorical2StreamImpl(ExprNode optionalFilterNode, EventType[] streamTypes, ExprEvaluatorContext exprEvaluatorContext, int polledViewNum, int streamViewNum, boolean outerJoin, ExprNode outerJoinEqualsNode, Pair<HistoricalIndexLookupStrategy, PollResultIndexingStrategy> indexStrategies, boolean allHistoricalNoSubordinate, List<OuterJoinDesc> outerJoinDescList) {
this.optionalFilterNode = optionalFilterNode;
this.streamTypes = streamTypes;
this.exprEvaluatorContext = exprEvaluatorContext;
this.polledViewNum = polledViewNum;
this.streamViewNum = streamViewNum;
isOuterJoin = outerJoin;
this.outerJoinEqualsNode = outerJoinEqualsNode;
this.indexStrategies = indexStrategies;
isAllHistoricalNoSubordinate = allHistoricalNoSubordinate;
this.outerJoinDescList = outerJoinDescList;
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:13,代码来源:JoinSetComposerPrototypeHistorical2StreamImpl.java
示例14: JoinSetComposerPrototypeImpl
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
public JoinSetComposerPrototypeImpl(String statementName,
String statementId,
List<OuterJoinDesc> outerJoinDescList,
ExprNode optionalFilterNode,
EventType[] streamTypes,
String[] streamNames,
StreamJoinAnalysisResult streamJoinAnalysisResult,
Annotation[] annotations,
HistoricalViewableDesc historicalViewableDesc,
ExprEvaluatorContext exprEvaluatorContext,
QueryPlanIndex[] indexSpecs,
QueryPlan queryPlan,
HistoricalStreamIndexList[] historicalStreamIndexLists,
boolean joinRemoveStream,
boolean isOuterJoins) {
this.statementName = statementName;
this.statementId = statementId;
this.outerJoinDescList = outerJoinDescList;
this.optionalFilterNode = optionalFilterNode;
this.streamTypes = streamTypes;
this.streamNames = streamNames;
this.streamJoinAnalysisResult = streamJoinAnalysisResult;
this.annotations = annotations;
this.historicalViewableDesc = historicalViewableDesc;
this.exprEvaluatorContext = exprEvaluatorContext;
this.indexSpecs = indexSpecs;
this.queryPlan = queryPlan;
this.historicalStreamIndexLists = historicalStreamIndexLists;
this.joinRemoveStream = joinRemoveStream;
this.isOuterJoins = isOuterJoins;
}
示例15: analyze
import com.espertech.esper.epl.spec.OuterJoinDesc; //导入依赖的package包/类
/**
* Analyzes the outer join descriptor list to build a query graph model.
* @param outerJoinDescList - list of outer join descriptors
* @param queryGraph - model containing relationships between streams that is written into
* @return queryGraph object
*/
public static QueryGraph analyze(List<OuterJoinDesc> outerJoinDescList, QueryGraph queryGraph)
{
for (OuterJoinDesc outerJoinDesc : outerJoinDescList)
{
// add optional on-expressions
if (outerJoinDesc.getOptLeftNode() != null) {
ExprIdentNode identNodeLeft = outerJoinDesc.getOptLeftNode();
ExprIdentNode identNodeRight = outerJoinDesc.getOptRightNode();
add(queryGraph, identNodeLeft, identNodeRight);
if (outerJoinDesc.getAdditionalLeftNodes() != null)
{
for (int i = 0; i < outerJoinDesc.getAdditionalLeftNodes().length; i++)
{
add(queryGraph, outerJoinDesc.getAdditionalLeftNodes()[i], outerJoinDesc.getAdditionalRightNodes()[i]);
}
}
}
else {
}
}
return queryGraph;
}