public abstract class AggSvcGroupLocalGroupByBase extends java.lang.Object implements AggregationService
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Object,AggregationMethodPairRow>[] |
aggregatorsPerLevelAndGroup |
protected AggregationMethod[] |
aggregatorsTopLevel |
protected boolean |
isJoin |
protected AggregationLocalGroupByPlan |
localGroupByPlan |
protected java.util.List<Pair<java.lang.Integer,java.lang.Object>> |
removedKeys |
protected AggregationState[] |
statesTopLevel |
Constructor and Description |
---|
AggSvcGroupLocalGroupByBase(boolean isJoin,
AggregationLocalGroupByPlan localGroupByPlan) |
Modifier and Type | Method and Description |
---|---|
void |
accept(AggregationServiceVisitor visitor) |
void |
acceptGroupDetail(AggregationServiceVisitorWGroupDetail visitor) |
static void |
aggregateIntoEnter(AggregationLocalGroupByLevel level,
AggregationMethod[] methods,
AggregationState[] states,
EventBean[] eventsPerStream,
ExprEvaluatorContext exprEvaluatorContext) |
static void |
aggregateIntoLeave(AggregationLocalGroupByLevel level,
AggregationMethod[] methods,
AggregationState[] states,
EventBean[] eventsPerStream,
ExprEvaluatorContext exprEvaluatorContext) |
void |
applyEnter(EventBean[] eventsPerStream,
java.lang.Object groupByKeyProvided,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as entering a window (new events).
|
void |
applyLeave(EventBean[] eventsPerStream,
java.lang.Object groupByKeyProvided,
ExprEvaluatorContext exprEvaluatorContext)
Apply events as leaving a window (old events).
|
void |
clearResults(ExprEvaluatorContext exprEvaluatorContext)
Clear current aggregation state.
|
protected static void |
clearResults(java.util.Map<java.lang.Object,AggregationMethodPairRow>[] aggregatorsPerLevelAndGroup,
AggregationMethod[] aggregatorsTopLevel,
AggregationState[] statesTopLevel) |
protected abstract java.lang.Object |
computeGroupKey(AggregationLocalGroupByLevel level,
java.lang.Object groupKey,
ExprEvaluator[] partitionEval,
EventBean[] eventsPerStream,
boolean newData,
ExprEvaluatorContext exprEvaluatorContext) |
static java.lang.Object |
computeGroupKey(ExprEvaluator[] partitionEval,
EventBean[] eventsPerStream,
boolean b,
ExprEvaluatorContext exprEvaluatorContext) |
java.util.Map<java.lang.Object,AggregationMethodPairRow>[] |
getAggregatorsPerLevelAndGroup() |
AggregationMethod[] |
getAggregatorsTopLevel() |
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) |
java.lang.Object |
getGroupKey(int agentInstanceId) |
java.util.Collection<java.lang.Object> |
getGroupKeys(ExprEvaluatorContext exprEvaluatorContext) |
java.util.List<Pair<java.lang.Integer,java.lang.Object>> |
getRemovedKeys() |
AggregationState[] |
getStatesTopLevel() |
void |
handleRemovedKeys() |
void |
internalHandleGroupRemove(Pair<java.lang.Integer,java.lang.Object> groupByKey) |
void |
internalHandleUpdatedGroup(int level,
java.lang.Object groupByKey,
AggregationMethodPairRow row) |
void |
internalHandleUpdatedTop() |
boolean |
isGrouped() |
void |
setAggregatorsPerLevelAndGroup(java.util.Map<java.lang.Object,AggregationMethodPairRow>[] aggregatorsPerLevelAndGroup) |
void |
setAggregatorsTopLevel(AggregationMethod[] aggregatorsTopLevel) |
void |
setRemovedCallback(AggregationRowRemovedCallback callback) |
void |
setRemovedKeys(java.util.List<Pair<java.lang.Integer,java.lang.Object>> removedKeys) |
void |
setStatesTopLevel(AggregationState[] statesTopLevel) |
void |
stop()
Stops the underlying resources.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setCurrentAccess
getValue
protected final boolean isJoin
protected final AggregationLocalGroupByPlan localGroupByPlan
protected AggregationMethod[] aggregatorsTopLevel
protected AggregationState[] statesTopLevel
protected java.util.Map<java.lang.Object,AggregationMethodPairRow>[] aggregatorsPerLevelAndGroup
protected java.util.List<Pair<java.lang.Integer,java.lang.Object>> removedKeys
public AggSvcGroupLocalGroupByBase(boolean isJoin, AggregationLocalGroupByPlan localGroupByPlan)
protected abstract java.lang.Object computeGroupKey(AggregationLocalGroupByLevel level, java.lang.Object groupKey, ExprEvaluator[] partitionEval, EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext exprEvaluatorContext)
public void clearResults(ExprEvaluatorContext exprEvaluatorContext)
AggregationService
clearResults
in interface AggregationService
exprEvaluatorContext
- contextpublic void applyEnter(EventBean[] eventsPerStream, java.lang.Object groupByKeyProvided, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyEnter
in interface AggregationService
eventsPerStream
- - events for each stream entering windowgroupByKeyProvided
- - 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 groupByKeyProvided, ExprEvaluatorContext exprEvaluatorContext)
AggregationService
applyLeave
in interface AggregationService
eventsPerStream
- - events for each stream entering windowgroupByKeyProvided
- - 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 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 boolean isGrouped()
isGrouped
in interface AggregationService
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 void internalHandleUpdatedGroup(int level, java.lang.Object groupByKey, AggregationMethodPairRow row)
public void internalHandleUpdatedTop()
public void internalHandleGroupRemove(Pair<java.lang.Integer,java.lang.Object> groupByKey)
public void handleRemovedKeys()
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 static java.lang.Object computeGroupKey(ExprEvaluator[] partitionEval, EventBean[] eventsPerStream, boolean b, ExprEvaluatorContext exprEvaluatorContext)
public static void aggregateIntoEnter(AggregationLocalGroupByLevel level, AggregationMethod[] methods, AggregationState[] states, EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext)
public static void aggregateIntoLeave(AggregationLocalGroupByLevel level, AggregationMethod[] methods, AggregationState[] states, EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext)
protected static void clearResults(java.util.Map<java.lang.Object,AggregationMethodPairRow>[] aggregatorsPerLevelAndGroup, AggregationMethod[] aggregatorsTopLevel, AggregationState[] statesTopLevel)
public AggregationMethod[] getAggregatorsTopLevel()
public void setAggregatorsTopLevel(AggregationMethod[] aggregatorsTopLevel)
public AggregationState[] getStatesTopLevel()
public void setStatesTopLevel(AggregationState[] statesTopLevel)
public java.util.Map<java.lang.Object,AggregationMethodPairRow>[] getAggregatorsPerLevelAndGroup()
public void setAggregatorsPerLevelAndGroup(java.util.Map<java.lang.Object,AggregationMethodPairRow>[] aggregatorsPerLevelAndGroup)
public java.util.List<Pair<java.lang.Integer,java.lang.Object>> getRemovedKeys()
public void setRemovedKeys(java.util.List<Pair<java.lang.Integer,java.lang.Object>> removedKeys)
public void stop()
StopCallback
stop
in interface StopCallback
public AggregationService getContextPartitionAggregationService(int agentInstanceId)
getContextPartitionAggregationService
in interface AggregationService