You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/01/14 16:42:35 UTC

[GitHub] [iotdb] ZhanGHanG9991 opened a new pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

ZhanGHanG9991 opened a new pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837


   ## Description
   
   
   ### Content1 ...
   
   ### Content2 ...
   
   ### Content3 ...
   
   <!--
   In each section, please describe design decisions made, including:
    - Choice of algorithms
    - Behavioral aspects. What configuration values are acceptable? How are corner cases and error 
       conditions handled, such as when there are insufficient resources?
    - Class organization and design (how the logic is split between classes, inheritance, composition, 
       design patterns)
    - Method organization and design (how the logic is split between methods, parameters and return types)
    - Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
   -->
   
   
   <!-- It's good to describe an alternative design (or mention an alternative name) for every design 
   (or naming) decision point and compare the alternatives with the designs that you've implemented 
   (or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
   
   <!-- If there was a discussion of the design of the feature implemented in this PR elsewhere 
   (e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list), 
   link to that discussion from this PR description and explain what have changed in your final design 
   compared to your original proposal or the consensus version in the end of the discussion. 
   If something hasn't changed since the original discussion, you can omit a detailed discussion of 
   those aspects of the design here, perhaps apart from brief mentioning for the sake of readability 
   of this PR description. -->
   
   <!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
   
   <hr>
   
   This PR has:
   - [ ] been self-reviewed.
       - [ ] concurrent read
       - [ ] concurrent write
       - [ ] concurrent read and write 
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. 
   - [ ] added or updated version, __license__, or notice information
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious 
     for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold 
     for code coverage.
   - [ ] added integration tests.
   - [ ] been tested in a test IoTDB cluster.
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items 
   apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items 
   from the checklist above are strictly necessary, but it would be very helpful if you at least 
   self-review the PR. -->
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) in this PR
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SilverNarcissus commented on a change in pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#discussion_r785594156



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1230,6 +1231,38 @@ public void insertRecordsOfOneDevice(
     }
   }
 
+  /**
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   *
+   * <p>Each row could have same deviceId but different time, number of measurements, number of
+   * values as String
+   *
+   * @param haveSorted deprecated, whether the times have been sorted
+   */
+  public void insertStringRecordsOfOneDevice(

Review comment:
       Please also add this interface at SessionPool.java

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1230,6 +1231,38 @@ public void insertRecordsOfOneDevice(
     }
   }
 
