public class ResultSetProcessorRowPerGroupImpl extends java.lang.Object implements ResultSetProcessorRowPerGroup
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 ResultSetProcessorRowPerGroupFactory |
prototype |
protected SelectExprProcessor |
selectExprProcessor |
protected final ResultSetProcessorRowPerGroupFactory prototype
protected final SelectExprProcessor selectExprProcessor
protected final OrderByProcessor orderByProcessor
protected final AggregationService aggregationService
protected 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 static void applyViewResultCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public void applyJoinResult(java.util.Set<MultiKey<EventBean>> newEvents, java.util.Set<MultiKey<EventBean>> oldEvents)
applyJoinResult
in interface ResultSetProcessor
public static void applyJoinResultCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
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 setpublic static void processJoinResultCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
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 setpublic static void processViewResultCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public void generateOutputBatchedArrFromIterator(boolean join, java.util.Iterator<java.util.Map.Entry<java.lang.Object,EventBean[]>> keysAndEvents, boolean isNewData, boolean isSynthesize, java.util.List<EventBean> resultEvents, java.util.List<java.lang.Object> optSortKeys)
generateOutputBatchedArrFromIterator
in interface ResultSetProcessorRowPerGroup
public EventBean generateOutputBatchedNoSortWMap(boolean join, java.lang.Object mk, EventBean[] eventsPerStream, boolean isNewData, boolean isSynthesize)
generateOutputBatchedNoSortWMap
in interface ResultSetProcessorRowPerGroup
public ExprEvaluator getOptionalHavingNode()
public SelectExprProcessor getSelectExprProcessor()
getSelectExprProcessor
in interface ResultSetProcessorRowPerGroup
public java.util.Iterator<EventBean> getIterator(Viewable parent)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
parent
- is the parent view iteratorpublic static void getIteratorViewCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public java.util.Iterator<EventBean> getIterator(java.util.Set<MultiKey<EventBean>> joinSet)
ResultSetProcessor
getIterator
in interface ResultSetProcessor
joinSet
- is the join result setpublic static void getIteratorJoinCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public void clear()
ResultSetProcessor
clear
in interface ResultSetProcessor
public static void clearMethodCodegen(CodegenMethodNode method)
public UniformPair<EventBean[]> processOutputLimitedJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinEventsSet, boolean generateSynthetic)
ResultSetProcessor
processOutputLimitedJoin
in interface ResultSetProcessor
joinEventsSet
- the join resultsgenerateSynthetic
- flag to indicate whether synthetic events must be generatedpublic static void processOutputLimitedJoinCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public UniformPair<EventBean[]> processOutputLimitedView(java.util.List<UniformPair<EventBean[]>> viewEventsList, boolean generateSynthetic)
ResultSetProcessor
processOutputLimitedView
in interface ResultSetProcessor
viewEventsList
- the view resultsgenerateSynthetic
- flag to indicate whether synthetic events must be generatedpublic static void processOutputLimitedViewCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public void removedAggregationGroupKey(java.lang.Object key)
removedAggregationGroupKey
in interface AggregationRowRemovedCallback
public java.lang.Object generateGroupKeySingle(EventBean[] eventsPerStream, boolean isNewData)
generateGroupKeySingle
in interface ResultSetProcessorRowPerGroup
public void processOutputLimitedLastAllNonBufferedView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic)
processOutputLimitedLastAllNonBufferedView
in interface ResultSetProcessor
public static void processOutputLimitedLastAllNonBufferedViewCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public void processOutputLimitedLastAllNonBufferedJoin(java.util.Set<MultiKey<EventBean>> newData, java.util.Set<MultiKey<EventBean>> oldData, boolean isGenerateSynthetic)
processOutputLimitedLastAllNonBufferedJoin
in interface ResultSetProcessor
public static void processOutputLimitedLastAllNonBufferedJoinCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenClassScope classScope, CodegenMethodNode method, CodegenInstanceAux instance)
public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedView(boolean isSynthesize)
continueOutputLimitedLastAllNonBufferedView
in interface ResultSetProcessor
public static void continueOutputLimitedLastAllNonBufferedViewCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenMethodNode method)
public UniformPair<EventBean[]> continueOutputLimitedLastAllNonBufferedJoin(boolean isSynthesize)
continueOutputLimitedLastAllNonBufferedJoin
in interface ResultSetProcessor
public static void continueOutputLimitedLastAllNonBufferedJoinCodegen(ResultSetProcessorRowPerGroupForge forge, CodegenMethodNode method)
public void stop()
StopCallback
stop
in interface StopCallback
public static void stopMethodCodegenBound(CodegenMethodNode method, CodegenInstanceAux instance)
public AggregationService getAggregationService()
getAggregationService
in interface ResultSetProcessorRowPerGroup
public void acceptHelperVisitor(ResultSetProcessorOutputHelperVisitor visitor)
acceptHelperVisitor
in interface ResultSetProcessor
public static void acceptHelperVisitorCodegen(CodegenMethodNode method, CodegenInstanceAux instance)
public boolean hasHavingClause()
hasHavingClause
in interface ResultSetProcessorRowPerGroup
public boolean evaluateHavingClause(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
evaluateHavingClause
in interface ResultSetProcessorRowPerGroup
public boolean isSelectRStream()
isSelectRStream
in interface ResultSetProcessorRowPerGroup
public ExprEvaluatorContext getAgentInstanceContext()
getAgentInstanceContext
in interface ResultSetProcessorRowPerGroup