com.espertech.esper.epl.core
Interface ResultSetProcessor

All Known Implementing Classes:
ResultSetProcessorAggregateAll, ResultSetProcessorAggregateGrouped, ResultSetProcessorBaseSimple, ResultSetProcessorHandThrough, ResultSetProcessorRowForAll, ResultSetProcessorRowPerGroup, ResultSetProcessorRowPerGroupRollup, ResultSetProcessorRowPerGroupRollupUnbound, ResultSetProcessorRowPerGroupUnbound, ResultSetProcessorSimple

public interface ResultSetProcessor

Processor for result sets coming from 2 sources. First, out of a simple view (no join). And second, out of a join of event streams. The processor must apply the select-clause, grou-by-clause and having-clauses as supplied. It must state what the event type of the result rows is.


Method Summary
 void applyJoinResult(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents)
           
 void applyViewResult(EventBean[] newData, EventBean[] oldData)
           
 void clear()
          Clear out current state.
 java.util.Iterator<EventBean> getIterator(java.util.Set<MultiKey<EventBean>> joinSet)
          Returns the iterator for iterating over a join-result.
 java.util.Iterator<EventBean> getIterator(Viewable parent)
          Returns the iterator implementing the group-by and aggregation and order-by logic specific to each case of use of these construct.
 EventType getResultEventType()
          Returns the event type of processed results.
 boolean hasAggregation()
           
 UniformPair<EventBean[]> processJoinResult(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents, boolean isSynthesize)
          For use by joins posting their result, process the event rows that are entered and removed (new and old events).
 UniformPair<EventBean[]> processOutputLimitedJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinEventsSet, boolean generateSynthetic, OutputLimitLimitType outputLimitLimitType)
          Processes batched events in case of output-rate limiting.
 UniformPair<EventBean[]> processOutputLimitedView(java.util.List<UniformPair<EventBean[]>> viewEventsList, boolean generateSynthetic, OutputLimitLimitType outputLimitLimitType)
          Processes batched events in case of output-rate limiting.
 UniformPair<EventBean[]> processViewResult(EventBean[] newData, EventBean[] oldData, boolean isSynthesize)
          For use by views posting their result, process the event rows that are entered and removed (new and old events).
 void setAgentInstanceContext(AgentInstanceContext context)
           
 

Method Detail

getResultEventType

EventType getResultEventType()
Returns the event type of processed results.

Returns:
event type of the resulting events posted by the processor.

processViewResult

UniformPair<EventBean[]> processViewResult(EventBean[] newData,
                                           EventBean[] oldData,
                                           boolean isSynthesize)
For use by views posting their result, process the event rows that are entered and removed (new and old events). Processes according to select-clauses, group-by clauses and having-clauses and returns new events and old events as specified.

Parameters:
newData - - new events posted by view
oldData - - old events posted by view
isSynthesize - - set to true to indicate that synthetic events are required for an iterator result set
Returns:
pair of new events and old events

processJoinResult

UniformPair<EventBean[]> processJoinResult(java.util.Set<MultiKey<EventBean>> newEvents,
                                           java.util.Set<MultiKey<EventBean>> oldEvents,
                                           boolean isSynthesize)
For use by joins posting their result, process the event rows that are entered and removed (new and old events). Processes according to select-clauses, group-by clauses and having-clauses and returns new events and old events as specified.

Parameters:
newEvents - - new events posted by join
oldEvents - - old events posted by join
isSynthesize - - set to true to indicate that synthetic events are required for an iterator result set
Returns:
pair of new events and old events

getIterator

java.util.Iterator<EventBean> getIterator(Viewable parent)
Returns the iterator implementing the group-by and aggregation and order-by logic specific to each case of use of these construct.

Parameters:
parent - is the parent view iterator
Returns:
event iterator

getIterator

java.util.Iterator<EventBean> getIterator(java.util.Set<MultiKey<EventBean>> joinSet)
Returns the iterator for iterating over a join-result.

Parameters:
joinSet - is the join result set
Returns:
iterator over join results

clear

void clear()
Clear out current state.


processOutputLimitedJoin

UniformPair<EventBean[]> processOutputLimitedJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinEventsSet,
                                                  boolean generateSynthetic,
                                                  OutputLimitLimitType outputLimitLimitType)
Processes batched events in case of output-rate limiting.

Parameters:
joinEventsSet - the join results
generateSynthetic - flag to indicate whether synthetic events must be generated
outputLimitLimitType - the type of output rate limiting
Returns:
results for dispatch

processOutputLimitedView

UniformPair<EventBean[]> processOutputLimitedView(java.util.List<UniformPair<EventBean[]>> viewEventsList,
                                                  boolean generateSynthetic,
                                                  OutputLimitLimitType outputLimitLimitType)
Processes batched events in case of output-rate limiting.

Parameters:
viewEventsList - the view results
generateSynthetic - flag to indicate whether synthetic events must be generated
outputLimitLimitType - the type of output rate limiting
Returns:
results for dispatch

hasAggregation

boolean hasAggregation()

setAgentInstanceContext

void setAgentInstanceContext(AgentInstanceContext context)

applyViewResult

void applyViewResult(EventBean[] newData,
                     EventBean[] oldData)

applyJoinResult

void applyJoinResult(java.util.Set<MultiKey<EventBean>> newEvents,
                     java.util.Set<MultiKey<EventBean>> oldEvents)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com