summaryrefslogtreecommitdiff
path: root/groot-common
diff options
context:
space:
mode:
author王宽 <[email protected]>2024-08-13 09:27:37 +0000
committer王宽 <[email protected]>2024-08-13 09:27:37 +0000
commit3b5e06b70db295b3f4ec8d1e455a095009c82bc0 (patch)
treedb9396d047dc2312d54eb88d5ff3947123d648d4 /groot-common
parent647296e18fc36fab3b1e01bf276115fb1200d0eb (diff)
parente9d132716800f4b8ef46273b254c173c3d450864 (diff)
Merge branch 'feature/aggregate' into 'develop'
[improve][core]拆分聚合函数open方法,较少调用次数,优化性能 See merge request galaxy/platform/groot-stream!91
Diffstat (limited to 'groot-common')
-rw-r--r--groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java b/groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java
index 98450fd..455073f 100644
--- a/groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java
+++ b/groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java
@@ -7,7 +7,9 @@ import java.io.Serializable;
public interface AggregateFunction extends Serializable {
- Accumulator open(UDFContext udfContext,Accumulator acc);
+ void open(UDFContext udfContext);
+
+ Accumulator initAccumulator(Accumulator acc);
Accumulator add(Event val, Accumulator acc);
@@ -15,6 +17,5 @@ public interface AggregateFunction extends Serializable {
Accumulator getResult(Accumulator acc);
- void close();
-
+ default void close(){};
}