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

Suresh Srinivas commented on HDFS-1865:
---------------------------------------

Comments:
# DFSClient.java
#* DFSClient#filesBeingWritten - worth adding a comment that a file can be 
opened for write by a DFSClient only once.
# LeaseRenewer.java
#* In the class document, it is good to describe lease mechanism briefly. This 
would help people understand the code better. Adding additional comments on how 
LeaseRenewer works would also be good. Adding information about synchronization 
will also help understand the code better.
#* Please throw HadoopIllegalArgumentException instead of NullPointerException.
#* Please do not access DFSClient#filesBeingWritten in this class. Add methods 
to DFSClient to do this.
#* Factory#remove - please avoid adding synchronized on renewer. Instead call a 
method on renewer, that is synchronized.
#* Minor: Simplify the code in in LeaseRenewer#get(). If map returns empty then 
add it to map and return it. You do not not need if else. You can do it with 
just if and can get rid of "r".
#* Copy on array list for DFSClients as an alternative to making a copy every 
time in renew()?
#* Why do you check {if (r == stored) } in Factory#remove()?
#* Why did we choose to use volatile for sleepPeriod and synchronized for 
gracePeriod and other periods?



> Share LeaseChecker thread among DFSClients
> ------------------------------------------
>
>                 Key: HDFS-1865
>                 URL: https://issues.apache.org/jira/browse/HDFS-1865
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs client
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1865_20110503.patch, h1865_20110504.patch
>
>
> Each {{DFSClient}} runs a {{LeaseChecker}} thread within a JVM.  The number 
> threads could be reduced by sharing the threads.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to