|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.epl.core.ResultSetProcessorAggregateGrouped
public class ResultSetProcessorAggregateGrouped
Result-set processor for the aggregate-grouped case: there is a group-by and one or more non-aggregation event properties in the select clause are not listed in the group by, and there are aggregation functions.
This processor does perform grouping by computing MultiKey group-by keys for each row. The processor generates one row for each event entering (new event) and one row for each event leaving (old event).
Aggregation state is a table of rows held by AggregationService
where the row key is the group-by MultiKey.
Field Summary | |
---|---|
protected AgentInstanceContext |
agentInstanceContext
|
protected AggregationService |
aggregationService
|
protected EventBean[] |
eventsPerStreamOneStream
|
protected ResultSetProcessorAggregateGroupedFactory |
prototype
|
Constructor Summary | |
---|---|
ResultSetProcessorAggregateGrouped(ResultSetProcessorAggregateGroupedFactory prototype,
SelectExprProcessor selectExprProcessor,
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)
|
protected java.lang.Object |
generateGroupKey(EventBean[] eventsPerStream,
boolean isNewData)
Generates the group-by key for the row |
java.lang.Object[] |
generateGroupKeys(EventBean[] events,
boolean isNewData)
|
java.lang.Object[] |
generateGroupKeys(java.util.Set<MultiKey<EventBean>> resultSet,
boolean isNewData)
|
void |
generateOutputBatchedJoinPerKey(java.util.Set<MultiKey<EventBean>> outputEvents,
java.lang.Object[] groupByKeys,
boolean isNewData,
boolean isSynthesize,
java.util.Map<java.lang.Object,EventBean> resultEvents,
java.util.Map<java.lang.Object,java.lang.Object> optSortKeys)
|
void |
generateOutputBatchedJoinUnkeyed(java.util.Set<MultiKey<EventBean>> outputEvents,
java.lang.Object[] groupByKeys,
boolean isNewData,
boolean isSynthesize,
java.util.Collection<EventBean> resultEvents,
java.util.List<java.lang.Object> optSortKeys)
|
EventBean |
generateOutputBatchedSingle(java.lang.Object groupByKey,
EventBean[] eventsPerStream,
boolean isNewData,
boolean isSynthesize)
|
void |
generateOutputBatchedViewPerKey(EventBean[] outputEvents,
java.lang.Object[] groupByKeys,
boolean isNewData,
boolean isSynthesize,
java.util.Map<java.lang.Object,EventBean> resultEvents,
java.util.Map<java.lang.Object,java.lang.Object> optSortKeys)
|
void |
generateOutputBatchedViewUnkeyed(EventBean[] outputEvents,
java.lang.Object[] groupByKeys,
boolean isNewData,
boolean isSynthesize,
java.util.Collection<EventBean> resultEvents,
java.util.List<java.lang.Object> optSortKeys)
|
AggregationService |
getAggregationService()
|
EventBean[] |
getEventsPerStreamOneStream()
|
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. |
ExprEvaluator |
getOptionalHavingNode()
Returns the having node. |
EventType |
getResultEventType()
Returns the event type of processed results. |
SelectExprProcessor |
getSelectExprProcessor()
Returns the select expression processor |
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>> newData,
java.util.Set<MultiKey<EventBean>> oldData,
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 |
---|
protected final ResultSetProcessorAggregateGroupedFactory prototype
protected final AggregationService aggregationService
protected AgentInstanceContext agentInstanceContext
protected final EventBean[] eventsPerStreamOneStream
Constructor Detail |
---|
public ResultSetProcessorAggregateGrouped(ResultSetProcessorAggregateGroupedFactory prototype, SelectExprProcessor selectExprProcessor, OrderByProcessor orderByProcessor, AggregationService aggregationService, AgentInstanceContext agentInstanceContext)
Method Detail |
---|
public void setAgentInstanceContext(AgentInstanceContext agentInstanceContext)
setAgentInstanceContext
in interface ResultSetProcessor
public EventType getResultEventType()
ResultSetProcessor
getResultEventType
in interface ResultSetProcessor
public EventBean[] getEventsPerStreamOneStream()
public AggregationService getAggregationService()
public void applyViewResult(EventBean[] newData, EventBean[] oldData)
applyViewResult
in interface ResultSetProcessor
public void applyJoinResult(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents)
applyJoinResult
in interface ResultSetProcessor
public UniformPair<EventBean[]> processJoinResult(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents, boolean isSynthesize)
ResultSetProcessor
processJoinResult
in interface ResultSetProcessor
newEvents
- - new events posted by joinoldEvents
- - old events posted by joinisSynthesize
- - set to true to indicate that synthetic events are required for an iterator result set
public UniformPair<EventBean[]> processViewResult(EventBean[] newData, EventBean[] oldData, boolean isSynthesize)
ResultSetProcessor
processViewResult
in interface ResultSetProcessor
newData
- - new events posted by viewoldData
- - old events posted by viewisSynthesize
- - set to true to indicate that synthetic events are required for an iterator result set
public java.lang.Object[] generateGroupKeys(java.util.Set<MultiKey<EventBean>> resultSet, boolean isNewData)
public java.lang.Object[] generateGroupKeys(EventBean[] events, boolean isNewData)
protected java.lang.Object generateGroupKey(EventBean[] eventsPerStream, boolean isNewData)
eventsPerStream
- is the row of eventsisNewData
- is true for new data
public java.util.Iterator<EventBean> getIterator(Viewable parent)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
parent
- is the parent view iterator
public SelectExprProcessor getSelectExprProcessor()
public ExprEvaluator getOptionalHavingNode()
public java.util.Iterator<EventBean> getIterator(java.util.Set<MultiKey<EventBean>> joinSet)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
joinSet
- is the join result set
public void clear()
ResultSetProcessor
clear
in interface ResultSetProcessor
public UniformPair<EventBean[]> processOutputLimitedJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinEventsSet, boolean generateSynthetic, OutputLimitLimitType outputLimitLimitType)
ResultSetProcessor
processOutputLimitedJoin
in interface ResultSetProcessor
joinEventsSet
- the join resultsgenerateSynthetic
- flag to indicate whether synthetic events must be generatedoutputLimitLimitType
- the type of output rate limiting
public UniformPair<EventBean[]> processOutputLimitedView(java.util.List<UniformPair<EventBean[]>> viewEventsList, boolean generateSynthetic, OutputLimitLimitType outputLimitLimitType)
ResultSetProcessor
processOutputLimitedView
in interface ResultSetProcessor
viewEventsList
- the view resultsgenerateSynthetic
- flag to indicate whether synthetic events must be generatedoutputLimitLimitType
- the type of output rate limiting
public void stop()
StopCallback
stop
in interface StopCallback
public void generateOutputBatchedJoinUnkeyed(java.util.Set<MultiKey<EventBean>> outputEvents, java.lang.Object[] groupByKeys, boolean isNewData, boolean isSynthesize, java.util.Collection<EventBean> resultEvents, java.util.List<java.lang.Object> optSortKeys)
public EventBean generateOutputBatchedSingle(java.lang.Object groupByKey, EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize)
public void generateOutputBatchedViewPerKey(EventBean[] outputEvents, java.lang.Object[] groupByKeys, boolean isNewData, boolean isSynthesize, java.util.Map<java.lang.Object,EventBean> resultEvents, java.util.Map<java.lang.Object,java.lang.Object> optSortKeys)
public void generateOutputBatchedJoinPerKey(java.util.Set<MultiKey<EventBean>> outputEvents, java.lang.Object[] groupByKeys, boolean isNewData, boolean isSynthesize, java.util.Map<java.lang.Object,EventBean> resultEvents, java.util.Map<java.lang.Object,java.lang.Object> optSortKeys)
public boolean hasAggregation()
hasAggregation
in interface ResultSetProcessor
public void removed(java.lang.Object key)
removed
in interface AggregationRowRemovedCallback
public void processOutputLimitedLastAllNonBufferedView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic, boolean isAll)
processOutputLimitedLastAllNonBufferedView
in interface ResultSetProcessor
public void processOutputLimitedLastAllNonBufferedJoin(java.util.Set<MultiKey<EventBean>> newData, java.util.Set<MultiKey<EventBean>> oldData, boolean isGenerateSynthetic, boolean isAll)
processOutputLimitedLastAllNonBufferedJoin
in interface ResultSetProcessor
public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedView(boolean isSynthesize, boolean isAll)
continueOutputLimitedLastAllNonBufferedView
in interface ResultSetProcessor
public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedJoin(boolean isSynthesize, boolean isAll)
continueOutputLimitedLastAllNonBufferedJoin
in interface ResultSetProcessor
public void generateOutputBatchedViewUnkeyed(EventBean[] outputEvents, java.lang.Object[] groupByKeys, boolean isNewData, boolean isSynthesize, java.util.Collection<EventBean> resultEvents, java.util.List<java.lang.Object> optSortKeys)
|
© 2006-2016 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |