Click or drag to resize

AggregationMultiFunctionHandler Interface

Part of the aggregation multi-function extension API, this class represents one of more aggregation function expression instances. This class is responsible for providing a state reader (called accessor) for returning value from aggregation state, and for providing return type information of the accessor, and for providing state factory information.

Note the information returned by must match the value objects returned by accessors provided by .

For example, assuming you have an EPL statement such as {@code select search(), query() from MyEvent} then you would likely use one handler class and two handler objects (one for search and one for query).

Namespace:  com.espertech.esper.common.client.hook.aggmultifunc
Assembly:  NEsper.Common (in NEsper.Common.dll) Version: 8.0.0.0
Syntax
C#
public interface AggregationMultiFunctionHandler

The AggregationMultiFunctionHandler type exposes the following members.

Properties
  NameDescription
Public propertyAccessorMode
Describes to the compiler how it should manage code for providing aggregation accessors.
Public propertyAgentMode
Describes to the compiler how it should manage code for providing aggregation agents.
Public propertyAggregationStateUniqueKey
Return a state-key object that determines how the runtime shares aggregation state between multiple aggregation functions that may appear in the same EPL statement.

The runtime applies equals-semantics to determine state sharing. If two instances are equal (implement hashCode and equals) then the runtime shares a single aggregation state instance for the two aggregation function expressions.

If your aggregation function never needs shared state simple return {@code new AggregationStateKey(){}}.

If your aggregation function always shares state simple declare {@code private static final AggregationStateKey MY_KEY = new AggregationStateKey() {};} and {@code return MY_KEY}; (if using multiple handlers declare the key on the factory level).

Public propertyReturnType
Provide return type.

The accessor return values must match the return type declared herein.

Use to indicate that the accessor returns a single value. The accessor should return the single value upon invocation of . The accessor should return a null value for all other accessor methods.

Use {@link EPTypeHelper#collectionOfEvents(EventType)} to indicate that the accessor returns a collection of events. The accessor should return a value in . The accessor can also return an array of underlying event objects in . The accessor should return a null value for all other accessor methods.

Use {@link EPTypeHelper#singleEvent(EventType)} to indicate that the accessor returns a single event. The accessor should return a value in . The accessor can also return the underlying event object in {@link AggregationMultiFunctionAccessor#getValue. The accessor should return a null value for all other accessor methods.

Use to indicate that the accessor returns a collection of single values (scalar, object etc.). The accessor should return a Collection in . The accessor should return a null value for all other accessor methods.

Use to indicate that the accessor returns an array of single values. The accessor should return an array in {@link AggregationMultiFunctionAccessor#getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)}. The accessor should return a null value for all other accessor methods.

Public propertyStateMode
Describes to the compiler how it should manage code for providing aggregation state.
Public propertyTableReaderMode
Describes to the compiler how it should manage code for providing table column reader.
Top
See Also