com.espertech.esper.epl.core
Class ResultSetProcessorRowPerGroupRollup

java.lang.Object
  extended by com.espertech.esper.epl.core.ResultSetProcessorRowPerGroupRollup
All Implemented Interfaces:
AggregationRowRemovedCallback, ResultSetProcessor, StopCallback
Direct Known Subclasses:
ResultSetProcessorRowPerGroupRollupUnbound

public class ResultSetProcessorRowPerGroupRollup
extends java.lang.Object
implements ResultSetProcessor, AggregationRowRemovedCallback


Field Summary
protected  AgentInstanceContext agentInstanceContext
           
protected  AggregationService aggregationService
           
protected  OrderByProcessor orderByProcessor
           
protected  ResultSetProcessorRowPerGroupRollupFactory prototype
           
 
Constructor Summary
ResultSetProcessorRowPerGroupRollup(ResultSetProcessorRowPerGroupRollupFactory prototype, OrderByProcessor orderByProcessor, AggregationService aggregationService, AgentInstanceContext agentInstanceContext)
           
 
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.
 UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedJoin(boolean isSynthesize, boolean isAll)
           
 UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedView(boolean isSynthesize, boolean isAll)
           
 java.lang.Object generateGroupKey(EventBean[] eventsPerStream, boolean isNewData)
           
protected  java.lang.Object[][] generateGroupKeysView(EventBean[] events, java.util.Map<java.lang.Object,EventBean>[] eventPerKey, boolean isNewData)
           
 void generateOutputBatched(boolean join, java.lang.Object mk, AggregationGroupByRollupLevel level, EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize, java.util.List<EventBean> resultEvents, java.util.List<java.lang.Object> optSortKeys)
           
 void generateOutputBatchedMapUnsorted(boolean join, java.lang.Object mk, AggregationGroupByRollupLevel level, EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize, java.util.Map<java.lang.Object,EventBean> resultEvents)
           
protected  EventBean[] generateOutputEventsView(java.util.Map<java.lang.Object,EventBean>[] keysAndEvents, boolean isNewData, boolean isSynthesize)
           
 AggregationService getAggregationService()
           
 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.
 void processOutputLimitedLastAllNonBufferedJoin(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents, boolean isGenerateSynthetic, boolean isAll)
           
 void processOutputLimitedLastAllNonBufferedView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic, boolean isAll)
           
 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 removed(java.lang.Object key)
           
 void setAgentInstanceContext(AgentInstanceContext agentInstanceContext)
           
 void stop()
          Stops the underlying resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prototype

protected final ResultSetProcessorRowPerGroupRollupFactory prototype

orderByProcessor

protected final OrderByProcessor orderByProcessor

aggregationService

protected final AggregationService aggregationService

agentInstanceContext

protected AgentInstanceContext agentInstanceContext
Constructor Detail

ResultSetProcessorRowPerGroupRollup

public ResultSetProcessorRowPerGroupRollup(ResultSetProcessorRowPerGroupRollupFactory prototype,
                                           OrderByProcessor orderByProcessor,
                                           AggregationService aggregationService,
                                           AgentInstanceContext agentInstanceContext)
Method Detail

setAgentInstanceContext

public void setAgentInstanceContext(AgentInstanceContext agentInstanceContext)
Specified by:
setAgentInstanceContext in interface ResultSetProcessor

getAggregationService

public AggregationService getAggregationService()

getResultEventType

public EventType getResultEventType()
Description copied from interface: ResultSetProcessor
Returns the event type of processed results.

Specified by:
getResultEventType in interface ResultSetProcessor
Returns:
event type of the resulting events posted by the processor.

processJoinResult

public UniformPair<EventBean[]> processJoinResult(java.util.Set<MultiKey<EventBean>> newEvents,
                                                  java.util.Set<MultiKey<EventBean>> oldEvents,
                                                  boolean isSynthesize)
Description copied from interface: ResultSetProcessor
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.

Specified by:
processJoinResult in interface ResultSetProcessor
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

processViewResult

public UniformPair<EventBean[]> processViewResult(EventBean[] newData,
                                                  EventBean[] oldData,
                                                  boolean isSynthesize)
Description copied from interface: ResultSetProcessor
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.

