Package com.espertech.esper.core.service

Examples of com.espertech.esper.core.service.EPPreparedQueryResult


            if (processorInstance != null) {
                EventBean[] rows = executor.execute(processorInstance);
                if (rows.length > 0) {
                    dispatch();
                }
                return new EPPreparedQueryResult(processor.getNamedWindowType(), rows);
            }
        }

        // context partition runtime query
        Collection<Integer> agentInstanceIds = EPPreparedExecuteMethodHelper.getAgentInstanceIds(processor, optionalSingleSelector, services.getContextManagementService(), processor.getContextName());

        // collect events and agent instances
        if (agentInstanceIds.isEmpty()) {
            return new EPPreparedQueryResult(processor.getNamedWindowType(), CollectionUtil.EVENT_PER_STREAM_EMPTY);
        }

        if (agentInstanceIds.size() == 1) {
            int agentInstanceId = agentInstanceIds.iterator().next();
            NamedWindowProcessorInstance processorInstance = processor.getProcessorInstance(agentInstanceId);
            EventBean[] rows = executor.execute(processorInstance);
            if (rows.length > 0) {
                dispatch();
            }
            return new EPPreparedQueryResult(processor.getNamedWindowType(), rows);
        }

        ArrayDeque<EventBean> allRows = new ArrayDeque<EventBean>();
        for (int agentInstanceId : agentInstanceIds) {
            NamedWindowProcessorInstance processorInstance = processor.getProcessorInstance(agentInstanceId);
            if (processorInstance != null) {
                EventBean[] rows = executor.execute(processorInstance);
                allRows.addAll(Arrays.asList(rows));
            }
        }
        if (allRows.size() > 0) {
            dispatch();
        }
        return new EPPreparedQueryResult(processor.getNamedWindowType(), allRows.toArray(new EventBean[allRows.size()]));
    }
View Full Code Here


            UniformPair<EventBean[]> results = resultSetProcessor.processViewResult(rows, null, true);
            if (results != null && results.getFirst() != null && results.getFirst().length > 0) {
                events.add(results.getFirst());
            }
        }
        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), EventBeanUtility.flatten(events));
    }
View Full Code Here

        if (statementSpec.getSelectClauseSpec().isDistinct())
        {
            results.setFirst(EventBeanUtility.getDistinctByProp(results.getFirst(), eventBeanReader));
        }

        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), results.getFirst());
    }
View Full Code Here

        if (statementSpec.getSelectClauseSpec().isDistinct())
        {
            results.setFirst(EventBeanUtility.getDistinctByProp(results.getFirst(), eventBeanReader));
        }

        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), results.getFirst());
    }
View Full Code Here

            UniformPair<EventBean[]> results = resultSetProcessor.processViewResult(rows, null, true);
            if (results != null && results.getFirst() != null && results.getFirst().length > 0) {
                events.add(results.getFirst());
            }
        }
        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), EventBeanUtility.flatten(events));
    }
View Full Code Here

        if (statementSpec.getSelectClauseSpec().isDistinct())
        {
            results.setFirst(EventBeanUtility.getDistinctByProp(results.getFirst(), eventBeanReader));
        }

        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), results.getFirst());
    }
View Full Code Here

            UniformPair<EventBean[]> results = resultSetProcessor.processViewResult(rows, null, true);
            if (results != null && results.getFirst() != null && results.getFirst().length > 0) {
                events.add(results.getFirst());
            }
        }
        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), EventBeanUtility.flatten(events));
    }
View Full Code Here

        if (statementSpec.getSelectClauseSpec().isDistinct())
        {
            results.setFirst(EventBeanUtility.getDistinctByProp(results.getFirst(), eventBeanReader));
        }

        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), results.getFirst());
    }
View Full Code Here

            UniformPair<EventBean[]> results = resultSetProcessor.processViewResult(rows, null, true);
            if (results != null && results.getFirst() != null && results.getFirst().length > 0) {
                events.add(results.getFirst());
            }
        }
        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), EventBeanUtility.flatten(events));
    }
View Full Code Here

        if (statementSpec.getSelectClauseSpec().isDistinct())
        {
            results.setFirst(EventBeanUtility.getDistinctByProp(results.getFirst(), eventBeanReader));
        }

        return new EPPreparedQueryResult(resultSetProcessor.getResultEventType(), results.getFirst());
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.core.service.EPPreparedQueryResult

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.