+  /**
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   *
+   * <p>Each row could have same deviceId but different time, number of measurements, number of
+   * values as String
+   *
+   * @param haveSorted deprecated, whether the times have been sorted
+   */
+  public void insertStringRecordsOfOneDevice(

Review comment:
       Please also update doc of session (in doc directory). Session is a user interface and we need enough doc.

##########
File path: thrift/src/main/thrift/rpc.thrift
##########
@@ -269,6 +269,15 @@ struct TSInsertRecordsOfOneDeviceReq {
     6: optional bool isAligned
 }
 
+struct TSInsertStringRecordsOfOneDeviceReq {

Review comment:
       Since you change rpc.thrift,  you should also update rpc change list doc. 

##########
File path: integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
##########
@@ -782,6 +782,42 @@ public void testInsertOneDeviceRecordsWithIncorrectOrder()
     session.close();
   }
 
+  @Test
+  public void testInsertStringRecordsOfOneDeviceWithOrder()
+      throws IoTDBConnectionException, StatementExecutionException {
+    session = new Session("127.0.0.1", 6667, "root", "root");
+    session.open();
+    List<Long> times = new ArrayList<>();
+    List<List<String>> measurements = new ArrayList<>();
+    List<List<String>> values = new ArrayList<>();
+
+    addStringLine(times, measurements, values, 1L, "s4", "s5", "5.0", "true");
+    addStringLine(times, measurements, values, 2L, "s2", "s3", "3", "4");
+    addStringLine(times, measurements, values, 3L, "s1", "s2", "false", "6");
+
+    session.insertStringRecordsOfOneDevice("root.sg.d1", times, measurements, values, true);

Review comment:
       You should also test a scenario that isAligned = false.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#issuecomment-1013340685


   
   [![Coverage Status](https://coveralls.io/builds/45651993/badge)](https://coveralls.io/builds/45651993)
   
   Coverage increased (+0.01%) to 68.092% when pulling **8bbb76135c31fb810611fd34e69ecba05255f7f3 on ZhanGHanG9991:zh_insertwithstr** into **53f48d2f6bf3ffe716ca9067fb0b9275f7665780 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#issuecomment-1013340685


   
   [![Coverage Status](https://coveralls.io/builds/45671491/badge)](https://coveralls.io/builds/45671491)
   
   Coverage decreased (-0.2%) to 67.891% when pulling **4e169bedeaa6b01a24341ed2a342143467a3b001 on ZhanGHanG9991:zh_insertwithstr** into **53f48d2f6bf3ffe716ca9067fb0b9275f7665780 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] ZhanGHanG9991 commented on a change in pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
ZhanGHanG9991 commented on a change in pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#discussion_r785672922



##########
File path: integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
##########
@@ -782,6 +782,42 @@ public void testInsertOneDeviceRecordsWithIncorrectOrder()
     session.close();
   }
 
+  @Test
+  public void testInsertStringRecordsOfOneDeviceWithOrder()
+      throws IoTDBConnectionException, StatementExecutionException {
+    session = new Session("127.0.0.1", 6667, "root", "root");
+    session.open();
+    List<Long> times = new ArrayList<>();
+    List<List<String>> measurements = new ArrayList<>();
+    List<List<String>> values = new ArrayList<>();
+
+    addStringLine(times, measurements, values, 1L, "s4", "s5", "5.0", "true");
+    addStringLine(times, measurements, values, 2L, "s2", "s3", "3", "4");
+    addStringLine(times, measurements, values, 3L, "s1", "s2", "false", "6");
+
+    session.insertStringRecordsOfOneDevice("root.sg.d1", times, measurements, values, true);

Review comment:
       I've added the aligned methods' unit tests.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#issuecomment-1013340685


   
   [![Coverage Status](https://coveralls.io/builds/45671004/badge)](https://coveralls.io/builds/45671004)
   
   Coverage decreased (-0.2%) to 67.913% when pulling **9038999089b030898f49e9f6897ca71e30d1d0eb on ZhanGHanG9991:zh_insertwithstr** into **53f48d2f6bf3ffe716ca9067fb0b9275f7665780 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#issuecomment-1013340685


   
   [![Coverage Status](https://coveralls.io/builds/45641554/badge)](https://coveralls.io/builds/45641554)
   
   Coverage decreased (-0.03%) to 68.063% when pulling **5d4197df764a44ff478a7af16e9063c28ae0fd83 on ZhanGHanG9991:zh_insertwithstr** into **001490bbd734eab37ee4dcc5530b0dac33603870 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] ZhanGHanG9991 commented on a change in pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
ZhanGHanG9991 commented on a change in pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#discussion_r785673125



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1230,6 +1231,38 @@ public void insertRecordsOfOneDevice(
     }
   }
 
+  /**
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   *
+   * <p>Each row could have same deviceId but different time, number of measurements, number of
+   * values as String
+   *
+   * @param haveSorted deprecated, whether the times have been sorted
+   */
+  public void insertStringRecordsOfOneDevice(

Review comment:
       I've update the session doc.

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1230,6 +1231,38 @@ public void insertRecordsOfOneDevice(
     }
   }
 
+  /**
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   *
+   * <p>Each row could have same deviceId but different time, number of measurements, number of
+   * values as String
+   *
+   * @param haveSorted deprecated, whether the times have been sorted
+   */
+  public void insertStringRecordsOfOneDevice(

Review comment:
       I've updated the session doc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] ZhanGHanG9991 commented on a change in pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
ZhanGHanG9991 commented on a change in pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#discussion_r785673390



##########
File path: thrift/src/main/thrift/rpc.thrift
##########
@@ -269,6 +269,15 @@ struct TSInsertRecordsOfOneDeviceReq {
     6: optional bool isAligned
 }
 
+struct TSInsertStringRecordsOfOneDeviceReq {

Review comment:
       I've updated this rpc change list doc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] ZhanGHanG9991 commented on a change in pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
ZhanGHanG9991 commented on a change in pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#discussion_r785674504



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1230,6 +1231,38 @@ public void insertRecordsOfOneDevice(
     }
   }
 
+  /**
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   *
+   * <p>Each row could have same deviceId but different time, number of measurements, number of
+   * values as String
+   *
+   * @param haveSorted deprecated, whether the times have been sorted
+   */
+  public void insertStringRecordsOfOneDevice(

Review comment:
       I've added 4 interfaces(insertStringRecordsOfOneDevice with haveSorted, insertStringRecordsOfOneDevice, insertAlignedStringRecordsOfOneDevice with haveSorted, insertAlignedStringRecordsOfOneDevice) to SessionPool.java.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin merged pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls commented on pull request #4837: [IOTDB-2045] Add insertStringRecordsOfOneDevice in session

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #4837:
URL: https://github.com/apache/iotdb/pull/4837#issuecomment-1013340685


   
   [![Coverage Status](https://coveralls.io/builds/45641293/badge)](https://coveralls.io/builds/45641293)
   
   Coverage decreased (-0.01%) to 68.076% when pulling **5d4197df764a44ff478a7af16e9063c28ae0fd83 on ZhanGHanG9991:zh_insertwithstr** into **001490bbd734eab37ee4dcc5530b0dac33603870 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org