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

Konstantin Boudnik commented on HDFS-907:
-----------------------------------------

A couple of comments:
- method updateNNMetrics() sleeps for 1 second. The comment says that it 
happens according to {{dfs.replication.interval}}. Why don't you retrieve the 
actual value of this configuration parameter?
- use some meaningful messages for the asserts
- {{Thread.sleep()}} might throw {{InterruptedException}} which will terminate 
{{ updateNNMetrics()}}. Which in turn will terminate 
{{testGetBlockLocations()}}. Is it intended?
- would suggest to call the test {{testGetBlockLocationsMetric()}}
- all public methods have to have proper JavaDoc with all required tags. In 
this case {...@throws}} is missing

And some nits:
- identification suppose to be equal to 2 white spaces exactly
- I think very last empty line is excessive
- test method declaration doesn't have a white in {{throws Exception{}}
- you have two empty lines modifications in
{noformat}
   }
-  
+
   private MiniDFSCluster cluster;
{noformat}
and
{noformat}
   private FSNamesystem namesystem;
-
+  private NameNodeMetrics nnMetrics;
+  private NameNode nn;
+  
   private static Path getTestPath(String fileName) {
{noformat}


> Add new metrics unit tests. 
> ----------------------------
>
>                 Key: HDFS-907
>                 URL: https://issues.apache.org/jira/browse/HDFS-907
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: name-node
>    Affects Versions: 0.20.2
>         Environment: This jira will add more Unit tests for metrics reported 
> by NameNode  e.g - numGetBlockLocations .
>            Reporter: Ravi Phulari
>            Assignee: Ravi Phulari
>             Fix For: 0.20.2
>
>         Attachments: HDFS-907.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to