You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Xiaobing Zhou (JIRA)" <ji...@apache.org> on 2016/08/17 23:03:20 UTC
[jira] [Updated] (HADOOP-13511) Simplify connection cache logic
[ 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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org