summaryzb commented on code in PR #2442:
URL: https://github.com/apache/uniffle/pull/2442#discussion_r2045957126
##########
internal-client/src/main/java/org/apache/uniffle/client/factory/ShuffleServerClientFactory.java:
##########
@@ -59,20 +59,18 @@ private ShuffleServerClient createShuffleServerClient(
}
}
- public synchronized ShuffleServerClient getShuffleServerClient(
+ public ShuffleServerClient getShuffleServerClient(
String clientType, ShuffleServerInfo shuffleServerInfo) {
return getShuffleServerClient(clientType, shuffleServerInfo, new
RssConf());
}
- public synchronized ShuffleServerClient getShuffleServerClient(
+ public ShuffleServerClient getShuffleServerClient(
String clientType, ShuffleServerInfo shuffleServerInfo, RssConf rssConf)
{
- clients.putIfAbsent(clientType, JavaUtils.newConcurrentMap());
- Map<ShuffleServerInfo, ShuffleServerClient> serverToClients =
clients.get(clientType);
- if (serverToClients.get(shuffleServerInfo) == null) {
- serverToClients.put(
- shuffleServerInfo, createShuffleServerClient(clientType,
shuffleServerInfo, rssConf));
- }
- return serverToClients.get(shuffleServerInfo);
+ Map<ShuffleServerInfo, ShuffleServerClient> serverToClients =
+ clients.computeIfAbsent(clientType, key ->
JavaUtils.newConcurrentMap());
+ return serverToClients.computeIfAbsent(
Review Comment:
There is no chance to happen, the lock mechanism is guaranteed by
`CaffeineCache` or `GuavaCache`
--
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]