You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2023/11/30 08:32:26 UTC

(iotdb) branch beyyes/add_close_for_topkoperator created (now 78735ec9816)

This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a change to branch beyyes/add_close_for_topkoperator
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 78735ec9816 add close method for TopKOperator.java

This branch includes the following new commits:

     new 78735ec9816 add close method for TopKOperator.java

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: add close method for TopKOperator.java

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch beyyes/add_close_for_topkoperator
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 78735ec9816a4184015caadd484550b8544ece10
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Thu Nov 30 16:32:09 2023 +0800

    add close method for TopKOperator.java
---
 .../execution/operator/process/TopKOperator.java            | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/TopKOperator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/TopKOperator.java
index d59067463f9..e505687290b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/TopKOperator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/TopKOperator.java
@@ -242,6 +242,19 @@ public class TopKOperator implements ProcessOperator {
     return (topValue - resultReturnSize) * getMemoryUsageOfOneMergeSortKey();
   }
 
+  @Override
+  public void close() throws Exception {
+    for (Operator child : deviceOperators) {
+      if (child != null) {
+        child.close();
+      }
+    }
+
+    canCallNext = null;
+    topKResult = null;
+    tmpResultTsBlock = null;
+  }
+
   private void initResultTsBlock() {
     int positionCount = topValue;
     Column[] columns = new Column[dataTypes.size()];