本文整理汇总了Java中com.espertech.esper.epl.join.util.EligibilityDesc类的典型用法代码示例。如果您正苦于以下问题:Java EligibilityDesc类的具体用法?Java EligibilityDesc怎么用?Java EligibilityDesc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EligibilityDesc类属于com.espertech.esper.epl.join.util包,在下文中一共展示了EligibilityDesc类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyzeRelationalOpNode
import com.espertech.esper.epl.join.util.EligibilityDesc; //导入依赖的package包/类
private static void analyzeRelationalOpNode(ExprRelationalOpNode relNode, QueryGraph queryGraph) {
if (((relNode.getChildNodes()[0] instanceof ExprIdentNode)) &&
((relNode.getChildNodes()[1] instanceof ExprIdentNode))) {
ExprIdentNode identNodeLeft = (ExprIdentNode) relNode.getChildNodes()[0];
ExprIdentNode identNodeRight = (ExprIdentNode) relNode.getChildNodes()[1];
if (identNodeLeft.getStreamId() != identNodeRight.getStreamId()) {
queryGraph.addRelationalOpStrict(identNodeLeft.getStreamId(), identNodeLeft,
identNodeRight.getStreamId(), identNodeRight, relNode.getRelationalOpEnum());
}
return;
}
int indexedStream = -1;
ExprIdentNode indexedPropExpr = null;
ExprNode exprNodeNoIdent = null;
RelationalOpEnum relop = relNode.getRelationalOpEnum();
if (relNode.getChildNodes()[0] instanceof ExprIdentNode) {
indexedPropExpr = (ExprIdentNode) relNode.getChildNodes()[0];
indexedStream = indexedPropExpr.getStreamId();
exprNodeNoIdent = relNode.getChildNodes()[1];
} else if (relNode.getChildNodes()[1] instanceof ExprIdentNode) {
indexedPropExpr = (ExprIdentNode) relNode.getChildNodes()[1];
indexedStream = indexedPropExpr.getStreamId();
exprNodeNoIdent = relNode.getChildNodes()[0];
relop = relop.reversed();
}
if (indexedStream == -1) {
return; // require property of right/left side of equals
}
EligibilityDesc eligibility = EligibilityUtil.verifyInputStream(exprNodeNoIdent, indexedStream);
if (!eligibility.getEligibility().isEligible()) {
return;
}
queryGraph.addRelationalOp(indexedStream, indexedPropExpr, eligibility.getStreamNum(), exprNodeNoIdent, relop);
}
示例2: analyzeInNodeMultiIndex
import com.espertech.esper.epl.join.util.EligibilityDesc; //导入依赖的package包/类
private static void analyzeInNodeMultiIndex(ExprInNode inNode, QueryGraph queryGraph) {
ExprNode[] setExpressions = getInNodeSetExpressions(inNode);
if (setExpressions.length == 0) {
return;
}
Map<Integer, List<ExprNode>> perStreamExprs = new LinkedHashMap<Integer, List<ExprNode>>();
for (ExprNode exprNodeSet : setExpressions) {
if (!(exprNodeSet instanceof ExprIdentNode)) {
continue;
}
ExprIdentNode setIdent = (ExprIdentNode) exprNodeSet;
addToList(setIdent.getStreamId(), setIdent, perStreamExprs);
}
if (perStreamExprs.isEmpty()) {
return;
}
ExprNode testExpr = inNode.getChildNodes()[0];
Class testExprType = JavaClassHelper.getBoxedType(testExpr.getForge().getEvaluationType());
if (perStreamExprs.size() > 1) {
return;
}
Map.Entry<Integer, List<ExprNode>> entry = perStreamExprs.entrySet().iterator().next();
ExprNode[] exprNodes = ExprNodeUtilityCore.toArray(entry.getValue());
for (ExprNode node : exprNodes) {
Class exprType = node.getForge().getEvaluationType();
if (JavaClassHelper.getBoxedType(exprType) != testExprType) {
return;
}
}
Integer testStreamNum;
int setStream = entry.getKey();
if (!(testExpr instanceof ExprIdentNode)) {
EligibilityDesc eligibility = EligibilityUtil.verifyInputStream(testExpr, setStream);
if (!eligibility.getEligibility().isEligible()) {
return;
}
if (eligibility.getEligibility() == Eligibility.REQUIRE_ONE && setStream == eligibility.getStreamNum()) {
return;
}
testStreamNum = eligibility.getStreamNum();
} else {
testStreamNum = ((ExprIdentNode) testExpr).getStreamId();
}
if (testStreamNum == null) {
queryGraph.addInSetMultiIndexUnkeyed(testExpr, setStream, exprNodes);
} else {
if (testStreamNum.equals(entry.getKey())) {
return;
}
queryGraph.addInSetMultiIndex(testStreamNum, testExpr, setStream, exprNodes);
}
}
示例3: analyzeInNodeSingleIndex
import com.espertech.esper.epl.join.util.EligibilityDesc; //导入依赖的package包/类
private static void analyzeInNodeSingleIndex(ExprInNode inNode, QueryGraph queryGraph) {
if (!(inNode.getChildNodes()[0] instanceof ExprIdentNode)) {
return;
}
ExprIdentNode testIdent = (ExprIdentNode) inNode.getChildNodes()[0];
Class testIdentClass = JavaClassHelper.getBoxedType(testIdent.getForge().getEvaluationType());
int indexedStream = testIdent.getStreamId();
ExprNode[] setExpressions = getInNodeSetExpressions(inNode);
if (setExpressions.length == 0) {
return;
}
Map<Integer, List<ExprNode>> perStreamExprs = new LinkedHashMap<Integer, List<ExprNode>>();
for (ExprNode exprNodeSet : setExpressions) {
if (JavaClassHelper.getBoxedType(exprNodeSet.getForge().getEvaluationType()) != testIdentClass) {
continue;
}
if (exprNodeSet instanceof ExprIdentNode) {
ExprIdentNode setIdent = (ExprIdentNode) exprNodeSet;
addToList(setIdent.getStreamId(), setIdent, perStreamExprs);
} else {
EligibilityDesc eligibility = EligibilityUtil.verifyInputStream(exprNodeSet, indexedStream);
if (!eligibility.getEligibility().isEligible()) {
continue;
}
addToList(eligibility.getStreamNum(), exprNodeSet, perStreamExprs);
}
}
for (Map.Entry<Integer, List<ExprNode>> entry : perStreamExprs.entrySet()) {
ExprNode[] exprNodes = ExprNodeUtilityCore.toArray(entry.getValue());
if (entry.getKey() == null) {
queryGraph.addInSetSingleIndexUnkeyed(testIdent.getStreamId(), testIdent, exprNodes);
continue;
}
if (entry.getKey() != indexedStream) {
queryGraph.addInSetSingleIndex(testIdent.getStreamId(), testIdent, entry.getKey(), exprNodes);
}
}
}
示例4: analyzeEqualsNode
import com.espertech.esper.epl.join.util.EligibilityDesc; //导入依赖的package包/类
/**
* Analye EQUALS (=) node.
*
* @param equalsNode - node to analyze
* @param queryGraph - store relationships between stream properties
* @param isOuterJoin indicator for outer join
*/
protected static void analyzeEqualsNode(ExprEqualsNode equalsNode, QueryGraph queryGraph, boolean isOuterJoin) {
if ((equalsNode.getChildNodes()[0] instanceof ExprIdentNode) &&
(equalsNode.getChildNodes()[1] instanceof ExprIdentNode)) {
ExprIdentNode identNodeLeft = (ExprIdentNode) equalsNode.getChildNodes()[0];
ExprIdentNode identNodeRight = (ExprIdentNode) equalsNode.getChildNodes()[1];
if (identNodeLeft.getStreamId() != identNodeRight.getStreamId()) {
queryGraph.addStrictEquals(identNodeLeft.getStreamId(), identNodeLeft.getResolvedPropertyName(), identNodeLeft,
identNodeRight.getStreamId(), identNodeRight.getResolvedPropertyName(), identNodeRight);
}
return;
}
if (isOuterJoin) { // outerjoins don't use constants or one-way expression-derived information to evaluate join
return;
}
// handle constant-compare or transformation case
int indexedStream = -1;
ExprIdentNode indexedPropExpr = null;
ExprNode exprNodeNoIdent = null;
if (equalsNode.getChildNodes()[0] instanceof ExprIdentNode) {
indexedPropExpr = (ExprIdentNode) equalsNode.getChildNodes()[0];
indexedStream = indexedPropExpr.getStreamId();
exprNodeNoIdent = equalsNode.getChildNodes()[1];
} else if (equalsNode.getChildNodes()[1] instanceof ExprIdentNode) {
indexedPropExpr = (ExprIdentNode) equalsNode.getChildNodes()[1];
indexedStream = indexedPropExpr.getStreamId();
exprNodeNoIdent = equalsNode.getChildNodes()[0];
}
if (indexedStream == -1) {
return; // require property of right/left side of equals
}
EligibilityDesc eligibility = EligibilityUtil.verifyInputStream(exprNodeNoIdent, indexedStream);
if (!eligibility.getEligibility().isEligible()) {
return;
}
if (eligibility.getEligibility() == Eligibility.REQUIRE_NONE) {
queryGraph.addUnkeyedExpression(indexedStream, indexedPropExpr, exprNodeNoIdent);
} else {
queryGraph.addKeyedExpression(indexedStream, indexedPropExpr, eligibility.getStreamNum(), exprNodeNoIdent);
}
}