danny0405 commented on code in PR #13232:
URL: https://github.com/apache/hudi/pull/13232#discussion_r2065214867


##########
hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java:
##########
@@ -221,7 +221,7 @@ public R put(T key, R value) {
       // At first, use the sizeEstimate of a record being inserted into the 
spillable map.
       // Note, the converter may over-estimate the size of a record in the JVM
       this.estimatedPayloadSize = keySizeEstimator.sizeEstimate(key) + 
valueSizeEstimator.sizeEstimate(value);
-    } else if (this.inMemoryMap.size() % 
NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) {
+    } else if (this.currentInMemoryMapSize < this.maxInMemorySizeInBytes && 
this.inMemoryMap.size() % NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) {

Review Comment:
   but the in-memory records would still be updated continuously, well I think 
the records with same key sould have very approximate payload size, should be 
fine to just skip the estimation.



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