zuston commented on code in PR #424:
URL: https://github.com/apache/incubator-uniffle/pull/424#discussion_r1051399753
##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -171,11 +171,18 @@ public Storage selectStorage(ShuffleDataFlushEvent event)
{
partitionId
)
);
- event.setUnderStorage(storage);
// store it to cache.
- partitionsOfStorage.put(UnionKey.toKey(appId, shuffleId, partitionId),
storage);
- return storage;
+ final LocalStorage selectedStorage = storage;
+ return partitionsOfStorage.compute(
Review Comment:
Use the concurrent hashmap compute method to ensure the thread safe
cc @advancedxy , please help check this part.
--
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]