Class AggSvcGroupByWTableBase
java.lang.Object
com.espertech.esper.common.internal.epl.agg.table.AggSvcGroupByWTableBase
- All Implemented Interfaces:
AggregationResultFuture
,AggregationService
,AggregationServiceTable
,StopCallback
- Direct Known Subclasses:
AggSvcGroupByWTableImpl
,AggSvcGroupByWTableRollupMultiKeyImpl
,AggSvcGroupByWTableRollupSingleKeyImpl
public abstract class AggSvcGroupByWTableBase
extends Object
implements AggregationService, AggregationServiceTable
Implementation for handling aggregation with grouping by group-keys.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AggregationRow
protected Object
protected final TableColumnMethodPairEval[]
protected final TableInstanceGrouped
Fields inherited from interface com.espertech.esper.common.internal.epl.agg.core.AggregationService
EPTYPE
-
Constructor Summary
ConstructorDescriptionAggSvcGroupByWTableBase
(TableInstanceGrouped tableInstance, TableColumnMethodPairEval[] methodPairs, AggregationMultiFunctionAgent[] accessAgents, int[] accessColumnsZeroOffset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(AggregationServiceVisitor visitor) void
void
applyEnter
(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) Apply events as entering a window (new events).abstract void
applyEnterInternal
(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) protected void
applyEnterTableKey
(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) void
applyLeave
(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) Apply events as leaving a window (old events).abstract void
applyLeaveInternal
(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) protected void
applyLeaveTableKey
(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) void
clearResults
(ExprEvaluatorContext exprEvaluatorContext) Clear current aggregation state.getAggregationRow
(int agentInstanceId, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) getCollectionOfEvents
(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) getCollectionScalar
(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) getContextPartitionAggregationService
(int agentInstanceId) getEventBean
(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) getGroupKey
(int agentInstanceId) getGroupKeys
(ExprEvaluatorContext exprEvaluatorContext) getValue
(int column, int agentInstanceId, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) boolean
void
setCurrentAccess
(Object groupByKeyUntransformed, int agentInstanceId, AggregationGroupByRollupLevel rollupLevel) Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.void
void
stop()
Stops the underlying resources.
-
Field Details
-
tableInstance
-
methodPairs
-
currentAggregationRow
-
currentGroupKey
-
-
Constructor Details
-
AggSvcGroupByWTableBase
public AggSvcGroupByWTableBase(TableInstanceGrouped tableInstance, TableColumnMethodPairEval[] methodPairs, AggregationMultiFunctionAgent[] accessAgents, int[] accessColumnsZeroOffset)
-
-
Method Details
-
applyEnterInternal
public abstract void applyEnterInternal(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) -
applyLeaveInternal
public abstract void applyLeaveInternal(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) -
applyEnter
public void applyEnter(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) Description copied from interface:AggregationService
Apply events as entering a window (new events).- Specified by:
applyEnter
in interfaceAggregationService
- Parameters:
eventsPerStream
- - events for each stream entering windowgroupByKey
- - can be null if grouping without keys is desired, else the keys or array of keys to use for grouping, each distinct key value results in a new row of aggregation state.exprEvaluatorContext
- context for expression evaluatiom
-
applyLeave
public void applyLeave(EventBean[] eventsPerStream, Object groupByKey, ExprEvaluatorContext exprEvaluatorContext) Description copied from interface:AggregationService
Apply events as leaving a window (old events).- Specified by:
applyLeave
in interfaceAggregationService
- Parameters:
eventsPerStream
- - events for each stream entering windowgroupByKey
- - can be null if grouping without keys is desired, else the keys or array of keys to use for grouping, each distinct key value results in a new row of aggregation state.exprEvaluatorContext
- context for expression evaluatiom
-
setCurrentAccess
public void setCurrentAccess(Object groupByKeyUntransformed, int agentInstanceId, AggregationGroupByRollupLevel rollupLevel) Description copied from interface:AggregationResultFuture
Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.- Specified by:
setCurrentAccess
in interfaceAggregationResultFuture
- Parameters:
groupByKeyUntransformed
- - single key identifying the row of aggregation statesagentInstanceId
- context partition idrollupLevel
- rollup level
-
getValue
public Object getValue(int column, int agentInstanceId, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) - Specified by:
getValue
in interfaceAggregationResultFuture
-
getCollectionOfEvents
public Collection<EventBean> getCollectionOfEvents(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) - Specified by:
getCollectionOfEvents
in interfaceAggregationResultFuture
-
getCollectionScalar
public Collection<Object> getCollectionScalar(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) - Specified by:
getCollectionScalar
in interfaceAggregationResultFuture
-
getEventBean
public EventBean getEventBean(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) - Specified by:
getEventBean
in interfaceAggregationResultFuture
-
setRemovedCallback
- Specified by:
setRemovedCallback
in interfaceAggregationService
-
accept
- Specified by:
accept
in interfaceAggregationService
-
acceptGroupDetail
- Specified by:
acceptGroupDetail
in interfaceAggregationService
-
isGrouped
public boolean isGrouped()- Specified by:
isGrouped
in interfaceAggregationService
-
getGroupKey
- Specified by:
getGroupKey
in interfaceAggregationResultFuture
-
getGroupKeys
- Specified by:
getGroupKeys
in interfaceAggregationResultFuture
-
clearResults
Description copied from interface:AggregationService
Clear current aggregation state.- Specified by:
clearResults
in interfaceAggregationService
- Parameters:
exprEvaluatorContext
- context
-
stop
public void stop()Description copied from interface:StopCallback
Stops the underlying resources.- Specified by:
stop
in interfaceStopCallback
-
getContextPartitionAggregationService
- Specified by:
getContextPartitionAggregationService
in interfaceAggregationResultFuture
-
getTableInstance
- Specified by:
getTableInstance
in interfaceAggregationServiceTable
-
getAggregationRow
public AggregationRow getAggregationRow(int agentInstanceId, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) - Specified by:
getAggregationRow
in interfaceAggregationResultFuture
-
applyEnterTableKey
protected void applyEnterTableKey(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) -
applyLeaveTableKey
protected void applyLeaveTableKey(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext)
-