THUMarkLau commented on code in PR #12476:
URL: https://github.com/apache/iotdb/pull/12476#discussion_r1630731281


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/checkpoint/CheckpointManager.java:
##########
@@ -345,12 +344,13 @@ public long getFirstValidWALVersionId() {
   }
 
   /** Update wal disk cost of active memTables. */
-  public void updateCostOfActiveMemTables(Map<Long, Long> 
memTableId2WalDiskUsage) {
+  public void updateCostOfActiveMemTables(
+      Map<Long, Long> memTableId2WalDiskUsage, double compressionRate) {
     for (Map.Entry<Long, Long> memTableWalUsage : 
memTableId2WalDiskUsage.entrySet()) {
       memTableId2Info.computeIfPresent(
           memTableWalUsage.getKey(),
           (k, v) -> {
-            v.addWalDiskUsage(memTableWalUsage.getValue());
+            v.addWalDiskUsage((long) (memTableWalUsage.getValue() * 
compressionRate));

Review Comment:
   First, in this scene, we **do not** need a very specific value to control 
it. Both methods will work, but this way is simple(in case of editting code).
   Second, it's difficult to calculate the extractly I/O size of each memtable, 
because the every WALBuffer may contain WAL Entry from multiple memtables. 
After compression, we could not get the extractly size of each memtable 
occupied.



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

Reply via email to