com.espertech.esper.epl.agg.service
Class AggSvcGroupByReclaimAgedImpl

java.lang.Object
  extended by com.espertech.esper.epl.agg.service.AggregationServiceBaseGrouped
      extended by com.espertech.esper.epl.agg.service.AggSvcGroupByReclaimAgedImpl
All Implemented Interfaces:
AggregationResultFuture, AggregationService

public class AggSvcGroupByReclaimAgedImpl
extends AggregationServiceBaseGrouped

Implementation for handling aggregation with grouping by group-keys.


Field Summary
protected  AggregationStateFactory[] accessAggregations
           
protected  java.util.Map<java.lang.Object,AggregationMethodRowAged> aggregatorsPerGroup
           
protected  boolean isJoin
           
 
Fields inherited from class com.espertech.esper.epl.agg.service.AggregationServiceBaseGrouped
aggregators, evaluators
 
Constructor Summary
AggSvcGroupByReclaimAgedImpl(ExprEvaluator[] evaluators, AggregationMethodFactory[] aggregators, AggregationAccessorSlotPair[] accessors, AggregationStateFactory[] accessAggregations, boolean join, AggSvcGroupByReclaimAgedEvalFunc evaluationFunctionMaxAge, AggSvcGroupByReclaimAgedEvalFunc evaluationFunctionFrequency, MethodResolutionService methodResolutionService)
           
 
Method Summary
 void applyEnter(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
          Apply events as entering a window (new events).
 void applyLeave(EventBean[] eventsPerStream, java.lang.Object groupByKey, ExprEvaluatorContext exprEvaluatorContext)
          Apply events as leaving a window (old events).
 void clearResults(ExprEvaluatorContext exprEvaluatorContext)
          Clear current aggregation state.
 java.util.Collection<EventBean> getCollection(int column, ExprEvaluatorContext context)
           
 EventBean getEventBean(int column, ExprEvaluatorContext context)
           
 java.lang.Object getValue(int column, int agentInstanceId)
          Returns current aggregation state, for use by expression node representing an aggregation function.
protected  void handleRemovedKeys()
           
 void internalHandleRemoved(java.lang.Object key)
           
 void internalHandleUpdated(java.lang.Object groupByKey, AggregationMethodRowAged row)
           
 void setCurrentAccess(java.lang.Object groupByKey, int agentInstanceId)
          Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.
 void setRemovedCallback(AggregationRowRemovedCallback callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessAggregations

protected final AggregationStateFactory[] accessAggregations

isJoin

protected final boolean isJoin

aggregatorsPerGroup

protected java.util.Map<java.lang.Object,AggregationMethodRowAged> aggregatorsPerGroup
Constructor Detail

AggSvcGroupByReclaimAgedImpl

public AggSvcGroupByReclaimAgedImpl(ExprEvaluator[] evaluators,
                                    AggregationMethodFactory[] aggregators,
                                    AggregationAccessorSlotPair[] accessors,
                                    AggregationStateFactory[] accessAggregations,
                                    boolean join,
                                    AggSvcGroupByReclaimAgedEvalFunc evaluationFunctionMaxAge,
                                    AggSvcGroupByReclaimAgedEvalFunc evaluationFunctionFrequency,
                                    MethodResolutionService methodResolutionService)
Method Detail

clearResults

public void clearResults(ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationService
Clear current aggregation state.


applyEnter

public void applyEnter(EventBean[] eventsPerStream,
                       java.lang.Object groupByKey,
                       ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationService
Apply events as entering a window (new events).

Parameters:
eventsPerStream - - events for each stream entering window
groupByKey - - can be null if grouping without keys is desired, else the 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,
                       java.lang.Object groupByKey,
                       ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationService
Apply events as leaving a window (old events).

Parameters:
eventsPerStream - - events for each stream entering window
groupByKey - - can be null if grouping without keys is desired, else the 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(java.lang.Object groupByKey,
                             int agentInstanceId)
Description copied from interface: AggregationService
Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.

Parameters:
groupByKey - - key identify the row of aggregation states
agentInstanceId - context partition id

getValue

public java.lang.Object getValue(int column,
                                 int agentInstanceId)
Description copied from interface: AggregationResultFuture
Returns current aggregation state, for use by expression node representing an aggregation function.

Parameters:
column - is assigned to the aggregation expression node and passed as an column (index) into a row
agentInstanceId - the context partition id
Returns:
current aggragation state

getCollection

public java.util.Collection<EventBean> getCollection(int column,
                                                     ExprEvaluatorContext context)

getEventBean

public EventBean getEventBean(int column,
                              ExprEvaluatorContext context)

setRemovedCallback

public void setRemovedCallback(AggregationRowRemovedCallback callback)

internalHandleUpdated

public void internalHandleUpdated(java.lang.Object groupByKey,
                                  AggregationMethodRowAged row)

internalHandleRemoved

public void internalHandleRemoved(java.lang.Object key)

handleRemovedKeys

protected void handleRemovedKeys()

© 2006-2011 EsperTech Inc.
All rights reserved.
Visit us at espertech.com