public class AggregationServiceTable extends Object implements AggregationService
Constructor and Description |
---|
AggregationServiceTable(TableStateInstance tableState) |
Modifier and Type | Method and Description |
---|---|
void |
accept(AggregationServiceVisitor visitor) |
void |
acceptGroupDetail(AggregationServiceVisitorWGroupDetail visitor) |
void |
applyEnter(EventBean[] eventsPerStream,
Object optionalGroupKeyPerRow,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as entering a window (new events).
|
void |
applyLeave(EventBean[] eventsPerStream,
Object optionalGroupKeyPerRow,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as leaving a window (old events).
|
void |
clearResults(ExprEvaluatorContext exprEvaluatorContext)
Clear current aggregation state.
|
Collection<EventBean> |
getCollectionOfEvents(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
Collection<Object> |
getCollectionScalar(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
AggregationService |
getContextPartitionAggregationService(int agentInstanceId) |
EventBean |
getEventBean(int column,
EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
Object |
getGroupKey(int agentInstanceId) |
Collection<Object> |
getGroupKeys(ExprEvaluatorContext exprEvaluatorContext) |
TableStateInstance |
getTableState() |
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(Object groupKey,
int agentInstanceId,
AggregationGroupByRollupLevel rollupLevel)
Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.
|
void |
setRemovedCallback(AggregationRowRemovedCallback callback) |
void |
stop()
Stops the underlying resources.
|
public AggregationServiceTable(TableStateInstance tableState)
public TableStateInstance getTableState()
public void applyEnter(EventBean[] eventsPerStream, Object optionalGroupKeyPerRow, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyEnter
in interface AggregationService
eventsPerStream
- - events for each stream entering windowoptionalGroupKeyPerRow
- - 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, Object optionalGroupKeyPerRow, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyLeave
in interface AggregationService
eventsPerStream
- - events for each stream entering windowoptionalGroupKeyPerRow
- - 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 setCurrentAccess(Object groupKey, int agentInstanceId, AggregationGroupByRollupLevel rollupLevel)
AggregationService
setCurrentAccess
in interface AggregationService
groupKey
- - single key identifying the row of aggregation statesagentInstanceId
- context partition idrollupLevel
- rollup levelpublic void clearResults(ExprEvaluatorContext exprEvaluatorContext)
AggregationService
clearResults
in interface AggregationService
exprEvaluatorContext
- contextpublic 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 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 Collection<EventBean> getCollectionOfEvents(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getCollectionOfEvents
in interface AggregationResultFuture
public EventBean getEventBean(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getEventBean
in interface AggregationResultFuture
public Object getGroupKey(int agentInstanceId)
getGroupKey
in interface AggregationResultFuture
public Collection<Object> getGroupKeys(ExprEvaluatorContext exprEvaluatorContext)
getGroupKeys
in interface AggregationResultFuture
public Collection<Object> getCollectionScalar(int column, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
getCollectionScalar
in interface AggregationResultFuture
public void stop()
StopCallback
stop
in interface StopCallback
public AggregationService getContextPartitionAggregationService(int agentInstanceId)
getContextPartitionAggregationService
in interface AggregationService