Skip to content

Commit

Permalink
[HUDI-5487] Reduce duplicate logs in ExternalSpillableMap (#7579)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxzl25 authored and yihua committed Jan 31, 2023
1 parent 138af1a commit bba8098
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ public R get(Object key) {
@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)) {
Expand Down

0 comments on commit bba8098

Please sign in to comment.