com.espertech.esper.epl.agg
Class AggregationServiceGroupAllImpl

java.lang.Object
  extended by com.espertech.esper.epl.agg.AggregationServiceBase
      extended by com.espertech.esper.epl.agg.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 com.espertech.esper.epl.agg.AggregationServiceBase
aggregators, evaluators
 
Constructor Summary
AggregationServiceGroupAllImpl(ExprEvaluator[] evaluators, AggregationMethod[] aggregators)
          Ctor.
 
Method Summary
 void applyEnter(EventBean[] eventsPerStream, MultiKeyUntyped optionalGroupKeyPerRow)
          Apply events as entering a window (new events).
 void applyLeave(EventBean[] eventsPerStream, MultiKeyUntyped optionalGroupKeyPerRow)
          Apply events as leaving a window (old events).
 void clearResults()
          Clear current aggregation state.
 Object getValue(int column)
          Returns current aggregation state, for use by expression node representing an aggregation function.
 void setCurrentRow(MultiKeyUntyped 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,
                                      AggregationMethod[] 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,
                       MultiKeyUntyped 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,
                       MultiKeyUntyped 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(MultiKeyUntyped 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

clearResults

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


© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com