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


Java ArrayEventIterator类代码示例

本文整理汇总了Java中com.espertech.esper.collection.ArrayEventIterator的典型用法代码示例。如果您正苦于以下问题:Java ArrayEventIterator类的具体用法?Java ArrayEventIterator怎么用?Java ArrayEventIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ArrayEventIterator类属于com.espertech.esper.collection包,在下文中一共展示了ArrayEventIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> iterator() {
    if (tailView.getRevisionProcessor() != null) {
        Collection<EventBean> coll = tailView.getRevisionProcessor().getSnapshot(agentInstanceContext.getEpStatementAgentInstanceHandle(), parent);
        return coll.iterator();
    }

    agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().acquireReadLock();
    try {
        Iterator<EventBean> it = parent.iterator();
        if (!it.hasNext()) {
            return CollectionUtil.NULL_EVENT_ITERATOR;
        }
        ArrayList<EventBean> list = new ArrayList<EventBean>();
        while (it.hasNext()) {
            list.add(it.next());
        }
        return new ArrayEventIterator(list.toArray(new EventBean[list.size()]));
    } finally {
        agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().releaseReadLock();
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:NamedWindowTailViewInstance.java

示例2: getIterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> getIterator(Set<MultiKey<EventBean>> joinSet) {
    EventBean[] result;
    if (prototype.getOptionalHavingNode() == null) {
        if (orderByProcessor == null) {
            result = ResultSetProcessorUtil.getSelectJoinEventsNoHaving(selectExprProcessor, joinSet, true, true, exprEvaluatorContext);
        } else {
            result = ResultSetProcessorUtil.getSelectJoinEventsNoHavingWithOrderBy(aggregationService, selectExprProcessor, orderByProcessor, joinSet, true, true, exprEvaluatorContext);
        }
    } else {
        if (orderByProcessor == null) {
            result = ResultSetProcessorUtil.getSelectJoinEventsHaving(selectExprProcessor, joinSet, prototype.getOptionalHavingNode(), true, true, exprEvaluatorContext);
        } else {
            result = ResultSetProcessorUtil.getSelectJoinEventsHavingWithOrderBy(aggregationService, selectExprProcessor, orderByProcessor, joinSet, prototype.getOptionalHavingNode(), true, true, exprEvaluatorContext);
        }
    }
    return new ArrayEventIterator(result);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:18,代码来源:ResultSetProcessorRowPerEventImpl.java

示例3: iteratorCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public static CodegenExpression iteratorCodegen(int slot, CodegenClassScope classScope, CodegenMethodNode parentMethod, CodegenNamedMethods namedMethods) {
    CodegenMethodNode initArray = initArrayCodegen(slot, namedMethods, classScope);
    CodegenMethodNode method = parentMethod.makeChildWithScope(Iterator.class, AggregationStateLinearJoinImpl.class, CodegenSymbolProviderEmpty.INSTANCE, classScope);
    method.getBlock().ifRefNull(refCol("array", slot))
            .localMethod(initArray)
            .blockEnd()
            .methodReturn(newInstance(ArrayEventIterator.class, refCol("array", slot)));
    return localMethod(method);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:AggregationStateLinearJoinImpl.java

示例4: getIteratorJoinCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public static void getIteratorJoinCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance) {
    CodegenMethodNode generateGroupKeyArrayJoin = generateGroupKeyArrayJoinTakingMapCodegen(forge, classScope, instance);
    CodegenMethodNode generateOutputEventsJoin = generateOutputEventsJoinCodegen(forge, classScope, instance);
    method.getBlock()
            .declareVar(Map.class, "keysAndEvents", newInstance(HashMap.class))
            .expression(localMethod(generateGroupKeyArrayJoin, REF_JOINSET, ref("keysAndEvents"), constantTrue()))
            .declareVar(EventBean[].class, "selectNewEvents", localMethod(generateOutputEventsJoin, ref("keysAndEvents"), constantTrue(), constantTrue()))
            .methodReturn(newInstance(ArrayEventIterator.class, ref("selectNewEvents")));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:ResultSetProcessorRowPerGroupImpl.java

示例5: obtainIterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
private Iterator<EventBean> obtainIterator(Viewable parent) {
    resetEventPerGroupBufView();
    EventBean[] events = CollectionUtil.iteratorToArrayEvents(parent.iterator());
    generateGroupKeysView(events, eventPerGroupBufView, true);
    EventBean[] output = generateOutputEventsView(eventPerGroupBufView, true, true);
    return new ArrayEventIterator(output);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:ResultSetProcessorRowPerGroupRollupImpl.java

示例6: obtainIteratorCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
private static CodegenMethodNode obtainIteratorCodegen(ResultSetProcessorRowPerGroupRollupForge forge, CodegenClassScope classScope, CodegenMethodNode parent, CodegenInstanceAux instance) {
    CodegenMethodNode resetEventPerGroupBufView = resetEventPerGroupBufCodegen(NAME_EVENTPERGROUPBUFVIEW, classScope, instance);
    CodegenMethodNode generateGroupKeysView = generateGroupKeysViewCodegen(forge, classScope, instance);
    CodegenMethodNode generateOutputEventsView = generateOutputEventsViewCodegen(forge, classScope, instance);

    CodegenMethodNode iterator = parent.makeChild(Iterator.class, ResultSetProcessorRowPerGroupRollupImpl.class, classScope).addParam(Viewable.class, NAME_VIEWABLE);
    iterator.getBlock().localMethod(resetEventPerGroupBufView)
            .declareVar(EventBean[].class, "events", staticMethod(CollectionUtil.class, METHOD_ITERATORTOARRAYEVENTS, exprDotMethod(REF_VIEWABLE, "iterator")))
            .localMethod(generateGroupKeysView, ref("events"), ref(NAME_EVENTPERGROUPBUFVIEW), constantTrue())
            .declareVar(EventBean[].class, "output", localMethod(generateOutputEventsView, ref(NAME_EVENTPERGROUPBUFVIEW), constantTrue(), constantTrue()))
            .methodReturn(newInstance(ArrayEventIterator.class, ref("output")));
    return iterator;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:14,代码来源:ResultSetProcessorRowPerGroupRollupImpl.java

示例7: getIteratorJoinCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
static void getIteratorJoinCodegen(ResultSetProcessorRowPerGroupRollupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance) {
    CodegenMethodNode generateGroupKeysJoin = generateGroupKeysJoinCodegen(forge, classScope, instance);
    CodegenMethodNode generateOutputEventsJoin = generateOutputEventsJoinCodegen(forge, classScope, instance);
    CodegenMethodNode resetEventPerGroupBuf = resetEventPerGroupBufCodegen(NAME_EVENTPERGROUPBUFJOIN, classScope, instance);
    method.getBlock().localMethod(resetEventPerGroupBuf)
            .localMethod(generateGroupKeysJoin, REF_JOINSET, ref(NAME_EVENTPERGROUPBUFJOIN), constantTrue())
            .declareVar(EventBean[].class, "output", localMethod(generateOutputEventsJoin, ref(NAME_EVENTPERGROUPBUFJOIN), constantTrue(), constantTrue()))
            .methodReturn(newInstance(ArrayEventIterator.class, ref("output")));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:ResultSetProcessorRowPerGroupRollupImpl.java

示例8: getIterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> getIterator(Viewable parent) {
    if (orderByProcessor == null) {
        // Return an iterator that gives row-by-row a result
        return new TransformEventIterator(parent.iterator(), new ResultSetProcessorHandtruTransform(this));
    }

    // Pull all events, generate order keys
    EventBean[] eventsPerStream = new EventBean[1];
    List<EventBean> events = new ArrayList<>();
    List<Object> orderKeys = new ArrayList<>();
    Iterator parentIterator = parent.iterator();
    if (parentIterator == null) {
        return CollectionUtil.NULL_EVENT_ITERATOR;
    }
    for (EventBean aParent : parent) {
        eventsPerStream[0] = aParent;
        Object orderKey = orderByProcessor.getSortKey(eventsPerStream, true, exprEvaluatorContext);

        EventBean[] result;
        if (prototype.getOptionalHavingNode() == null) {
            // ignore orderByProcessor
            result = ResultSetProcessorUtil.getSelectEventsNoHaving(selectExprProcessor, eventsPerStream, true, true, exprEvaluatorContext);
        } else {
            // ignore orderByProcessor
            result = ResultSetProcessorUtil.getSelectEventsHaving(selectExprProcessor, eventsPerStream, prototype.getOptionalHavingNode(), true, true, exprEvaluatorContext);
        }
        if (result != null && result.length != 0) {
            events.add(result[0]);
            orderKeys.add(orderKey);
        }
    }

    // sort
    EventBean[] outgoingEvents = CollectionUtil.toArrayEvents(events);
    Object[] orderKeysArr = CollectionUtil.toArrayObjects(orderKeys);
    EventBean[] orderedEvents = orderByProcessor.sortWOrderKeys(outgoingEvents, orderKeysArr, exprEvaluatorContext);

    return new ArrayEventIterator(orderedEvents);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:40,代码来源:ResultSetProcessorSimpleImpl.java

示例9: getIteratorViewCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public static void getIteratorViewCodegen(ResultSetProcessorSimpleForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance) {
    if (!forge.isSorting()) {
        // Return an iterator that gives row-by-row a result
        method.getBlock().methodReturn(newInstance(TransformEventIterator.class, exprDotMethod(REF_VIEWABLE, "iterator"), newInstance(ResultSetProcessorHandtruTransform.class, ref("this"))));
        return;
    }

    // Pull all events, generate order keys
    method.getBlock().declareVar(EventBean[].class, "eventsPerStream", newArrayByLength(EventBean.class, constant(1)))
            .declareVar(List.class, "events", newInstance(ArrayList.class))
            .declareVar(List.class, "orderKeys", newInstance(ArrayList.class))
            .declareVar(Iterator.class, "parentIterator", exprDotMethod(REF_VIEWABLE, "iterator"))
            .ifCondition(equalsNull(ref("parentIterator"))).blockReturn(publicConstValue(CollectionUtil.class, "NULL_EVENT_ITERATOR"));

    {
        CodegenBlock loop = method.getBlock().forEach(EventBean.class, "aParent", REF_VIEWABLE);
        loop.assignArrayElement("eventsPerStream", constant(0), ref("aParent"))
                .declareVar(Object.class, "orderKey", exprDotMethod(REF_ORDERBYPROCESSOR, "getSortKey", ref("eventsPerStream"), constantTrue(), REF_AGENTINSTANCECONTEXT));

        if (forge.getOptionalHavingNode() == null) {
            loop.declareVar(EventBean[].class, "result", staticMethod(ResultSetProcessorUtil.class, METHOD_GETSELECTEVENTSNOHAVING, REF_SELECTEXPRPROCESSOR, ref("eventsPerStream"), constantTrue(), constantTrue(), REF_AGENTINSTANCECONTEXT));
        } else {
            CodegenMethodNode select = ResultSetProcessorUtil.getSelectEventsHavingCodegen(classScope, instance);
            loop.declareVar(EventBean[].class, "result", localMethod(select, REF_SELECTEXPRNONMEMBER, ref("eventsPerStream"), constantTrue(), constantTrue(), REF_AGENTINSTANCECONTEXT));
        }

        loop.ifCondition(and(notEqualsNull(ref("result")), not(equalsIdentity(arrayLength(ref("result")), constant(0)))))
                .exprDotMethod(ref("events"), "add", arrayAtIndex(ref("result"), constant(0)))
                .exprDotMethod(ref("orderKeys"), "add", ref("orderKey"));
    }

    method.getBlock().declareVar(EventBean[].class, "outgoingEvents", staticMethod(CollectionUtil.class, METHOD_TOARRAYEVENTS, ref("events")))
            .declareVar(Object[].class, "orderKeysArr", staticMethod(CollectionUtil.class, METHOD_TOARRAYOBJECTS, ref("orderKeys")))
            .declareVar(EventBean[].class, "orderedEvents", exprDotMethod(REF_ORDERBYPROCESSOR, "sortWOrderKeys", ref("outgoingEvents"), ref("orderKeysArr"), REF_AGENTINSTANCECONTEXT))
            .methodReturn(newInstance(ArrayEventIterator.class, ref("orderedEvents")));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:37,代码来源:ResultSetProcessorSimpleImpl.java

示例10: getIteratorJoinCodegen

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public static void getIteratorJoinCodegen(ResultSetProcessorAggregateGroupedForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance) {
    CodegenMethodNode generateGroupKeyArrayJoin = generateGroupKeyArrayJoinCodegen(forge.getGroupKeyNodeExpressions(), classScope, instance);
    CodegenMethodNode generateOutputEventsJoin = generateOutputEventsJoinCodegen(forge, classScope, instance);

    method.getBlock().declareVar(Object[].class, "groupByKeys", localMethod(generateGroupKeyArrayJoin, REF_JOINSET, constantTrue()))
            .declareVar(EventBean[].class, "result", localMethod(generateOutputEventsJoin, REF_JOINSET, ref("groupByKeys"), constantTrue(), constantTrue()))
            .methodReturn(newInstance(ArrayEventIterator.class, ref("result")));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ResultSetProcessorAggregateGroupedImpl.java

示例11: iterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public final Iterator<EventBean> iterator()
{
    if (lastInsertedEvents != null)
    {
        return new ArrayEventIterator(lastInsertedEvents);
    }
    return new SingleEventIterator(lastInsertedEvent);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ZeroDepthStream.java

示例12: iterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> iterator()
{
    if (tailView.getRevisionProcessor() != null)
    {
        Collection<EventBean> coll = tailView.getRevisionProcessor().getSnapshot(agentInstanceContext.getEpStatementAgentInstanceHandle(), parent);
        return coll.iterator();
    }

    agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().acquireReadLock();
    try
    {
        Iterator<EventBean> it = parent.iterator();
        if (!it.hasNext())
        {
            return CollectionUtil.NULL_EVENT_ITERATOR;
        }
        ArrayList<EventBean> list = new ArrayList<EventBean>();
        while (it.hasNext())
        {
            list.add(it.next());
        }
        return new ArrayEventIterator(list.toArray(new EventBean[list.size()]));
    }
    finally
    {
        agentInstanceContext.getEpStatementAgentInstanceHandle().getStatementAgentInstanceLock().releaseReadLock();
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:29,代码来源:NamedWindowTailViewInstance.java

示例13: iterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> iterator()
{
    if (array == null) {
        initArray();
    }
    return new ArrayEventIterator(array);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:8,代码来源:AggregationAccessJoinImpl.java

示例14: getIterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> getIterator(Set<MultiKey<EventBean>> joinSet)
{
    Map<Object, EventBean[]> keysAndEvents = new HashMap<Object, EventBean[]>();
    generateGroupKeys(joinSet, keysAndEvents, true);
    EventBean[] selectNewEvents = generateOutputEventsJoin(keysAndEvents, true, true);
    return new ArrayEventIterator(selectNewEvents);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:8,代码来源:ResultSetProcessorRowPerGroup.java

示例15: getIterator

import com.espertech.esper.collection.ArrayEventIterator; //导入依赖的package包/类
public Iterator<EventBean> getIterator(Viewable parent)
{
    if (orderByProcessor == null)
    {
        return new ResultSetAggregateGroupedIterator(parent.iterator(), this, aggregationService,agentInstanceContext);
    }

    // Pull all parent events, generate order keys
    EventBean[] eventsPerStream = new EventBean[1];
    List<EventBean> outgoingEvents = new ArrayList<EventBean>();
    List<Object> orderKeys = new ArrayList<Object>();

    for (EventBean candidate : parent) {
        eventsPerStream[0] = candidate;

        Object groupKey = generateGroupKey(eventsPerStream, true);
        aggregationService.setCurrentAccess(groupKey, agentInstanceContext.getAgentInstanceId());

        Boolean pass = true;
        if (prototype.getOptionalHavingNode() != null) {
            pass = (Boolean) prototype.getOptionalHavingNode().evaluate(eventsPerStream, true, agentInstanceContext);
        }
        if ((pass == null) || (!pass))
        {
            continue;
        }

        outgoingEvents.add(selectExprProcessor.process(eventsPerStream, true, true, agentInstanceContext));

        Object orderKey = orderByProcessor.getSortKey(eventsPerStream, true, agentInstanceContext);
        orderKeys.add(orderKey);
    }

    // sort
    EventBean[] outgoingEventsArr = outgoingEvents.toArray(new EventBean[outgoingEvents.size()]);
    Object[] orderKeysArr = orderKeys.toArray(new Object[orderKeys.size()]);
    EventBean[] orderedEvents = orderByProcessor.sort(outgoingEventsArr, orderKeysArr, agentInstanceContext);

    return new ArrayEventIterator(orderedEvents);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:41,代码来源:ResultSetProcessorAggregateGrouped.java


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