You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/12/23 01:59:41 UTC

[iotdb] branch ISessionDataSet updated (897a7e05bc -> 672c8fd7aa)

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

haonan pushed a change to branch ISessionDataSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from 897a7e05bc Add ISessionDataSet interface
     add 0d6e6431f1 remove cross test (#8585)
     add 15c0eabcb6 [IOTDB-5117] Fix some issues in MemoryDistributionCalculator (#8580)
     add 2c5ddb08d8 change faq in config.js (#8588)
     add ae1570a098 Eliminate useless code in SchemaRegion and MTree (#8587)
     add b203af5e33 [IOTDB-5127]Separate ISession and ISessionPool as a module (#8583)
     new 03f5618be1 Add ISessionDataSet interface
     new 4ac3888fd3 Add ISessionDataSet interface
     new 672c8fd7aa Merge branch 'ISessionDataSet' of https://github.com/apache/iotdb into ISessionDataSet

The 3 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.


Summary of changes:
 .../main/java/org/apache/iotdb/tool/ExportCsv.java |   2 +-
 .../java/org/apache/iotdb/tool/ExportTsFile.java   |   2 +-
 .../main/java/org/apache/iotdb/tool/ImportCsv.java |   2 +-
 cross-tests/pom.xml                                | 125 ------
 .../tests/tools/importCsv/AbstractScript.java      | 125 ------
 .../tests/tools/importCsv/ExportCsvTestIT.java     | 148 -------
 .../tests/tools/importCsv/ImportCsvTestIT.java     | 432 ---------------------
 .../tests/tools/tsfile/ExportTsFileTestIT.java     | 124 ------
 .../src/test/resources/iotdb-datanode.properties   |  23 --
 .../iotdb/AlignedTimeseriesSessionExample.java     |   4 +-
 .../org/apache/iotdb/DataMigrationExample.java     |   4 +-
 .../iotdb/HybridTimeseriesSessionExample.java      |   2 +-
 .../org/apache/iotdb/SessionConcurrentExample.java |   2 +-
 .../main/java/org/apache/iotdb/SessionExample.java |   8 +-
 .../java/org/apache/iotdb/SessionPoolExample.java  |   4 +-
 .../iotdb/SyntaxConventionRelatedExample.java      |   4 +-
 .../java/org/apache/iotdb/flink/IoTDBSource.java   |   2 +-
 .../iotdb/influxdb/session/InfluxDBSession.java    |   2 +-
 integration-test/import-control.xml                |   2 +
 .../java/org/apache/iotdb/it/env/AbstractEnv.java  |   4 +-
 .../org/apache/iotdb/it/env/RemoteServerEnv.java   |   2 +-
 .../java/org/apache/iotdb/itbase/env/BaseEnv.java  |   6 +-
 .../org/apache/iotdb/db/it/env/StandaloneEnv.java  |   6 +-
 .../iotdb/session/it/IoTDBConnectionInfoIT.java    |   2 +-
 .../session/it/IoTDBSessionAlignedInsertIT.java    |   4 +-
 .../iotdb/session/it/IoTDBSessionComplexIT.java    |   4 +-
 .../it/IoTDBSessionDisableMemControlIT.java        |   4 +-
 .../iotdb/session/it/IoTDBSessionInsertNullIT.java |   4 +-
 .../IoTDBSessionInsertWithTriggerExecutionIT.java  |   2 +-
 .../session/it/IoTDBSessionSchemaTemplateIT.java   |   6 +-
 .../iotdb/session/it/IoTDBSessionSimpleIT.java     |   4 +-
 .../session/it/IoTDBSessionSyntaxConventionIT.java |   4 +-
 .../org/apache/iotdb/session/it/SessionIT.java     |   4 +-
 .../iotdb/session/it/pool/SessionPoolIT.java       |   6 +-
 .../org/apache/iotdb/tools/ExportCsvTestIT.java    |   2 +-
 .../org/apache/iotdb/tools/ExportTsFileTestIT.java |   2 +-
 .../session/IoTDBSessionAlignedABDeviceIT.java     |   1 +
 .../session/IoTDBSessionAlignedAggregationIT.java  |   1 +
 .../IoTDBSessionAlignedAggregationWithUnSeqIT.java |   1 +
 .../iotdb/session/IoTDBSessionIteratorIT.java      |   3 +-
 {example/tsfile => isession}/pom.xml               |  10 +-
 .../org/apache/iotdb/isession}/IDataIterator.java  |   2 +-
 .../java/org/apache/iotdb/isession}/ISession.java  |  42 +-
 .../apache/iotdb/isession}/ISessionDataSet.java    |   2 +-
 .../org/apache/iotdb/isession}/SessionConfig.java  |   4 +-
 .../org/apache/iotdb/isession}/SessionDataSet.java |   2 +-
 .../apache/iotdb/isession/pool/ISessionPool.java   | 388 +++++++++---------
 .../isession}/pool/SessionDataSetWrapper.java      |  29 +-
 .../apache/iotdb/isession}/template/Template.java  |   2 +-
 .../iotdb/isession}/template/TemplateNode.java     |   2 +-
 .../apache/iotdb/isession/util/SystemStatus.java   |  24 +-
 .../org/apache/iotdb/isession}/util/Version.java   |   2 +-
 .../reporter/iotdb/SessionIoTDBReporter.java       |   2 +-
 pom.xml                                            |   1 +
 .../iotdb/db/metadata/mtree/IMTreeBelowSG.java     |  55 ---
 .../db/metadata/mtree/MTreeBelowSGCachedImpl.java  | 138 -------
 .../db/metadata/mtree/MTreeBelowSGMemoryImpl.java  | 126 ------
 .../schemaregion/SchemaRegionMemoryImpl.java       |  37 --
 .../schemaregion/SchemaRegionSchemaFileImpl.java   |  57 ---
 .../db/mpp/plan/planner/LocalExecutionPlanner.java |   2 +-
 .../plan/planner/MemoryDistributionCalculator.java |  55 +--
 .../iotdb/db/metadata/mtree/MTreeBelowSGTest.java  | 216 +----------
 session/pom.xml                                    |   6 +
 .../java/org/apache/iotdb/session/Session.java     |  10 +-
 .../apache/iotdb/session/SessionConnection.java    |   2 +
 .../org/apache/iotdb/session/pool/SessionPool.java | 309 ++++++++++-----
 .../iotdb/session/template/InternalNode.java       |   1 +
 .../iotdb/session/template/MeasurementNode.java    |   1 +
 .../apache/iotdb/session/SessionCacheLeaderUT.java |   1 +
 site/src/main/.vuepress/config.js                  |   2 +
 .../test/java/org/apache/iotdb/db/sql/Cases.java   |   2 +-
 71 files changed, 610 insertions(+), 2011 deletions(-)
 delete mode 100644 cross-tests/pom.xml
 delete mode 100644 cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/AbstractScript.java
 delete mode 100644 cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/ExportCsvTestIT.java
 delete mode 100644 cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/ImportCsvTestIT.java
 delete mode 100644 cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/tsfile/ExportTsFileTestIT.java
 delete mode 100644 cross-tests/src/test/resources/iotdb-datanode.properties
 copy {example/tsfile => isession}/pom.xml (86%)
 copy {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/IDataIterator.java (98%)
 copy {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/ISession.java (94%)
 copy {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/ISessionDataSet.java (97%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/SessionConfig.java (96%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/SessionDataSet.java (99%)
 rename session/src/main/java/org/apache/iotdb/session/ISession.java => isession/src/main/java/org/apache/iotdb/isession/pool/ISessionPool.java (82%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/pool/SessionDataSetWrapper.java (80%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/template/Template.java (98%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/template/TemplateNode.java (97%)
 copy confignode/src/main/java/org/apache/iotdb/confignode/procedure/exception/ProcedureYieldException.java => isession/src/main/java/org/apache/iotdb/isession/util/SystemStatus.java (70%)
 rename {session/src/main/java/org/apache/iotdb/session => isession/src/main/java/org/apache/iotdb/isession}/util/Version.java (95%)


[iotdb] 02/03: Add ISessionDataSet interface

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

haonan pushed a commit to branch ISessionDataSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4ac3888fd3916ec3b279e8e99ba18c662117fe69
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Dec 22 16:46:36 2022 +0800

    Add ISessionDataSet interface
---
 .../src/main/java/org/apache/iotdb/isession}/IDataIterator.java         | 2 +-
 .../src/main/java/org/apache/iotdb/isession}/ISessionDataSet.java       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/session/src/main/java/org/apache/iotdb/session/IDataIterator.java b/isession/src/main/java/org/apache/iotdb/isession/IDataIterator.java
similarity index 98%
rename from session/src/main/java/org/apache/iotdb/session/IDataIterator.java
rename to isession/src/main/java/org/apache/iotdb/isession/IDataIterator.java
index 7d17f390af..83396da8c1 100644
--- a/session/src/main/java/org/apache/iotdb/session/IDataIterator.java
+++ b/isession/src/main/java/org/apache/iotdb/isession/IDataIterator.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.session;
+package org.apache.iotdb.isession;
 
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.StatementExecutionException;
diff --git a/session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java b/isession/src/main/java/org/apache/iotdb/isession/ISessionDataSet.java
similarity index 97%
rename from session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java
rename to isession/src/main/java/org/apache/iotdb/isession/ISessionDataSet.java
index 75d232fa4d..87f3ecb95e 100644
--- a/session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java
+++ b/isession/src/main/java/org/apache/iotdb/isession/ISessionDataSet.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.session;
+package org.apache.iotdb.isession;
 
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.StatementExecutionException;


[iotdb] 03/03: Merge branch 'ISessionDataSet' of https://github.com/apache/iotdb into ISessionDataSet

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

haonan pushed a commit to branch ISessionDataSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 672c8fd7aab54ccdfe609414d671d98caebf053f
Merge: 4ac3888fd3 897a7e05bc
Author: HTHou <hh...@outlook.com>
AuthorDate: Fri Dec 23 09:59:11 2022 +0800

    Merge branch 'ISessionDataSet' of https://github.com/apache/iotdb into ISessionDataSet

 .../org/apache/iotdb/session/IDataIterator.java    | 67 ++++++++++++++++++++++
 .../org/apache/iotdb/session/ISessionDataSet.java  | 44 ++++++++++++++
 2 files changed, 111 insertions(+)


[iotdb] 01/03: Add ISessionDataSet interface

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

haonan pushed a commit to branch ISessionDataSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 03f5618be1a0aafe14bcd0196bc73b03d3ff3e81
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Dec 22 16:39:51 2022 +0800

    Add ISessionDataSet interface
---
 .../org/apache/iotdb/isession/SessionDataSet.java  | 32 ++++++++++-
 .../org/apache/iotdb/session/IDataIterator.java    | 67 ++++++++++++++++++++++
 .../org/apache/iotdb/session/ISessionDataSet.java  | 44 ++++++++++++++
 3 files changed, 141 insertions(+), 2 deletions(-)

diff --git a/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java b/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
index e07a3c933f..bec006a2f6 100644
--- a/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
+++ b/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
@@ -37,7 +37,7 @@ import java.util.Map;
 
 import static org.apache.iotdb.rpc.IoTDBRpcDataSet.START_INDEX;
 
-public class SessionDataSet implements AutoCloseable {
+public class SessionDataSet implements ISessionDataSet {
 
   private final IoTDBRpcDataSet ioTDBRpcDataSet;
 
@@ -100,22 +100,27 @@ public class SessionDataSet implements AutoCloseable {
             timeout);
   }
 
+  @Override
   public int getFetchSize() {
     return ioTDBRpcDataSet.fetchSize;
   }
 
+  @Override
   public void setFetchSize(int fetchSize) {
     ioTDBRpcDataSet.fetchSize = fetchSize;
   }
 
+  @Override
   public List<String> getColumnNames() {
     return new ArrayList<>(ioTDBRpcDataSet.columnNameList);
   }
 
+  @Override
   public List<String> getColumnTypes() {
     return new ArrayList<>(ioTDBRpcDataSet.columnTypeList);
   }
 
+  @Override
   public boolean hasNext() throws StatementExecutionException, IoTDBConnectionException {
     return ioTDBRpcDataSet.next();
   }
@@ -176,6 +181,7 @@ public class SessionDataSet implements AutoCloseable {
     return new RowRecord(ioTDBRpcDataSet.time, outFields);
   }
 
+  @Override
   public RowRecord next() throws StatementExecutionException, IoTDBConnectionException {
     if (!ioTDBRpcDataSet.hasCachedRecord && !hasNext()) {
       return null;
@@ -185,6 +191,7 @@ public class SessionDataSet implements AutoCloseable {
     return constructRowRecordFromValueArray();
   }
 
+  @Override
   public void closeOperationHandle() throws StatementExecutionException, IoTDBConnectionException {
     try {
       ioTDBRpcDataSet.close();
@@ -193,6 +200,7 @@ public class SessionDataSet implements AutoCloseable {
     }
   }
 
+  @Override
   public DataIterator iterator() {
     return new DataIterator();
   }
@@ -202,84 +210,104 @@ public class SessionDataSet implements AutoCloseable {
     closeOperationHandle();
   }
 
-  public class DataIterator {
+  public class DataIterator implements IDataIterator {
 
+    @Override
     public boolean next() throws StatementExecutionException, IoTDBConnectionException {
       return ioTDBRpcDataSet.next();
     }
 
+    @Override
     public boolean isNull(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.isNull(columnIndex);
     }
 
+    @Override
     public boolean isNull(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.isNull(columnName);
     }
 
+    @Override
     public boolean getBoolean(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getBoolean(columnIndex);
     }
 
+    @Override
     public boolean getBoolean(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getBoolean(columnName);
     }
 
+    @Override
     public double getDouble(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getDouble(columnIndex);
     }
 
+    @Override
     public double getDouble(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getDouble(columnName);
     }
 
+    @Override
     public float getFloat(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getFloat(columnIndex);
     }
 
+    @Override
     public float getFloat(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getFloat(columnName);
     }
 
+    @Override
     public int getInt(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getInt(columnIndex);
     }
 
+    @Override
     public int getInt(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getInt(columnName);
     }
 
+    @Override
     public long getLong(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getLong(columnIndex);
     }
 
+    @Override
     public long getLong(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getLong(columnName);
     }
 
+    @Override
     public Object getObject(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getObject(columnIndex);
     }
 
+    @Override
     public Object getObject(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getObject(columnName);
     }
 
+    @Override
     public String getString(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getString(columnIndex);
     }
 
+    @Override
     public String getString(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getString(columnName);
     }
 
+    @Override
     public Timestamp getTimestamp(int columnIndex) throws StatementExecutionException {
       return ioTDBRpcDataSet.getTimestamp(columnIndex);
     }
 
+    @Override
     public Timestamp getTimestamp(String columnName) throws StatementExecutionException {
       return ioTDBRpcDataSet.getTimestamp(columnName);
     }
 
+    @Override
     public int findColumn(String columnName) {
       return ioTDBRpcDataSet.findColumn(columnName);
     }
diff --git a/session/src/main/java/org/apache/iotdb/session/IDataIterator.java b/session/src/main/java/org/apache/iotdb/session/IDataIterator.java
new file mode 100644
index 0000000000..7d17f390af
--- /dev/null
+++ b/session/src/main/java/org/apache/iotdb/session/IDataIterator.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.session;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+
+import java.sql.Timestamp;
+
+public interface IDataIterator {
+
+  boolean next() throws StatementExecutionException, IoTDBConnectionException;
+
+  boolean isNull(int columnIndex) throws StatementExecutionException;
+
+  boolean isNull(String columnName) throws StatementExecutionException;
+
+  boolean getBoolean(int columnIndex) throws StatementExecutionException;
+
+  boolean getBoolean(String columnName) throws StatementExecutionException;
+
+  double getDouble(int columnIndex) throws StatementExecutionException;
+
+  double getDouble(String columnName) throws StatementExecutionException;
+
+  float getFloat(int columnIndex) throws StatementExecutionException;
+
+  float getFloat(String columnName) throws StatementExecutionException;
+
+  int getInt(int columnIndex) throws StatementExecutionException;
+
+  int getInt(String columnName) throws StatementExecutionException;
+
+  long getLong(int columnIndex) throws StatementExecutionException;
+
+  long getLong(String columnName) throws StatementExecutionException;
+
+  Object getObject(int columnIndex) throws StatementExecutionException;
+
+  Object getObject(String columnName) throws StatementExecutionException;
+
+  String getString(int columnIndex) throws StatementExecutionException;
+
+  String getString(String columnName) throws StatementExecutionException;
+
+  Timestamp getTimestamp(int columnIndex) throws StatementExecutionException;
+
+  Timestamp getTimestamp(String columnName) throws StatementExecutionException;
+
+  int findColumn(String columnName);
+}
diff --git a/session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java b/session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java
new file mode 100644
index 0000000000..75d232fa4d
--- /dev/null
+++ b/session/src/main/java/org/apache/iotdb/session/ISessionDataSet.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.session;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+
+import java.util.List;
+
+public interface ISessionDataSet extends AutoCloseable {
+
+  int getFetchSize();
+
+  void setFetchSize(int fetchSize);
+
+  List<String> getColumnNames();
+
+  List<String> getColumnTypes();
+
+  boolean hasNext() throws StatementExecutionException, IoTDBConnectionException;
+
+  RowRecord next() throws StatementExecutionException, IoTDBConnectionException;
+
+  void closeOperationHandle() throws StatementExecutionException, IoTDBConnectionException;
+
+  IDataIterator iterator();
+}