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 2021/10/12 12:30:06 UTC

[GitHub] [iotdb] ruanwenjun commented on a change in pull request #4073: [ISSUE-4072] Parallel insert records in Session

ruanwenjun commented on a change in pull request #4073:
URL: https://github.com/apache/iotdb/pull/4073#discussion_r727088794



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -2096,6 +2010,71 @@ private TSCreateSchemaTemplateReq getTSCreateSchemaTemplateReq(
     return request;
   }
 
+  /**
+   * @param recordsGroup connection to record map
+   * @param insertConsumer insert function
+   * @param <T>
+   *     <ul>
+   *       <li>{@link TSInsertRecordsReq}
+   *       <li>{@link TSInsertStringRecordsReq}
+   *       <li>{@link TSInsertTabletsReq}
+   *     </ul>
+   *
+   * @throws IoTDBConnectionException
+   * @throws StatementExecutionException
+   */
+  private <T> void insertRecordsGroup(

Review comment:
       Done

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -2096,6 +2010,71 @@ private TSCreateSchemaTemplateReq getTSCreateSchemaTemplateReq(
     return request;
   }
 
+  /**
+   * @param recordsGroup connection to record map
+   * @param insertConsumer insert function
+   * @param <T>
+   *     <ul>
+   *       <li>{@link TSInsertRecordsReq}
+   *       <li>{@link TSInsertStringRecordsReq}
+   *       <li>{@link TSInsertTabletsReq}
+   *     </ul>
+   *
+   * @throws IoTDBConnectionException
+   * @throws StatementExecutionException
+   */
+  private <T> void insertRecordsGroup(
+      Map<SessionConnection, T> recordsGroup, InsertConsumer<T> insertConsumer)
+      throws IoTDBConnectionException, StatementExecutionException {
+    List<CompletableFuture<Void>> completableFutures =
+        recordsGroup.entrySet().stream()
+            .map(
+                entry -> {

Review comment:
       Done




-- 
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