[
https://issues.apache.org/jira/browse/HDFS-11083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15645938#comment-15645938
]
Mingliang Liu edited comment on HDFS-11083 at 11/8/16 12:26 AM:
----------------------------------------------------------------
The patch looks good to me overall. Thanks,
# Is {{cluster.setDataNodeDead}} helpful here?
{code}
467 /* wait until DN report is updated */
468 GenericTestUtils.waitFor(new Supplier<Boolean>() {
469 @Override
470 public Boolean get() {
471 DatanodeInfo[] nodeInfo = null;
472 try {
473 nodeInfo = client.datanodeReport(DatanodeReportType.DEAD);
474 } catch (IOException e) {
475 return false;
476 }
477 return nodeInfo != null && nodeInfo.length == 1;
478 }
479 }, 100, 60000);
{code}
# I prefer not not to change the existing order the imports as this may cause
backporting conflict which is traumatic for tools.
{code}
25 import static org.hamcrest.CoreMatchers.allOf;
26 import static org.hamcrest.CoreMatchers.anyOf;
27 import static org.hamcrest.CoreMatchers.containsString;
28 import static org.hamcrest.CoreMatchers.is;
29 import static org.hamcrest.CoreMatchers.not;
30 import static org.junit.Assert.assertEquals;
31 import static org.junit.Assert.assertThat;
32 import static org.junit.Assert.assertTrue;
33 import static org.mockito.Matchers.any;
34 import static org.mockito.Mockito.mock;
35 import static org.mockito.Mockito.when;
{code}
# Are you saying {{"Fail to corrupt all replicas for block " + block}} as
assertion message?
{code}
496 assertEquals("No all replicas corrupted", repl_factor,
497 blockFilesCorrupted);
{code}
# Better {{ fs.setReplication(file, fs.setReplication(file, (short)2); + 1);}}
{code}
499 /*
500 * Increase replication factor, this should invoke transfer
request.
501 * Receiving datanode fails on checksum and reports it to namenode
502 */
503 fs.setReplication(file, (short)2);
{code}
# printout() is used ever
was (Author: liuml07):
The patch looks good to me overall. Thanks,
# Is {{cluster.setDataNodeDead}} helpful here?
{code}
467 /* wait until DN report is updated */
468 GenericTestUtils.waitFor(new Supplier<Boolean>() {
469 @Override
470 public Boolean get() {
471 DatanodeInfo[] nodeInfo = null;
472 try {
473 nodeInfo = client.datanodeReport(DatanodeReportType.DEAD);
474 } catch (IOException e) {
475 return false;
476 }
477 return nodeInfo != null && nodeInfo.length == 1;
478 }
479 }, 100, 60000);
{code}
# I prefer not not to change the existing order the imports as this may cause
backporting conflict which is traumatic for tools.
{code}
25 import static org.hamcrest.CoreMatchers.allOf;
26 import static org.hamcrest.CoreMatchers.anyOf;
27 import static org.hamcrest.CoreMatchers.containsString;
28 import static org.hamcrest.CoreMatchers.is;
29 import static org.hamcrest.CoreMatchers.not;
30 import static org.junit.Assert.assertEquals;
31 import static org.junit.Assert.assertThat;
32 import static org.junit.Assert.assertTrue;
33 import static org.mockito.Matchers.any;
34 import static org.mockito.Mockito.mock;
35 import static org.mockito.Mockito.when;
{code}
# Are you saying {{"Fail to corrupt all replicas for block" + block}} as
assertion message?
{code}
496 assertEquals("No all replicas corrupted", repl_factor,
497 blockFilesCorrupted);
{code}
# Better {{ fs.setReplication(file, fs.setReplication(file, (short)2); + 1);}}
{code}
499 /*
500 * Increase replication factor, this should invoke transfer
request.
501 * Receiving datanode fails on checksum and reports it to namenode
502 */
503 fs.setReplication(file, (short)2);
{code}
# printout() is used ever
> Add unit test for DFSAdmin -report command
> ------------------------------------------
>
> Key: HDFS-11083
> URL: https://issues.apache.org/jira/browse/HDFS-11083
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: shell, test
> Reporter: Mingliang Liu
> Assignee: Xiaobing Zhou
> Attachments: HDFS-11083.000.patch, HDFS-11083.001.patch,
> HDFS-11083.002.patch
>
>
> {{hdfs dfsadmin -report}} has very useful information about the cluster.
> There are some existing customized tools that depend on this command
> functionality. We should add unit test for it. Specially,
> # If one datanode is dead, the report should indicate this
> # If one block is corrupt, the "Missing blocks:" field should report this
> # TBD...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]