[
https://issues.apache.org/jira/browse/HADOOP-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaobing Zhou updated HADOOP-13511:
-----------------------------------
Description:
In Client#getConnection, the logic of RPC connection cache can be simplified
using ConcurrentMap#ConcurrentHashMap.
{code}
connection = connections.get(remoteId);
if (connection == null) {
connection = new Connection(remoteId, serviceClass);
Connection existing = connections.putIfAbsent(remoteId, connection);
if (existing != null) {
connection = existing;
}
}
{code}
> Simplify connection cache logic
> -------------------------------
>
> Key: HADOOP-13511
> URL: https://issues.apache.org/jira/browse/HADOOP-13511
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Xiaobing Zhou
> Assignee: Xiaobing Zhou
>
> In Client#getConnection, the logic of RPC connection cache can be simplified
> using ConcurrentMap#ConcurrentHashMap.
> {code}
> connection = connections.get(remoteId);
> if (connection == null) {
> connection = new Connection(remoteId, serviceClass);
> Connection existing = connections.putIfAbsent(remoteId, connection);
> if (existing != null) {
> connection = existing;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]