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/03/28 09:52:34 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #5320: [IOTDB-1614] New WAL

HTHou commented on a change in pull request #5320:
URL: https://github.com/apache/iotdb/pull/5320#discussion_r836248972



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
##########
@@ -33,7 +34,7 @@
 import java.util.List;
 import java.util.Set;
 
-public abstract class InsertPlan extends PhysicalPlan {
+public abstract class InsertPlan extends PhysicalPlan implements WALEditValue {

Review comment:
       Why implements WALEditValue?

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
##########
@@ -85,7 +88,7 @@
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 @SuppressWarnings("java:S1135") // ignore todos
-public class TsFileProcessor {
+public class TsFileProcessor implements WALSubmitter {

Review comment:
       Why TsFileProcessor implements WALSubmitter? It seems so weird.. 

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertMultiTabletPlan.java
##########
@@ -280,6 +295,21 @@ public void serializeImpl(ByteBuffer buffer) {
     }
   }
 
+  @Override
+  public void serializeToWAL(IWALByteBufferView buffer) {
+    int type = PhysicalPlanType.MULTI_BATCH_INSERT.ordinal();
+    buffer.put((byte) type);
+    buffer.putInt(insertTabletPlanList.size());
+    for (InsertTabletPlan insertTabletPlan : insertTabletPlanList) {
+      insertTabletPlan.subSerialize(buffer);
+    }
+
+    buffer.putInt(parentInsertTabletPlanIndexList.size());
+    for (Integer index : parentInsertTabletPlanIndexList) {
+      buffer.putInt(index);
+    }
+  }
+

Review comment:
       Any differences with `serializeImpl`? Add some Javadoc?




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