GWphua commented on code in PR #18731:
URL: https://github.com/apache/druid/pull/18731#discussion_r2689571803


##########
processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/ByteBufferIntList.java:
##########
@@ -55,6 +55,7 @@ public void add(int val)
     }
     buffer.putInt(numElements * Integer.BYTES, val);
     numElements++;
+    maxMergeBufferUsageBytes = Math.max(maxMergeBufferUsageBytes, numElements 
* Integer.BYTES);

Review Comment:
   I was thinking to get the maximum usage, because we request a 
`getMergeBufferUsage` when `SpillingGrouper#close` is called. I do not really 
know whether we are guaranteed to see the maximum usage when the grouper is 
closing this class...
   
   I am worried about the case where maybe we configure 1GiB to the merge 
buffer, and the usage in the middle goes to, say 900MiB, but when the Grouper 
is closed, the usage shows ~300MiB. The user is then encouraged to lower the 
merge buffer allocation to 500MiB, which will be problematic.
   
   This comment would also hopefully address your query about why `reset` does 
not change `maxMergeBufferUsageBytes`.



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