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/05/16 02:52:09 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #3175: [ISSUE-2742] A lighter InsertPlan for single data point insertion

jixuan1989 commented on a change in pull request #3175:
URL: https://github.com/apache/iotdb/pull/3175#discussion_r632955682



##########
File path: docs/UserGuide/API/Programming-Java-Native-API.md
##########
@@ -130,6 +130,18 @@ void deleteData(List<String> paths, long time)
 void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)
 ```
 
+* Insert single point,which contains one measurement value of a device at a timestamp.  With type info the server has no need to do type inference, which leads a better performance
+
+```java
+void insertSinglePoint(String deviceId, long time, String measurement, TSDataType type, String value)

Review comment:
       `insertPoint` is fine.

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -831,6 +832,43 @@ public void insert(InsertRowPlan insertRowPlan)
     }
   }
 
+  public void InsertSinglePoint(InsertSinglePointPlan insertSinglePointPlan)

Review comment:
       `public void InsertSinglePoint`

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
##########
@@ -216,6 +218,53 @@ public void insert(InsertRowPlan insertRowPlan) throws WriteProcessException {
     tsFileResource.updatePlanIndexes(insertRowPlan.getIndex());
   }
 
+  /**
+   * insert data in an InsertRowPlan into the workingMemtable.
+   *
+   * @param insertSinglePointPlan physical plan of insertion
+   */
+  public void InsertSinglePoint(InsertSinglePointPlan insertSinglePointPlan)

Review comment:
       `public void insertSinglePoint`

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/memtable/IMemTable.java
##########
@@ -73,6 +74,8 @@
 
   void insert(InsertRowPlan insertRowPlan);
 
+  void InsertSinglePoint(InsertSinglePointPlan insertSinglePointPlan);

Review comment:
       `insertSinglePoint`

##########
File path: docs/UserGuide/API/Programming-Java-Native-API.md
##########
@@ -130,6 +130,18 @@ void deleteData(List<String> paths, long time)
 void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)
 ```
 
+* Insert single point,which contains one measurement value of a device at a timestamp.  With type info the server has no need to do type inference, which leads a better performance
+
+```java
+void insertSinglePoint(String deviceId, long time, String measurement, TSDataType type, String value)
+```
+
+* Insert single point,which contains one measurement string value of a device at a timestamp. Without type info the server has to do type inference, which may cost some time
+
+```java
+void insertStringSinglePoint(String deviceId, long time, String measurement, String value)

Review comment:
       insertStringPoint

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -2013,6 +2014,19 @@ public void collectMeasurementSchema(
     }
   }
 
+  private TSDataType getType(InsertSinglePointPlan plan) throws MetadataException {

Review comment:
       as you have only one point, you do not need to use `InsertSinglePointPlan` as the parameter. 




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

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