Specified by:
processViewResult in interface ResultSetProcessor
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

generateOutputEventsView

protected EventBean[] generateOutputEventsView(java.util.Map<java.lang.Object,EventBean>[] keysAndEvents,
                                               boolean isNewData,
                                               boolean isSynthesize)

getIterator

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

Specified by:
getIterator in interface ResultSetProcessor
Parameters:
parent - is the parent view iterator
Returns:
event iterator

getIterator

public java.util.Iterator<EventBean> getIterator(java.util.Set<MultiKey<EventBean>> joinSet)
Description copied from interface: ResultSetProcessor
Returns the iterator for iterating over a join-result.

Specified by:
getIterator in interface ResultSetProcessor
Parameters:
joinSet - is the join result set
Returns:
iterator over join results

clear

public void clear()
Description copied from interface: ResultSetProcessor
Clear out current state.

Specified by:
clear in interface ResultSetProcessor

processOutputLimitedJoin

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

Specified by:
processOutputLimitedJoin in interface ResultSetProcessor
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

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

Specified by:
processOutputLimitedView in interface ResultSetProcessor
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

public boolean hasAggregation()
Specified by:
hasAggregation in interface ResultSetProcessor

removed

public void removed(java.lang.Object key)
Specified by:
removed in interface AggregationRowRemovedCallback

generateGroupKey

public java.lang.Object generateGroupKey(EventBean[] eventsPerStream,
                                         boolean isNewData)

generateOutputBatched

public void generateOutputBatched(boolean join,
                                  java.lang.Object mk,
                                  AggregationGroupByRollupLevel level,
                                  EventBean[] eventsPerStream,
                                  boolean isNewData,
                                  boolean isSynthesize,
                                  java.util.List<EventBean> resultEvents,
                                  java.util.List<java.lang.Object> optSortKeys)

generateOutputBatchedMapUnsorted

public void generateOutputBatchedMapUnsorted(boolean join,
                                             java.lang.Object mk,
                                             AggregationGroupByRollupLevel level,
                                             EventBean[] eventsPerStream,
                                             boolean isNewData,
                                             boolean isSynthesize,
                                             java.util.Map<java.lang.Object,EventBean> resultEvents)

generateGroupKeysView

protected java.lang.Object[][] generateGroupKeysView(EventBean[] events,
                                                     java.util.Map<java.lang.Object,EventBean>[] eventPerKey,
                                                     boolean isNewData)

applyViewResult

public void applyViewResult(EventBean[] newData,
                            EventBean[] oldData)
Specified by:
applyViewResult in interface ResultSetProcessor

applyJoinResult

public void applyJoinResult(java.util.Set<MultiKey<EventBean>> newEvents,
                            java.util.Set<MultiKey<EventBean>> oldEvents)
Specified by:
applyJoinResult in interface ResultSetProcessor

processOutputLimitedLastAllNonBufferedView

public void processOutputLimitedLastAllNonBufferedView(EventBean[] newData,
                                                       EventBean[] oldData,
                                                       boolean isGenerateSynthetic,
                                                       boolean isAll)
Specified by:
processOutputLimitedLastAllNonBufferedView in interface ResultSetProcessor

processOutputLimitedLastAllNonBufferedJoin

public void processOutputLimitedLastAllNonBufferedJoin(java.util.Set<MultiKey<EventBean>> newEvents,
                                                       java.util.Set<MultiKey<EventBean>> oldEvents,
                                                       boolean isGenerateSynthetic,
                                                       boolean isAll)
Specified by:
processOutputLimitedLastAllNonBufferedJoin in interface ResultSetProcessor

continueOutputLimitedLastAllNonBufferedView

public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedView(boolean isSynthesize,
                                                                            boolean isAll)
Specified by:
continueOutputLimitedLastAllNonBufferedView in interface ResultSetProcessor

continueOutputLimitedLastAllNonBufferedJoin

public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedJoin(boolean isSynthesize,
                                                                            boolean isAll)
Specified by:
continueOutputLimitedLastAllNonBufferedJoin in interface ResultSetProcessor

stop

public void stop()
Description copied from interface: StopCallback
Stops the underlying resources.

Specified by:
stop in interface StopCallback

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