vinothchandar commented on a change in pull request #3955:
URL: https://github.com/apache/hudi/pull/3955#discussion_r746288477
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java
##########
@@ -204,19 +205,21 @@ public R get(Object key) {
public R put(T key, R value) {
if (this.currentInMemoryMapSize < maxInMemorySizeInBytes ||
inMemoryMap.containsKey(key)) {
if (shouldEstimatePayloadSize && estimatedPayloadSize == 0) {
- // 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
+ // At first, use the size estimate of a record being inserted into the
Spillable map.
+ // Note, the converter may overestimate the size of a record in the
JVM.
this.estimatedPayloadSize = keySizeEstimator.sizeEstimate(key) +
valueSizeEstimator.sizeEstimate(value);
- LOG.info("Estimated Payload size => " + estimatedPayloadSize);
- } else if (shouldEstimatePayloadSize && inMemoryMap.size() %
NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) {
+ LOG.debug("Estimated Payload size => " + estimatedPayloadSize);
+ } else if (shouldEstimatePayloadSize
+ && !inMemoryMap.isEmpty()
+ && (inMemoryMap.size() % NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE
== 0)) {
Review comment:
So the exceptionis from this line? doing `0 % 100`? is n't that ok?
```
scala> 0 % 100
res0: Int = 0
```
What am I missing (pretty brain fried, so possible I am missing sth obv)
--
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]