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


Java EligibilityDesc类代码示例

本文整理汇总了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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:40,代码来源:FilterExprAnalyzer.java

示例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);
        }
    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:58,代码来源:FilterExprAnalyzer.java

示例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);
            }
        }
    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:44,代码来源:FilterExprAnalyzer.java

示例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);
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:54,代码来源:FilterExprAnalyzer.java


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