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

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

commit 7a3b33c51f4eb8541de4e83f7e470af03136919d
Author: Steve Yurong Su <[email protected]>
AuthorDate: Thu Nov 25 09:47:53 2021 +0800

    add taskId to InsertTabletPlanTask
---
 .../src/main/java/org/apache/iotdb/SessionExample.java      | 13 ++++++++-----
 .../java/org/apache/iotdb/db/service/TSServiceImpl.java     |  7 +++++--
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java 
b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index ba80fac..6d878fe 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -58,8 +58,11 @@ public class SessionExample {
         new 
Session.Builder().host(LOCAL_HOST).port(6667).username("root").password("root").build();
     session.open(false);
 
-    // set session fetchSize
-    session.setFetchSize(10000);
+    long start = System.currentTimeMillis();
+    session.executeNonQueryStatement(
+        "select s1,s2,s3 into root.sg2.d1.s1,root.sg2.d1.s2,root.sg2.d1.s3"
+            + " from root.sg1.d1 where time>=2021-11-25T09:22:35.999+08:00 and 
time <= 2021-12-06T23:09:15.989+08:00");
+    System.out.println(System.currentTimeMillis() - start);
 
     //    try {
     //      session.setStorageGroup("root.sg1");
@@ -73,7 +76,7 @@ public class SessionExample {
     //    createTimeseries();
     //    createMultiTimeseries();
     //    insertRecord();
-    insertTablet();
+    //    insertTablet();
     //    insertTabletWithNullValues();
     //    insertTablets();
     //    insertRecords();
@@ -392,7 +395,7 @@ public class SessionExample {
     // Method 1 to add tablet data
     long timestamp = System.currentTimeMillis();
 
-    for (long row = 0; row < 1000; row++) {
+    for (long row = 0; row < 1_0000_0000; row++) {
       int rowIndex = tablet.rowSize++;
       tablet.addTimestamp(rowIndex, timestamp);
       for (int s = 0; s < 3; s++) {
@@ -403,7 +406,7 @@ public class SessionExample {
         session.insertTablet(tablet, true);
         tablet.reset();
       }
-      timestamp += 3600 * 1000;
+      timestamp += 10;
     }
 
     if (tablet.rowSize != 0) {
diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java 
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 93fe754..26b5fbb 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -1048,11 +1048,12 @@ public class TSServiceImpl extends BasicServiceProvider 
implements TSIService.If
       long sessionId) {
     ForkJoinPool forkJoinPool = new 
ForkJoinPool(Runtime.getRuntime().availableProcessors() << 1);
     List<ForkJoinTask<Void>> futures = new ArrayList<>();
+    int id = 0;
     for (String subStatement : split(udtfPlan, statement)) {
       futures.add(
           forkJoinPool.submit(
               new InsertTabletPlanTask(
-                  tsService, statementId, timeout, fetchSize, sessionId, 
subStatement)));
+                  tsService, statementId, timeout, fetchSize, sessionId, 
subStatement, id++)));
     }
     for (ForkJoinTask<Void> v : futures) {
       v.join();
@@ -1153,7 +1154,9 @@ public class TSServiceImpl extends BasicServiceProvider 
implements TSIService.If
         long timeout,
         int fetchSize,
         long sessionId,
-        String statement) {
+        String statement,
+        int taskId) {
+      LOGGER.info("InsertTabletPlanTask: {}", taskId);
       this.tsService = tsService;
       this.statementId = statementId;
       this.timeout = timeout;

Reply via email to