The Siddhi Aggregate Function consumes zero or more parameters for each event and outputs a single attribute with an aggregated result based on the input parameters as an output. This could be used in conjunction with a window in order to find the aggregated results based on a given window such as the Aggregate Function operator.
Ti To implement a custom aggregate function, follow the procedure below.
- Create a class extending the
org.wso2.siddhi.core.query.selector.attribute.aggregator.AttributeAggregator
. - Create an appropriate
.siddhiext
extension mapping file. - Compile the class.
- Build the jar containing the .class and .siddhiext files.
- Add the jar to the Siddhi class path. If you need to run them the extension on WSO2 CEPDAS, add it to the
<CEP<DAS_HOME>/repository/components/dropins
directory.
...