Package com.espertech.esper.epl.lookup

Examples of com.espertech.esper.epl.lookup.SubordPropRangeKey


public class SortedAccessStrategyFactory {

    public static SortedAccessStrategy make(boolean isNWOnTrigger, int lookupStream, int numStreams, QueryGraphValueEntryRange rangeKeyPair, Class coercionType)
    {
        return make(isNWOnTrigger, lookupStream, numStreams, new SubordPropRangeKey(rangeKeyPair, coercionType));
    }
View Full Code Here


        Class[] coercionTypes = new Class[rangeProps.size()];
        boolean mustCoerce = false;
        int count = 0;
        for (Map.Entry<String, SubordPropRangeKey> entry : rangeProps.entrySet())
        {
            SubordPropRangeKey subQRange = entry.getValue();
            QueryGraphValueEntryRange rangeDesc = entry.getValue().getRangeInfo();

            Class valuePropType = JavaClassHelper.getBoxedType(viewableEventType.getPropertyType(entry.getKey()));
            Class coercionType;
View Full Code Here

            queries.add(new CompositeIndexQueryKeyed(false, lookupStream, -1, hashKeys, keyCoercionTypes));
        }
        int count = 0;
        for (QueryGraphValueEntryRange rangeProp : rangeProps) {
            Class coercionType = rangeCoercionTypes == null ? null : rangeCoercionTypes[count];
            SubordPropRangeKey rkey = new SubordPropRangeKey(rangeProp, coercionType);
            queries.add(new CompositeIndexQueryRange(isNWOnTrigger, lookupStream, -1, rkey, coercionType));
            count++;
        }

        // Hook up as chain for remove
View Full Code Here

            ExprEvaluator evaluator = hashKey.getHashKey().getKeyExpr().getExprEvaluator();
            evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, hashKeyCoercionTypes.getCoercionTypes()[count]);
            count++;
        }
        for (int i = 0; i < rangeKeys.size(); i++) {
            SubordPropRangeKey rangeKey = rangeKeys.get(i);
            if (rangeKey.getRangeInfo().getType().isRange()) {
                QueryGraphValueEntryRangeIn range = (QueryGraphValueEntryRangeIn) rangeKey.getRangeInfo();
                ExprEvaluator evaluatorStart = range.getExprStart().getExprEvaluator();
                ExprEvaluator evaluatorEnd = range.getExprEnd().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorBtreeRange(evaluatorStart, evaluatorEnd, rangeKeyCoercionTypes.getCoercionTypes()[i]);
            }
            else {
                QueryGraphValueEntryRangeRelOp relOp = (QueryGraphValueEntryRangeRelOp) rangeKey.getRangeInfo();
                ExprEvaluator evaluator = relOp.getExpression().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, hashKeyCoercionTypes.getCoercionTypes()[i]);
            }
            count++;
        }
View Full Code Here

            queries.add(new CompositeIndexQueryKeyed(false, lookupStream, -1, hashKeys, keyCoercionTypes));
        }
        int count = 0;
        for (QueryGraphValueEntryRange rangeProp : rangeProps) {
            Class coercionType = rangeCoercionTypes == null ? null : rangeCoercionTypes[count];
            SubordPropRangeKey rkey = new SubordPropRangeKey(rangeProp, coercionType);
            queries.add(new CompositeIndexQueryRange(isNWOnTrigger, lookupStream, -1, rkey, coercionType, new ArrayList<String>()));
            count++;
        }

        // Hook up as chain for remove
View Full Code Here

            int count = -1;
            for (QueryGraphValueEntryRange rangeDesc : rangeDescs) {
                count++;
                String rangeIndexProp = rangeIndexes[count];

                SubordPropRangeKey subqRangeDesc = rangeProps.get(rangeIndexProp);

                // other streams may specify the start or end endpoint of a range, therefore this operation can be additive
                if (subqRangeDesc != null) {
                    if (subqRangeDesc.getRangeInfo().getType().isRange()) {
                        continue;
                    }

                    // see if we can make this additive by using a range
                    QueryGraphValueEntryRangeRelOp relOpOther = (QueryGraphValueEntryRangeRelOp) subqRangeDesc.getRangeInfo();
                    QueryGraphValueEntryRangeRelOp relOpThis = (QueryGraphValueEntryRangeRelOp) rangeDesc;

                    QueryGraphRangeConsolidateDesc opsDesc = QueryGraphRangeUtil.getCanConsolidate(relOpThis.getType(), relOpOther.getType());
                    if (opsDesc != null) {
                        ExprNode start;
                        ExprNode end;
                        int streamNumStart;
                        int streamNumEnd;
                        if (!opsDesc.isReverse()) {
                            start = relOpOther.getExpression();
                            end = relOpThis.getExpression();
                            streamNumEnd = stream;
                        }
                        else {
                            start = relOpThis.getExpression();
                            streamNumStart = stream;
                            end = relOpOther.getExpression();
                        }
                        boolean allowRangeReversal = relOpOther.isBetweenPart() && relOpThis.isBetweenPart();
                        QueryGraphValueEntryRangeIn rangeIn = new QueryGraphValueEntryRangeIn(opsDesc.getType(), start, end, allowRangeReversal);

                        Class indexedPropType = JavaClassHelper.getBoxedType(allStreamTypesZeroIndexed[0].getPropertyType(rangeIndexProp));
                        Class coercionType = indexedPropType;
                        Class proposedType = CoercionUtil.getCoercionTypeRangeIn(indexedPropType, rangeIn.getExprStart(), rangeIn.getExprEnd());
                        if (proposedType != null && proposedType != indexedPropType)
                        {
                            coercionType = proposedType;
                        }

                        subqRangeDesc = new SubordPropRangeKey(rangeIn, coercionType);
                        rangeProps.put(rangeIndexProp, subqRangeDesc);
                    }
                    // ignore
                    continue;
                }

                // an existing entry has not been found
                if (rangeDesc.getType().isRange()) {
                    QueryGraphValueEntryRangeIn rangeIn = (QueryGraphValueEntryRangeIn) rangeDesc;
                    Class indexedPropType = JavaClassHelper.getBoxedType(allStreamTypesZeroIndexed[0].getPropertyType(rangeIndexProp));
                    Class coercionType = indexedPropType;
                    Class proposedType = CoercionUtil.getCoercionTypeRangeIn(indexedPropType, rangeIn.getExprStart(), rangeIn.getExprEnd());
                    if (proposedType != null && proposedType != indexedPropType)
                    {
                        coercionType = proposedType;
                    }
                    subqRangeDesc = new SubordPropRangeKey(rangeDesc, coercionType);
                }
                else {
                    QueryGraphValueEntryRangeRelOp relOp = (QueryGraphValueEntryRangeRelOp) rangeDesc;
                    Class keyPropType = relOp.getExpression().getExprEvaluator().getType();
                    Class indexedPropType = JavaClassHelper.getBoxedType(allStreamTypesZeroIndexed[0].getPropertyType(rangeIndexProp));
                    Class coercionType = indexedPropType;
                    if (keyPropType != indexedPropType)
                    {
                        coercionType = JavaClassHelper.getCompareToCoercionType(keyPropType, indexedPropType);
                    }
                    subqRangeDesc = new SubordPropRangeKey(rangeDesc, coercionType);
                }
                rangeProps.put(rangeIndexProp, subqRangeDesc);
            }

        }
