You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/06/22 00:58:26 UTC

[incubator-iotdb] branch master updated: make SessionDataSetWrapper (#1398)

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

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new ccc627a  make SessionDataSetWrapper (#1398)
ccc627a is described below

commit ccc627ab8b7af04ca8ccb40dc2b0068198acc045
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Mon Jun 22 08:58:15 2020 +0800

    make SessionDataSetWrapper (#1398)
---
 .../org/apache/iotdb/session/pool/SessionDataSetWrapper.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java b/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
index 53df42d..a6e639d 100644
--- a/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
+++ b/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
@@ -27,7 +27,7 @@ import org.apache.iotdb.session.SessionDataSet.DataIterator;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.read.common.RowRecord;
 
-public class SessionDataSetWrapper {
+public class SessionDataSetWrapper implements AutoCloseable{
 
   SessionDataSet sessionDataSet;
   Session session;
@@ -91,4 +91,11 @@ public class SessionDataSetWrapper {
   public List<TSDataType> getColumnTypes() {
     return sessionDataSet.getColumnTypes();
   }
+
+  /**
+   * close this dataset to release the session
+   */
+  public void close() {
+    pool.closeResultSet(this);
+  }
 }