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 <[email protected]>
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);
+ }
}