本文整理汇总了Java中com.espertech.esper.epl.join.util.EligibilityDesc.getEligibility方法的典型用法代码示例。如果您正苦于以下问题:Java EligibilityDesc.getEligibility方法的具体用法?Java EligibilityDesc.getEligibility怎么用?Java EligibilityDesc.getEligibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.epl.join.util.EligibilityDesc
的用法示例。
在下文中一共展示了EligibilityDesc.getEligibility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}