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

Mingliang Liu edited comment on HDFS-10965 at 10/11/16 12:43 AM:
-----------------------------------------------------------------

{code}
384           /* init reused vars */
385           List<String> outs = null;
386           int ret;
387     
388           /**
389            * test normal run
390            */
{code}
No reuse found. Make them final.

{code}
400           assertEquals(
401               "three lines per Datanode: the 1st line is rack info, 2nd 
node info,"
402                   + " 3rd empty line.",
403               12, outs.size());
{code}
"There should be three lines per Datanode: the 1st line ...."
12 -> 3 * numDn

{code}
376         /* init cluster using topology */
377         try (MiniDFSCluster miniCluster = new 
MiniDFSCluster.Builder(dfsConf)
378             .numDataNodes(numDn).racks(racks).build()) {
{code}
You created a new MiniDFSCluster in the test using the default cluster 
directory, which conflicts with the pre-setup class variable cluster (e.g. not 
able to find the edits dir etc). The reason is that the MiniDFSCluster will 
format every time we build a new one. Please have a look at [HDFS-10986] for 
more information to use the pre-set {{cluster}}.



was (Author: liuml07):
{code}
384           /* init reused vars */
385           List<String> outs = null;
386           int ret;
387     
388           /**
389            * test normal run
390            */
{code}
No reuse found. Make them final.

{code}
400           assertEquals(
401               "three lines per Datanode: the 1st line is rack info, 2nd 
node info,"
402                   + " 3rd empty line.",
403               12, outs.size());
{code}
"There should be three lines per Datanode: the 1st line ...."
12 -> 3 * numDn

Otherwise +1 pending on Jenkins.


> Add unit test for HDFS command 'dfsadmin -printTopology'
> --------------------------------------------------------
>
>                 Key: HDFS-10965
>                 URL: https://issues.apache.org/jira/browse/HDFS-10965
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: fs, shell, test
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>         Attachments: HDFS-10965.000.patch, HDFS-10965.001.patch, 
> HDFS-10965.002.patch, HDFS-10965.003.patch, HDFS-10965.004.patch
>
>
> DFSAdmin#printTopology should also be tested. This proposes adding it in 
> TestDFSAdmin.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to