This is an automated email from the ASF dual-hosted git repository. yihua pushed a commit to branch release-0.13.0 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit bba809843593829840ffedb751e7a55a70776724 Author: cxzl25 <[email protected]> AuthorDate: Tue Jan 31 13:35:27 2023 +0800 [HUDI-5487] Reduce duplicate logs in ExternalSpillableMap (#7579) --- .../apache/hudi/common/util/collection/ExternalSpillableMap.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java b/hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java index ee930e588d0..b540b204214 100644 --- a/hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java +++ b/hudi-common/src/main/java/org/apache/hudi/common/util/collection/ExternalSpillableMap.java @@ -202,10 +202,13 @@ public class ExternalSpillableMap<T extends Serializable, R extends Serializable @Override public R put(T key, R value) { if (this.currentInMemoryMapSize >= maxInMemorySizeInBytes || inMemoryMap.size() % NUMBER_OF_RECORDS_TO_ESTIMATE_PAYLOAD_SIZE == 0) { - this.estimatedPayloadSize = (long) (this.estimatedPayloadSize * 0.9 - + (keySizeEstimator.sizeEstimate(key) + valueSizeEstimator.sizeEstimate(value)) * 0.1); + long tmpEstimatedPayloadSize = (long) (this.estimatedPayloadSize * 0.9 + + (keySizeEstimator.sizeEstimate(key) + valueSizeEstimator.sizeEstimate(value)) * 0.1); + if (this.estimatedPayloadSize != tmpEstimatedPayloadSize) { + LOG.info("Update Estimated Payload size to => " + this.estimatedPayloadSize); + } + this.estimatedPayloadSize = tmpEstimatedPayloadSize; this.currentInMemoryMapSize = this.inMemoryMap.size() * this.estimatedPayloadSize; - LOG.info("Update Estimated Payload size to => " + this.estimatedPayloadSize); } if (this.currentInMemoryMapSize < maxInMemorySizeInBytes || inMemoryMap.containsKey(key)) {
