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/21 11:19:53 UTC
[incubator-iotdb] 01/01: make SessionDataSetWrapper
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch add_close_for_SessionDataSetWrapper
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit c75c60009c29b7b2f755766eeecf813e6caf1a0b
Author: qiaojialin <64...@qq.com>
AuthorDate: Sun Jun 21 19:20:08 2020 +0800
make SessionDataSetWrapper
---
.../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);
+ }
}