You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/11/14 10:26:44 UTC

[iotdb] branch ml/windowSet updated (edc3bb43b7 -> 511a6686f9)

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

hui pushed a change to branch ml/windowSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from edc3bb43b7 add V2 interface
     new f49ad6f113 spotless
     new 511a6686f9 add python session (tmp save)

The 2 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:
 client-py/iotdb/Session.py                         |  8 +++++++
 .../service/thrift/impl/ClientRPCServiceImpl.java  | 27 +++++++++++-----------
 .../apache/iotdb/db/utils/QueryDataSetUtils.java   |  6 ++---
 3 files changed, 25 insertions(+), 16 deletions(-)


[iotdb] 01/02: spotless

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

hui pushed a commit to branch ml/windowSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f49ad6f1131f6007e3aca65f303e37ffefb7de90
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Mon Nov 14 18:24:55 2022 +0800

    spotless
---
 .../service/thrift/impl/ClientRPCServiceImpl.java  | 27 +++++++++++-----------
 .../apache/iotdb/db/utils/QueryDataSetUtils.java   |  6 ++---
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/ClientRPCServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/ClientRPCServiceImpl.java
index a7796ac5d7..ab027fb138 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/ClientRPCServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/ClientRPCServiceImpl.java
@@ -457,8 +457,9 @@ public class ClientRPCServiceImpl implements IClientRPCServiceWithHandler {
 
       try (SetThreadName threadName = new SetThreadName(result.queryId.getId())) {
         TSFetchWindowBatchResp resp =
-                createTSFetchWindowBatchResp(queryExecution.getDatasetHeader());
-        resp.setWindowBatchDataSetList(QueryDataSetUtils.convertTsBlocksToWindowBatchDataSetList(queryExecution));
+            createTSFetchWindowBatchResp(queryExecution.getDatasetHeader());
+        resp.setWindowBatchDataSetList(
+            QueryDataSetUtils.convertTsBlocksToWindowBatchDataSetList(queryExecution));
         return resp;
       }
     } catch (Exception e) {
@@ -492,17 +493,17 @@ public class ClientRPCServiceImpl implements IClientRPCServiceWithHandler {
       QUERY_FREQUENCY_RECORDER.incrementAndGet();
       AUDIT_LOGGER.debug("Session {} execute fetch window set: {}", req.sessionId, req);
       long queryId =
-              SESSION_MANAGER.requestQueryId(SESSION_MANAGER.getCurrSession(), req.statementId);
+          SESSION_MANAGER.requestQueryId(SESSION_MANAGER.getCurrSession(), req.statementId);
       // create and cache dataset
       ExecutionResult result =
-              COORDINATOR.execute(
-                      s,
-                      queryId,
-                      SESSION_MANAGER.getSessionInfo(SESSION_MANAGER.getCurrSession()),
-                      "",
-                      PARTITION_FETCHER,
-                      SCHEMA_FETCHER,
-                      config.getQueryTimeoutThreshold());
+          COORDINATOR.execute(
+              s,
+              queryId,
+              SESSION_MANAGER.getSessionInfo(SESSION_MANAGER.getCurrSession()),
+              "",
+              PARTITION_FETCHER,
+              SCHEMA_FETCHER,
+              config.getQueryTimeoutThreshold());
 
       if (result.status.code != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         throw new RuntimeException("error code: " + result.status);
@@ -512,14 +513,14 @@ public class ClientRPCServiceImpl implements IClientRPCServiceWithHandler {
 
       try (SetThreadName threadName = new SetThreadName(result.queryId.getId())) {
         TSFetchWindowBatchResp resp =
-                createTSFetchWindowBatchResp(queryExecution.getDatasetHeader());
+            createTSFetchWindowBatchResp(queryExecution.getDatasetHeader());
         resp.setWindowBatch(QueryDataSetUtils.convertTsBlocksToWindowBatch(queryExecution));
         return resp;
       }
     } catch (Exception e) {
       // TODO call the coordinator to release query resource
       return RpcUtils.getTSFetchWindowBatchResp(
-              onQueryException(e, "\"" + req + "\". " + OperationType.EXECUTE_RAW_DATA_QUERY));
+          onQueryException(e, "\"" + req + "\". " + OperationType.EXECUTE_RAW_DATA_QUERY));
     } finally {
       addOperationLatency(Operation.EXECUTE_QUERY, startTime);
       long costTime = System.currentTimeMillis() - startTime;
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
index 17dd769f5a..8880ca2810 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java
@@ -428,8 +428,8 @@ public class QueryDataSetUtils {
     return windowSet;
   }
 
-  public static List<TSQueryDataSet> convertTsBlocksToWindowBatchDataSetList(IQueryExecution queryExecution)
-          throws IoTDBException, IOException {
+  public static List<TSQueryDataSet> convertTsBlocksToWindowBatchDataSetList(
+      IQueryExecution queryExecution) throws IoTDBException, IOException {
     List<TSQueryDataSet> windowSet = new ArrayList<>();
 
     int columnNum = queryExecution.getOutputValueColumnCount();
@@ -584,7 +584,7 @@ public class QueryDataSetUtils {
             break;
           default:
             throw new UnSupportedDataTypeException(
-                    String.format("Data type %s is not supported.", type));
+                String.format("Data type %s is not supported.", type));
         }
         if (k != columnNum - 1) {
           rowCount -= currentCount;


[iotdb] 02/02: add python session (tmp save)

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

hui pushed a commit to branch ml/windowSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 511a6686f9ec08b5c61256deb0f33be17636f07f
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Mon Nov 14 18:25:07 2022 +0800

    add python session (tmp save)
---
 client-py/iotdb/Session.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/client-py/iotdb/Session.py b/client-py/iotdb/Session.py
index 529a6a93d8..471dc98b62 100644
--- a/client-py/iotdb/Session.py
+++ b/client-py/iotdb/Session.py
@@ -1451,3 +1451,11 @@ class Session(object):
             )
         )
         return response.measurements
+
+    def fetch_window_batch(self, query_paths : list, function_name : str, fetch_args):
+        request = TSFetchWindowBatchReq(
+            self.__session_id,query_paths,function_name
+            fetch_args.
+        )
+        response = self.__client.fetch_window_batch(request)
+        return
\ No newline at end of file