You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/06/15 09:59:22 UTC
[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1567: [CELEBORN-478] Replace putIfAbsent with computeIfAbsent in ConcurrentHashMap
pan3793 commented on code in PR #1567:
URL: https://github.com/apache/incubator-celeborn/pull/1567#discussion_r1230763859
##########
common/src/main/scala/org/apache/celeborn/common/meta/WorkerPartitionLocationInfo.scala:
##########
@@ -88,12 +88,12 @@ class WorkerPartitionLocationInfo extends Logging {
locations: util.List[PartitionLocation],
partitionInfo: PartitionInfo): Unit = {
if (locations != null && locations.size() > 0) {
- partitionInfo.putIfAbsent(
+ partitionInfo.computeIfAbsent(
shuffleKey,
- JavaUtils.newConcurrentHashMap[String, PartitionLocation]())
+ (k: String) => { return JavaUtils.newConcurrentHashMap[String, PartitionLocation]() })
Review Comment:
Is this allowed by Java syntax?
```suggestion
(k: String) => JavaUtils.newConcurrentHashMap[String, PartitionLocation]())
```
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org