public class ResultSetProcessorRowPerGroup extends Object implements ResultSetProcessor, AggregationRowRemovedCallback
Produces one row for each group that changed (and not one row per event). Computes MultiKey group-by keys for each event and uses a set of the group-by keys to generate the result rows, using the first (old or new, anyone) event for each distinct group-by key.
Modifier and Type | Field and Description |
---|---|
protected AgentInstanceContext |
agentInstanceContext |
protected AggregationService |
aggregationService |
protected OrderByProcessor |
orderByProcessor |
protected ResultSetProcessorGroupedOutputAllGroupReps |
outputAllGroupReps |
protected ResultSetProcessorRowPerGroupFactory |
prototype |
protected SelectExprProcessor |
selectExprProcessor |
Constructor and Description |
---|
ResultSetProcessorRowPerGroup(ResultSetProcessorRowPerGroupFactory prototype,
SelectExprProcessor selectExprProcessor,
OrderByProcessor orderByProcessor,
AggregationService aggregationService,
AgentInstanceContext agentInstanceContext) |
Modifier and Type | Method and Description |
---|---|
void |
acceptHelperVisitor(ResultSetProcessorOutputHelperVisitor visitor) |
void |
applyJoinResult(Set<MultiKey<EventBean>> newEvents,
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) |
Object |
generateGroupKey(EventBean[] eventsPerStream,
boolean isNewData) |
protected Object[] |
generateGroupKeys(EventBean[] events,
Map<Object,EventBean> eventPerKey,
boolean isNewData) |
void |
generateOutputBatchedArr(boolean join,
Iterator<Map.Entry<Object,EventBean[]>> keysAndEvents,
boolean isNewData,
boolean isSynthesize,
List<EventBean> resultEvents,
List<Object> optSortKeys) |
EventBean |
generateOutputBatchedNoSortWMap(boolean join,
Object mk,
EventBean[] eventsPerStream,
boolean isNewData,
boolean isSynthesize) |
protected EventBean[] |
generateOutputEventsView(Map<Object,EventBean> keysAndEvents,
boolean isNewData,
boolean isSynthesize) |
AggregationService |
getAggregationService() |
Iterator<EventBean> |
getIterator(Set<MultiKey<EventBean>> joinSet)
Returns the iterator for iterating over a join-result.
|
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.
|
protected Iterator<EventBean> |
getIteratorSorted(Iterator<EventBean> parentIter) |
ExprEvaluator |
getOptionalHavingNode()
Returns the optional having expression.
|
EventType |
getResultEventType()
Returns the event type of processed results.
|
SelectExprProcessor |
getSelectExprProcessor()
Returns the select expression processor
|
boolean |
hasAggregation() |
Iterator<EventBean> |
obtainIterator(Viewable parent) |
UniformPair<EventBean[]> |
processJoinResult(Set<MultiKey<EventBean>> newEvents,
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(List<UniformPair<Set<MultiKey<EventBean>>>> joinEventsSet,
boolean generateSynthetic,
OutputLimitLimitType outputLimitLimitType)
Processes batched events in case of output-rate limiting.
|
void |
processOutputLimitedLastAllNonBufferedJoin(Set<MultiKey<EventBean>> newData,
Set<MultiKey<EventBean>> oldData,
boolean isGenerateSynthetic,
boolean isAll) |
void |
processOutputLimitedLastAllNonBufferedView(EventBean[] newData,
EventBean[] oldData,
boolean isGenerateSynthetic,
boolean isAll) |
UniformPair<EventBean[]> |
processOutputLimitedView(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(Object key) |
void |
setAgentInstanceContext(AgentInstanceContext agentInstanceContext) |
void |
stop()
Stops the underlying resources.
|
protected final ResultSetProcessorRowPerGroupFactory prototype
protected final SelectExprProcessor selectExprProcessor
protected final OrderByProcessor orderByProcessor
protected final AggregationService aggregationService
protected AgentInstanceContext agentInstanceContext
protected ResultSetProcessorGroupedOutputAllGroupReps outputAllGroupReps
public ResultSetProcessorRowPerGroup(ResultSetProcessorRowPerGroupFactory prototype, SelectExprProcessor selectExprProcessor, OrderByProcessor orderByProcessor, AggregationService aggregationService, AgentInstanceContext agentInstanceContext)
public void setAgentInstanceContext(AgentInstanceContext agentInstanceContext)
setAgentInstanceContext
in interface ResultSetProcessor
public EventType getResultEventType()
ResultSetProcessor
getResultEventType
in interface ResultSetProcessor
public void applyViewResult(EventBean[] newData, EventBean[] oldData)
applyViewResult
in interface ResultSetProcessor
public void applyJoinResult(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents)
applyJoinResult
in interface ResultSetProcessor
public UniformPair<EventBean[]> processJoinResult(Set<MultiKey<EventBean>> newEvents, 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 setpublic 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 setprotected EventBean[] generateOutputEventsView(Map<Object,EventBean> keysAndEvents, boolean isNewData, boolean isSynthesize)
public void generateOutputBatchedArr(boolean join, Iterator<Map.Entry<Object,EventBean[]>> keysAndEvents, boolean isNewData, boolean isSynthesize, List<EventBean> resultEvents, List<Object> optSortKeys)
public EventBean generateOutputBatchedNoSortWMap(boolean join, Object mk, EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize)
protected Object[] generateGroupKeys(EventBean[] events, Map<Object,EventBean> eventPerKey, boolean isNewData)
public ExprEvaluator getOptionalHavingNode()
public SelectExprProcessor getSelectExprProcessor()
public Iterator<EventBean> getIterator(Viewable parent)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
parent
- is the parent view iteratorpublic Iterator<EventBean> getIterator(Set<MultiKey<EventBean>> joinSet)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
joinSet
- is the join result setpublic void clear()
ResultSetProcessor
clear
in interface ResultSetProcessor
public UniformPair<EventBean[]> processOutputLimitedJoin(List<UniformPair<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 limitingpublic UniformPair<EventBean[]> processOutputLimitedView(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 limitingpublic boolean hasAggregation()
hasAggregation
in interface ResultSetProcessor
public void removed(Object key)
removed
in interface AggregationRowRemovedCallback
public void processOutputLimitedLastAllNonBufferedView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic, boolean isAll)
processOutputLimitedLastAllNonBufferedView
in interface ResultSetProcessor
public void processOutputLimitedLastAllNonBufferedJoin(Set<MultiKey<EventBean>> newData, 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 stop()
StopCallback
stop
in interface StopCallback
public AggregationService getAggregationService()
public void acceptHelperVisitor(ResultSetProcessorOutputHelperVisitor visitor)
acceptHelperVisitor
in interface ResultSetProcessor