public abstract class AggSvcGroupByWTableBase extends java.lang.Object implements AggregationService
Modifier and Type | Field and Description |
---|---|
protected AggregationAccessorSlotPair[] |
accessors |
protected ExprNode[] |
accessStateExpr |
protected AggregationMethod[] |
currentAggregatorMethods |
protected AggregationState[] |
currentAggregatorStates |
protected java.lang.Object |
currentGroupKey |
protected boolean |
isJoin |
protected TableColumnMethodPair[] |
methodPairs |
protected TableMetadata |
tableMetadata |
protected TableStateInstanceGrouped |
tableStateInstance |
protected int[] |
targetStates |
Constructor and Description |
---|
AggSvcGroupByWTableBase(TableMetadata tableMetadata,
TableColumnMethodPair[] methodPairs,
AggregationAccessorSlotPair[] accessors,
boolean join,
TableStateInstanceGrouped tableStateInstance,
int[] targetStates,
ExprNode[] accessStateExpr,
AggregationAgent[] agents) |
Modifier and Type | Method and Description |
---|---|
void |
accept(AggregationServiceVisitor visitor) |
void |
acceptGroupDetail(AggregationServiceVisitorWGroupDetail visitor) |
void |
applyEnter(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as entering a window (new events).
|
protected void |
applyEnterGroupKey(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext) |
abstract void |
applyEnterInternal(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext) |
static CodegenMethodNode |
applyGroupKeyCodegen(boolean enter,
CodegenMethodNode parent,
CodegenClassScope classScope,
TableColumnMethodPair[] methodPairs,
AggregationAgentForge[] agentForges,
AggregationAgent[] agents,
int[] targetStates) |
void |
applyLeave(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as leaving a window (old events).
|
protected void |
applyLeaveGroupKey(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext) |
abstract void |
applyLeaveInternal(EventBean[] eventsPerStream,
java.lang.Object groupByKey,
ExprEvaluatorContext exprEvaluatorContext) |
void |
clearResults(ExprEvaluatorContext exprEvaluatorContext)
Clear current aggregation state.
|
static void |
ctorCodegen(CodegenCtor ctor,
java.util.List<CodegenTypedParam> explicitMembers,
CodegenClassScope classScope) |
java.util.Collection<EventBean> |
getCollectionOfEvents(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
java.util.Collection<java.lang.Object> |
getCollectionScalar(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
AggregationService |
getContextPartitionAggregationService(int agentInstanceId) |
EventBean |
getEventBean(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
static void |
getGroupByValueCodegen(AggSvcTableGetterType getterType,
CodegenMethodNode method,
CodegenClassScope classScope,
CodegenNamedMethods namedMethods,
int numMethodAggs,
AggregationAccessorSlotPair[] accessors) |
java.lang.Object |
getGroupKey(int agentInstanceId) |
java.util.Collection<java.lang.Object> |
getGroupKeys(ExprEvaluatorContext exprEvaluatorContext) |
java.lang.Object |
getValue(int column,
int agentInstanceId,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext exprEvaluatorContext)
Returns current aggregation state, for use by expression node representing an aggregation function.
|
boolean |
isGrouped() |
void |
setCurrentAccess(java.lang.Object groupByKey,
int agentInstanceId,
AggregationGroupByRollupLevel rollupLevel)
Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.
|
static void |
setCurrentAccessCodegen(CodegenMethodNode method,
CodegenClassScope classScope) |
void |
setRemovedCallback(AggregationRowRemovedCallback callback) |
void |
stop()
Stops the underlying resources.
|
protected final TableMetadata tableMetadata
protected final TableColumnMethodPair[] methodPairs
protected final AggregationAccessorSlotPair[] accessors
protected final boolean isJoin
protected final TableStateInstanceGrouped tableStateInstance
protected final int[] targetStates
protected final ExprNode[] accessStateExpr
protected AggregationMethod[] currentAggregatorMethods
protected AggregationState[] currentAggregatorStates
protected java.lang.Object currentGroupKey
public AggSvcGroupByWTableBase(TableMetadata tableMetadata, TableColumnMethodPair[] methodPairs, AggregationAccessorSlotPair[] accessors, boolean join, TableStateInstanceGrouped tableStateInstance, int[] targetStates, ExprNode[] accessStateExpr, AggregationAgent[] agents)
public static void ctorCodegen(CodegenCtor ctor, java.util.List<CodegenTypedParam> explicitMembers, CodegenClassScope classScope)
public abstract void applyEnterInternal(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
public abstract void applyLeaveInternal(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
public void applyEnter(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyEnter
in interface AggregationService
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 evaluatiompublic void applyLeave(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyLeave
in interface AggregationService
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 evaluatiomprotected void applyEnterGroupKey(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
public static CodegenMethodNode applyGroupKeyCodegen(boolean enter, CodegenMethodNode parent, CodegenClassScope classScope, TableColumnMethodPair[] methodPairs, AggregationAgentForge[] agentForges, AggregationAgent[] agents, int[] targetStates)
protected void applyLeaveGroupKey(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
public void setCurrentAccess(java.lang.Object groupByKey, int agentInstanceId, AggregationGroupByRollupLevel rollupLevel)
AggregationService
setCurrentAccess
in interface AggregationService
groupByKey
- - single key identifying the row of aggregation statesagentInstanceId
- context partition idrollupLevel
- rollup levelpublic static void setCurrentAccessCodegen(CodegenMethodNode method, CodegenClassScope classScope)
public java.lang.Object getValue(int column, int agentInstanceId, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
AggregationResultFuture
getValue
in interface AggregationResultFuture
column
- is assigned to the aggregation expression node and passed as an column (index) into a rowagentInstanceId
- the context partition ideventsPerStream
- events per streamisNewData
- new vs removed indicatorexprEvaluatorContext
- contextpublic static void getGroupByValueCodegen(AggSvcTableGetterType getterType, CodegenMethodNode method, CodegenClassScope classScope, CodegenNamedMethods namedMethods, int numMethodAggs, AggregationAccessorSlotPair[] accessors)
public java.util.Collection<EventBean> getCollectionOfEvents(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getCollectionOfEvents
in interface AggregationResultFuture
public java.util.Collection<java.lang.Object> getCollectionScalar(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getCollectionScalar
in interface AggregationResultFuture
public EventBean getEventBean(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getEventBean
in interface AggregationResultFuture
public void setRemovedCallback(AggregationRowRemovedCallback callback)
setRemovedCallback
in interface AggregationService
public void accept(AggregationServiceVisitor visitor)
accept
in interface AggregationService
public void acceptGroupDetail(AggregationServiceVisitorWGroupDetail visitor)
acceptGroupDetail
in interface AggregationService
public boolean isGrouped()
isGrouped
in interface AggregationService
public java.lang.Object getGroupKey(int agentInstanceId)
getGroupKey
in interface AggregationResultFuture
public java.util.Collection<java.lang.Object> getGroupKeys(ExprEvaluatorContext exprEvaluatorContext)
getGroupKeys
in interface AggregationResultFuture
public void clearResults(ExprEvaluatorContext exprEvaluatorContext)
AggregationService
clearResults
in interface AggregationService
exprEvaluatorContext
- contextpublic void stop()
StopCallback
stop
in interface StopCallback
public AggregationService getContextPartitionAggregationService(int agentInstanceId)
getContextPartitionAggregationService
in interface AggregationService