public interface AggregationMultiFunctionHandler
Note the information returned by getReturnType()
must match the
value objects returned by accessors provided by getAccessorMode()
.
For example, assuming you have an EPL statement such as select search(), query() from MyEvent
then you would likely use one handler class and two handler objects (one for search and one for query).
Modifier and Type | Method and Description |
---|---|
AggregationMultiFunctionAccessorMode |
getAccessorMode()
Describes to the compiler how it should manage code for providing aggregation accessors.
|
AggregationMultiFunctionAgentMode |
getAgentMode()
Describes to the compiler how it should manage code for providing aggregation agents.
|
AggregationMultiFunctionStateKey |
getAggregationStateUniqueKey()
Return a state-key object that determines how the runtimeshares aggregation state
between multiple aggregation functions that may appear in the same EPL statement.
|
EPType |
getReturnType()
Provide return type.
|
AggregationMultiFunctionStateMode |
getStateMode()
Describes to the compiler how it should manage code for providing aggregation state.
|
AggregationMultiFunctionTableReaderMode |
getTableReaderMode()
Describes to the compiler how it should manage code for providing table column reader.
|
EPType getReturnType()
The accessor return values must match the return type declared herein.
Use EPTypeHelper.singleValue(Class)
(Class)} to indicate that the accessor
returns a single value. The accessor should return the single value upon invocation of
AggregationMultiFunctionAccessor.getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor should return a null value for all other accessor methods.
Use EPTypeHelper.collectionOfEvents(EventType)
to indicate that the accessor
returns a collection of events. The accessor should return a value in
AggregationMultiFunctionAccessor.getEnumerableEvents(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor can also return an array of underlying event objects in
AggregationMultiFunctionAccessor.getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor should return a null value for all other accessor methods.
Use EPTypeHelper.singleEvent(EventType)
to indicate that the accessor
returns a single event. The accessor should return a value in
AggregationMultiFunctionAccessor.getEnumerableEvent(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor can also return the underlying event object in
AggregationMultiFunctionAccessor.getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor should return a null value for all other accessor methods.
Use EPTypeHelper.collectionOfSingleValue(Class)
to indicate that the accessor
returns a collection of single values (scalar, object etc.). The accessor should return a java.util.Collection in
AggregationMultiFunctionAccessor.getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor should return a null value for all other accessor methods.
Use EPTypeHelper.array(Class)
to indicate that the accessor
returns an array of single values. The accessor should return an array in
AggregationMultiFunctionAccessor.getValue(AggregationMultiFunctionState, EventBean[], boolean, ExprEvaluatorContext)
.
The accessor should return a null value for all other accessor methods.
AggregationMultiFunctionStateKey getAggregationStateUniqueKey()
The runtimeapplies equals-semantics to determine state sharing. If
two AggregationMultiFunctionStateKey
instances are equal (implement hashCode and equals)
then the runtimeshares a single aggregation state instance for the two
aggregation function expressions.
If your aggregation function never needs shared state
simple return new AggregationStateKey(){}
.
If your aggregation function always shares state
simple declare private static final AggregationStateKey MY_KEY = new AggregationStateKey() {};
and return MY_KEY
; (if using multiple handlers declare the key on the factory level).
AggregationMultiFunctionStateMode getStateMode()
AggregationMultiFunctionAccessorMode getAccessorMode()
AggregationMultiFunctionAgentMode getAgentMode()
AggregationMultiFunctionTableReaderMode getTableReaderMode()
Copyright © 2005–2018. All rights reserved.