Package com.espertech.esper.epl.spec

Examples of com.espertech.esper.epl.spec.ContextDetailHashItem


        // determine whether create-named-window
        boolean isCreateWindow = statementDesc.getStatement().getStatementSpec().getCreateWindowDesc() != null;
        if (!isCreateWindow) {
            for (FilterSpecCompiled filtersSpec : filtersSpecs) {

                ContextDetailHashItem foundPartition = findHashItemSpec(hashSpec, filtersSpec);
                if (foundPartition == null) {
                    continue;
                }

                List<FilterValueSetParam> addendumFilters = new ArrayList<FilterValueSetParam>();
                addendumFilters.addAll(foundPartition.getParametersCompiled());
                FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);
                addendumFilters.add(filter);

                List<FilterValueSetParam> existing = addendums.get(filtersSpec);
                if (existing == null) {
                    addendums.put(filtersSpec, addendumFilters);
                }
                else {
                    existing.addAll(addendumFilters);
                }
            }
        }
        // handle segmented context for create-window
        else {
            String declaredAsName = statementDesc.getStatement().getStatementSpec().getCreateWindowDesc().getAsEventTypeName();
            if (declaredAsName != null) {
                for (FilterSpecCompiled filterSpec : filtersSpecs) {

                    ContextDetailHashItem foundPartition = null;
                    for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
                        if (partitionItem.getFilterSpecCompiled().getFilterForEventType().getName().equals(declaredAsName)) {
                            foundPartition = partitionItem;
                            break;
                        }
                    }

                    if (foundPartition == null) {
                        continue;
                    }

                    FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);

                    List<FilterValueSetParam> existing = addendums.get(filterSpec);
                    if (existing == null) {
                        addendums.put(filterSpec, Collections.singletonList(filter));
                    }
View Full Code Here


            }
        }
    }

    public static ContextDetailHashItem findHashItemSpec(ContextDetailHash hashSpec, FilterSpecCompiled filterSpec) {
        ContextDetailHashItem foundPartition = null;
        for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
            boolean typeOrSubtype = EventTypeUtility.isTypeOrSubTypeOf(filterSpec.getFilterForEventType(), partitionItem.getFilterSpecCompiled().getFilterForEventType());
            if (typeOrSubtype) {
                foundPartition = partitionItem;
            }
View Full Code Here

        // determine whether create-named-window
        boolean isCreateWindow = statementDesc != null && statementDesc.getStatement().getStatementSpec().getCreateWindowDesc() != null;
        if (!isCreateWindow) {
            for (FilterSpecCompiled filtersSpec : filtersSpecs) {

                ContextDetailHashItem foundPartition = findHashItemSpec(hashSpec, filtersSpec);
                if (foundPartition == null) {
                    continue;
                }

                List<FilterValueSetParam> addendumFilters = new ArrayList<FilterValueSetParam>();
                addendumFilters.addAll(Arrays.asList(foundPartition.getParametersCompiled()));
                FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);
                addendumFilters.add(filter);

                FilterValueSetParam[] existing = addendums.get(filtersSpec);
                if (existing == null) {
                    addendums.put(filtersSpec, addendumFilters.toArray(new FilterValueSetParam[addendumFilters.size()]));
                }
                else {
                    existing = (FilterValueSetParam[]) CollectionUtil.arrayExpandAddElements(existing, addendumFilters);
                    addendums.put(filtersSpec, existing);
                }
            }
        }
        // handle segmented context for create-window
        else {
            String declaredAsName = statementDesc.getStatement().getStatementSpec().getCreateWindowDesc().getAsEventTypeName();
            if (declaredAsName != null) {
                for (FilterSpecCompiled filterSpec : filtersSpecs) {

                    ContextDetailHashItem foundPartition = null;
                    for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
                        if (partitionItem.getFilterSpecCompiled().getFilterForEventType().getName().equals(declaredAsName)) {
                            foundPartition = partitionItem;
                            break;
                        }
                    }

                    if (foundPartition == null) {
                        continue;
                    }

                    FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);

                    FilterValueSetParam[] existing = addendums.get(filterSpec);
                    if (existing == null) {
                        addendums.put(filterSpec, new FilterValueSetParam[] {filter});
                    }
View Full Code Here

            }
        }
    }

    public static ContextDetailHashItem findHashItemSpec(ContextDetailHash hashSpec, FilterSpecCompiled filterSpec) {
        ContextDetailHashItem foundPartition = null;
        for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
            boolean typeOrSubtype = EventTypeUtility.isTypeOrSubTypeOf(filterSpec.getFilterForEventType(), partitionItem.getFilterSpecCompiled().getFilterForEventType());
            if (typeOrSubtype) {
                foundPartition = partitionItem;
            }
View Full Code Here

        // determine whether create-named-window
        boolean isCreateWindow = statementDesc != null && statementDesc.getStatement().getStatementSpec().getCreateWindowDesc() != null;
        if (!isCreateWindow) {
            for (FilterSpecCompiled filtersSpec : filtersSpecs) {

                ContextDetailHashItem foundPartition = findHashItemSpec(hashSpec, filtersSpec);
                if (foundPartition == null) {
                    continue;
                }

                List<FilterValueSetParam> addendumFilters = new ArrayList<FilterValueSetParam>();
                addendumFilters.addAll(foundPartition.getParametersCompiled());
                FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);
                addendumFilters.add(filter);

                List<FilterValueSetParam> existing = addendums.get(filtersSpec);
                if (existing == null) {
                    addendums.put(filtersSpec, addendumFilters);
                }
                else {
                    existing.addAll(addendumFilters);
                }
            }
        }
        // handle segmented context for create-window
        else {
            String declaredAsName = statementDesc.getStatement().getStatementSpec().getCreateWindowDesc().getAsEventTypeName();
            if (declaredAsName != null) {
                for (FilterSpecCompiled filterSpec : filtersSpecs) {

                    ContextDetailHashItem foundPartition = null;
                    for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
                        if (partitionItem.getFilterSpecCompiled().getFilterForEventType().getName().equals(declaredAsName)) {
                            foundPartition = partitionItem;
                            break;
                        }
                    }

                    if (foundPartition == null) {
                        continue;
                    }

                    FilterValueSetParam filter = new FilterValueSetParamImpl(foundPartition.getLookupable(), FilterOperator.EQUAL, agentInstanceId);

                    List<FilterValueSetParam> existing = addendums.get(filterSpec);
                    if (existing == null) {
                        addendums.put(filterSpec, Collections.singletonList(filter));
                    }
View Full Code Here

            }
        }
    }

    public static ContextDetailHashItem findHashItemSpec(ContextDetailHash hashSpec, FilterSpecCompiled filterSpec) {
        ContextDetailHashItem foundPartition = null;
        for (ContextDetailHashItem partitionItem : hashSpec.getItems()) {
            boolean typeOrSubtype = EventTypeUtility.isTypeOrSubTypeOf(filterSpec.getFilterForEventType(), partitionItem.getFilterSpecCompiled().getFilterForEventType());
            if (typeOrSubtype) {
                foundPartition = partitionItem;
            }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.spec.ContextDetailHashItem

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.