w41ter commented on code in PR #37787:
URL: https://github.com/apache/doris/pull/37787#discussion_r1680952975


##########
fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java:
##########
@@ -1264,6 +1266,25 @@ public void rollEditLog() {
         journal.rollJournal();
     }
 
+    private synchronized <T extends Writable> void logEdit(short op, List<T> 
entries) throws IOException {
+        List<JournalBatch> batches = new ArrayList<>();
+        JournalBatch batch = new JournalBatch(35);
+        for (T entry : entries) {
+            // the number of batch entities to less than 32 and the batch data 
size to less than 640KB
+            if (batch.getJournalEntities().size() >= 32 || batch.getSize() >= 
640 * 1024) {
+                batches.add(batch);

Review Comment:
   How about writing to journal directly, like:
   
   ```
   journal.write(batch);
   batch = new JournalBatch(35);
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/persist/UpdateCloudReplicaInfo.java:
##########
@@ -54,6 +59,9 @@ public class UpdateCloudReplicaInfo implements Writable {
     @SerializedName(value = "beIds")
     private List<Long> beIds = new ArrayList<Long>();
 
+    @SerializedName(value = "rids", alternate = {"replicaIds"})

Review Comment:
   `alternate` is not needed by new fields.



##########
fe/fe-core/src/main/java/org/apache/doris/journal/JournalBatch.java:
##########
@@ -55,6 +60,7 @@ public void addJournal(short op, Writable data) throws 
IOException {
         entity.setData(data);
 
         DataOutputBuffer buffer = new 
DataOutputBuffer(OUTPUT_BUFFER_INIT_SIZE);
+        size += buffer.size();
         entity.write(buffer);

Review Comment:
   It seems the buffer size is zero, if `entity.write(buffer)` is not executed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to