Caideyipi commented on code in PR #18049:
URL: https://github.com/apache/iotdb/pull/18049#discussion_r3503002601


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java:
##########
@@ -850,17 +990,17 @@ private void calculateInsertNodeQueueMemory(final 
PipeParameters sourceParameter
       return;
     }
 
+    final long needFloatingMemory =
+        PipeConfig.getInstance().getPipeInsertNodeQueueMemory() * 
dataRegionTaskCount;
     final long allocatedMemorySizeInBytes = 
this.getAllFloatingMemoryUsageInByte();
     final long remainingMemory =
         
PipeDataNodeResourceManager.memory().getTotalFloatingMemorySizeInBytes()
             - allocatedMemorySizeInBytes;
-    if (remainingMemory < 
PipeConfig.getInstance().getPipeInsertNodeQueueMemory()) {
+    if (remainingMemory < needFloatingMemory) {
       final String message =
           String.format(
               "%s Need Floating memory: %d  bytes, free Floating memory: %d 
bytes",
-              PipeMessages.NOT_ENOUGH_MEMORY_FOR_PIPE,
-              PipeConfig.getInstance().getPipeInsertNodeQueueMemory(),
-              remainingMemory);
+              PipeMessages.NOT_ENOUGH_MEMORY_FOR_PIPE, needFloatingMemory, 
remainingMemory);

Review Comment:
   Done. I moved the memory check details into `PipeMessages` with both English 
and Chinese i18n entries, and updated the code to use those message constants.



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