From 74b41bb39d9a9bebb3c77fbd07c4c180bcdd5227 Mon Sep 17 00:00:00 2001 From: SteNicholas Date: Thu, 8 May 2025 19:45:11 +0800 Subject: [PATCH] [CELEBORN-1319][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 #3247 from SteNicholas/CELEBORN-1319. Authored-by: SteNicholas Signed-off-by: mingji --- .../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 9f691094b..3977e5d54 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 @@ -41,7 +41,7 @@ public class PushState { public PushState(CelebornConf conf) { pushBufferMaxSize = conf.clientPushBufferMaxSize(); inFlightRequestTracker = new InFlightRequestTracker(conf, this); - failedBatchMap = new ConcurrentHashMap<>(); + failedBatchMap = JavaUtils.newConcurrentHashMap(); } public void cleanup() {