[ 
https://issues.apache.org/jira/browse/HADOOP-13742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15617613#comment-15617613
 ] 

Brahma Reddy Battula commented on HADOOP-13742:
-----------------------------------------------

[~kihwal] thanks for taking a look into this issue. thinking like following, 
let me know your opinion.

{code}
void incrUserConnections(String user) {
      AtomicInteger count = userVsConnectionsMap.get(user);
      if (count == null) {
        count = new AtomicInteger(1);
        count = userVsConnectionsMap.putIfAbsent(user, count);
        if (count != null) {
          count.getAndIncrement();
        }
      } else {
        count.getAndIncrement();
      }
    }

 void decrUserConnections(String user) {
      AtomicInteger count = userVsConnectionsMap.get(user);
      if (count == null) {
        return;
      } else {
        if (count.decrementAndGet() == 0) {
          userVsConnectionsMap.remove(user);
        }
      }
    }
{code}

> Expose "NumOpenConnectionsPerUser" as a metric
> ----------------------------------------------
>
>                 Key: HADOOP-13742
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13742
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Brahma Reddy Battula
>            Assignee: Brahma Reddy Battula
>         Attachments: HADOOP-13742-002.patch, HADOOP-13742.patch
>
>
> To track user level connections( How many connections for each user) in busy 
> cluster where so many connections to server.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to