net.esper.eql.expression
Class AggregationServiceGroupAllImpl

java.lang.Object
  extended by net.esper.eql.expression.AggregationServiceBase
      extended by net.esper.eql.expression.AggregationServiceGroupAllImpl
All Implemented Interfaces:
AggregationResultFuture, AggregationService

public class AggregationServiceGroupAllImpl
extends AggregationServiceBase

Implementation for handling aggregation without any grouping (no group-by).


Field Summary
 
Fields inherited from class net.esper.eql.expression.AggregationServiceBase
aggregators, evaluators
 
Constructor Summary
AggregationServiceGroupAllImpl(ExprEvaluator[] evaluators, Aggregator[] aggregators)
          Ctor.
 
Method Summary
 void applyEnter(EventBean[] eventsPerStream, MultiKey optionalGroupKeyPerRow)
          Apply events as entering a window (new events).
 void applyLeave(EventBean[] eventsPerStream, MultiKey optionalGroupKeyPerRow)
          Apply events as leaving a window (old events).
 Object getValue(int column)
          Returns current aggregation state, for use by expression node representing an aggregation function.
 void setCurrentRow(MultiKey groupKey)
          Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationServiceGroupAllImpl

public AggregationServiceGroupAllImpl(ExprEvaluator[] evaluators,
                                      Aggregator[] aggregators)
Ctor.

Parameters:
evaluators - - evaluate the sub-expression within the aggregate function (ie. sum(4*myNum))
aggregators - - collect the aggregation state that evaluators evaluate to
Method Detail

applyEnter

public void applyEnter(EventBean[] eventsPerStream,
                       MultiKey optionalGroupKeyPerRow)
Description copied from interface: AggregationService
Apply events as entering a window (new events).

Parameters:
eventsPerStream - - events for each stream entering window
optionalGroupKeyPerRow - - 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.

applyLeave

public void applyLeave(EventBean[] eventsPerStream,
                       MultiKey optionalGroupKeyPerRow)
Description copied from interface: AggregationService
Apply events as leaving a window (old events).

Parameters:
eventsPerStream - - events for each stream entering window
optionalGroupKeyPerRow - - 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.

setCurrentRow

public void setCurrentRow(MultiKey groupKey)
Description copied from interface: AggregationService
Set the current aggregation state row - for use when evaluation nodes are asked to evaluate.

Parameters:
groupKey - - key identify the row of aggregation states

getValue

public Object getValue(int column)
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
Returns:
current aggragation state