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

Ayush Saxena commented on HDFS-15094:
-------------------------------------

Updated patch, to store ugi.toString() and reuse rather than recalculating for 
hash and equals methods.
Did profiling for this, getConnection() prior used to take 1497 was reduced to 
927.

A different approach thought was to use ugi.hashcode() for hash and 
ugi.equals() in the equals methods, that in non secured environment reduced the 
time to ~750, but in case of secured environment, the Subject of ugi is changed 
at the router to set the user name, So in case of secured environment, each 
call would create a new connection, as equals method of ugi, compares Subject, 
which wont be same. So didn't use this approach. And limited to just storing 
the ugi.toString(). 

> RBF : Reuse ugi string in ConnectionPoolID
> ------------------------------------------
>
>                 Key: HDFS-15094
>                 URL: https://issues.apache.org/jira/browse/HDFS-15094
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>         Attachments: HDFS-15094-01.patch
>
>
> The connectionPoolID Hash Code and equals contains ugi.toString(), These 
> methods are used as part of getConnection() in ConnectionManager as part of 
> every call.
> The ugi.toString() eats up considerable amount of time, the Hash Calculation 
> itself is ~10 percent of the total time of the call. And even more for the 
> equals method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to