From 3ff44fae3fbf16f0b3675d47af021ca304cc15fd Mon Sep 17 00:00:00 2001 From: SteNicholas Date: Tue, 29 Jul 2025 10:30:31 +0800 Subject: [PATCH] [CELEBORN-894][CELEBORN-474][FOLLOWUP] PushState uses JavaUtils#newConcurrentHashMap to speed up ConcurrentHashMap#computeIfAbsent ### What changes were proposed in this pull request? `PushState` uses `JavaUtils#newConcurrentHashMap` to speed up `ConcurrentHashMap#computeIfAbsent`. ### Why are the changes needed? Celeborn supports JDK8, which could meet the bug mentioned in [JDK-8161372](https://bugs.openjdk.org/browse/JDK-8161372). Therefore, it's better to use `JavaUtils#newConcurrentHashMap` to speed up `ConcurrentHashMap#computeIfAbsent`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? CI. Closes #3396 from SteNicholas/CELEBORN-894. Authored-by: SteNicholas Signed-off-by: SteNicholas --- .../main/java/org/apache/celeborn/common/write/PushState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/org/apache/celeborn/common/write/PushState.java b/common/src/main/java/org/apache/celeborn/common/write/PushState.java index f63906224..46714c4e8 100644 --- a/common/src/main/java/org/apache/celeborn/common/write/PushState.java +++ b/common/src/main/java/org/apache/celeborn/common/write/PushState.java @@ -36,7 +36,7 @@ public class PushState { private final InFlightRequestTracker inFlightRequestTracker; // partition id -> CommitMetadata private final ConcurrentHashMap commitMetadataMap = - new ConcurrentHashMap<>(); + JavaUtils.newConcurrentHashMap(); private final Map failedBatchMap;