yl09099 commented on code in PR #1845:
URL:
https://github.com/apache/incubator-uniffle/pull/1845#discussion_r1862987139
##########
client-spark/common/src/main/java/org/apache/uniffle/shuffle/BlockIdManager.java:
##########
@@ -40,18 +40,22 @@ public BlockIdManager() {
}
public void add(int shuffleId, int partitionId, List<Long> ids) {
+
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map<Integer, Roaring64NavigableMap> partitionedBlockIds =
- blockIds.computeIfAbsent(shuffleId, (k) ->
JavaUtils.newConcurrentMap());
- partitionedBlockIds.compute(
- partitionId,
- (id, bitmap) -> {
- Roaring64NavigableMap store = bitmap == null ?
Roaring64NavigableMap.bitmapOf() : bitmap;
- ids.stream().forEach(x -> store.add(x));
- return store;
- });
+ blockIds.computeIfAbsent(shuffleId, k -> JavaUtils.newConcurrentMap());
+ synchronized (partitionedBlockIds) {
Review Comment:
> Why needing this synchronized, from my sight, the concurrenthashmap will
ensure thread safe.
Have been modified.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]