diff options
| author | wangkuan <[email protected]> | 2024-08-13 17:14:57 +0800 |
|---|---|---|
| committer | wangkuan <[email protected]> | 2024-08-13 17:14:57 +0800 |
| commit | e9d132716800f4b8ef46273b254c173c3d450864 (patch) | |
| tree | 8de3a880c0453e1323eb37ae0d35b80ea394a09b /groot-common | |
| parent | ca9b39be199b3d093a8a1366257bf49876ddbee4 (diff) | |
[improve][core]拆分聚合函数open方法,较少调用次数,优化性能feature/aggregate
Diffstat (limited to 'groot-common')
| -rw-r--r-- | groot-common/src/main/java/com/geedgenetworks/common/udf/AggregateFunction.java | 7 |
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(){}; } |
