[
https://issues.apache.org/jira/browse/HDFS-11359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030292#comment-16030292
]
Mingliang Liu commented on HDFS-11359:
--------------------------------------
+1
Minor comments:
# {{printDataNodeReports()}} can either be static, or use {{getFs()}} to get
the FS object to avoid dfs parameter.
# The initial {{putNodeToService()}} seems unnecessary as the node status
should be normal I think.
{code}
1154 for (DataNode dn : getCluster().getDataNodes()) {
1155 hosts.add(dn.getDisplayName());
1156 putNodeInService(0, dn.getDatanodeUuid());
1157 }
{code}
Can we change this part to {{ToolRunner.run(dfsAdmin, new String[] \{"-report",
"-inmaintenance", "-enteringmaintenance"});}} and assert out does not contain
either of the two DNs?
# {{List<String> hosts = new ArrayList<>();}} in test, this is never used?
# simpler assert statements:
{code}
assertThat(out.toString(),
is(allOf(containsString("Entering maintenance datanodes (1):"),
containsString(nodes[0].getXferAddr()))));
assertTrue(!out.toString().contains(nodes[1].getXferAddr()));
{code}
to
{code}
assertThat(out.toString(), is(allOf(
containsString("Entering maintenance datanodes (1):"),
containsString(nodes[0].getXferAddr()),
not(containsString(nodes[1].getXferAddr())))));
{code}
The other place is similar.
# To clear the old out/err,
{code}
// reset stream
out = new ByteArrayOutputStream();
err = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
System.setErr(new PrintStream(err));
{code}
to
{code}
// reset stream
out.reset();
err.reset();
{code}
> DFSAdmin report command supports displaying maintenance state datanodes
> -----------------------------------------------------------------------
>
> Key: HDFS-11359
> URL: https://issues.apache.org/jira/browse/HDFS-11359
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: datanode, namenode
> Affects Versions: 3.0.0-alpha1
> Reporter: Yiqun Lin
> Assignee: Yiqun Lin
> Priority: Minor
> Attachments: HDFS-11359.001.patch, HDFS-11359.002.patch,
> HDFS-11359.003.patch, HDFS-11359.004.patch
>
>
> The datanode's maintenance state info can be showed in webUI/JMX. But it
> can't be displayed via CLI. This JIRA will improve on this.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]