View Full Code Here

        Class[] coercionTypes = new Class[rangeProps.size()];
        boolean mustCoerce = false;
        int count = 0;
        for (Map.Entry<String, SubordPropRangeKey> entry : rangeProps.entrySet())
        {
            SubordPropRangeKey subQRange = entry.getValue();
            QueryGraphValueEntryRange rangeDesc = entry.getValue().getRangeInfo();

            Class valuePropType = JavaClassHelper.getBoxedType(viewableEventType.getPropertyType(entry.getKey()));
            Class coercionType;
View Full Code Here

            ExprEvaluator evaluator = hashKey.getHashKey().getKeyExpr().getExprEvaluator();
            evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, hashKeyCoercionTypes.getCoercionTypes()[count]);
            count++;
        }
        for (int i = 0; i < rangeKeys.size(); i++) {
            SubordPropRangeKey rangeKey = rangeKeys.get(i);
            if (rangeKey.getRangeInfo().getType().isRange()) {
                QueryGraphValueEntryRangeIn range = (QueryGraphValueEntryRangeIn) rangeKey.getRangeInfo();
                ExprEvaluator evaluatorStart = range.getExprStart().getExprEvaluator();
                ExprEvaluator evaluatorEnd = range.getExprEnd().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorBtreeRange(evaluatorStart, evaluatorEnd, rangeKeyCoercionTypes.getCoercionTypes()[i]);
            }
            else {
                QueryGraphValueEntryRangeRelOp relOp = (QueryGraphValueEntryRangeRelOp) rangeKey.getRangeInfo();
                ExprEvaluator evaluator = relOp.getExpression().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, rangeKeyCoercionTypes.getCoercionTypes()[i]);
            }
            count++;
        }
View Full Code Here

            queries.add(new CompositeIndexQueryKeyed(false, lookupStream, -1, hashKeys, keyCoercionTypes));
        }
        int count = 0;
        for (QueryGraphValueEntryRange rangeProp : rangeProps) {
            Class coercionType = rangeCoercionTypes == null ? null : rangeCoercionTypes[count];
            SubordPropRangeKey rkey = new SubordPropRangeKey(rangeProp, coercionType);
            queries.add(new CompositeIndexQueryRange(isNWOnTrigger, lookupStream, -1, rkey, coercionType, new ArrayList<String>()));
            count++;
        }

        // Hook up as chain for remove
View Full Code Here

            ExprEvaluator evaluator = hashKey.getHashKey().getKeyExpr().getExprEvaluator();
            evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, hashKeyCoercionTypes.getCoercionTypes()[count]);
            count++;
        }
        for (int i = 0; i < rangeKeys.size(); i++) {
            SubordPropRangeKey rangeKey = rangeKeys.get(i);
            if (rangeKey.getRangeInfo().getType().isRange()) {
                QueryGraphValueEntryRangeIn range = (QueryGraphValueEntryRangeIn) rangeKey.getRangeInfo();
                ExprEvaluator evaluatorStart = range.getExprStart().getExprEvaluator();
                ExprEvaluator evaluatorEnd = range.getExprEnd().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorBtreeRange(evaluatorStart, evaluatorEnd, rangeKeyCoercionTypes.getCoercionTypes()[i]);
            }
            else {
                QueryGraphValueEntryRangeRelOp relOp = (QueryGraphValueEntryRangeRelOp) rangeKey.getRangeInfo();
                ExprEvaluator evaluator = relOp.getExpression().getExprEvaluator();
                evaluators[count] = new ExternalEvaluatorHashRelOp(evaluator, hashKeyCoercionTypes.getCoercionTypes()[i]);
            }
            count++;
        }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.lookup.SubordPropRangeKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.