[
https://issues.apache.org/jira/browse/HDFS-11085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15634134#comment-15634134
]
Mingliang Liu commented on HDFS-11085:
--------------------------------------
The patch looks good to me overall.
Some minor comments:
# Checkstyle warning is related.
# MiniDFSCluster can be used in try-catch. Shorter and neater.
# I think we can use {{Paths.get()}} for joining path strings. Assuming file
path separate is / is not platform independent probably. Also if there are
methods in JDK or Apache component that work just fine, I hesitate to use third
party libraries.
{code}
661 final String nnDirStr = Joiner.on("/").join(
662 hdfsDir.toString(),
663 GenericTestUtils.getMethodName(), "name");
{code}
# I don't think we need the implementation details about the Collection type
(List). We just need the only element in the collections, don't we?
{code}
673 /* get and verify NN dir */
674 List<URI> nameDirs = (List<URI>)
FSNamesystem.getNamespaceDirs(config);
{code}
Alternatively:
{code}
Collection<URI> nameDirs = FSNamesystem.getNamespaceDirs(config);
assertNotNull(nameDirs);
assertTrue(nameDirs.iterator().hasNext());
final URI nameDir = nameDirs.iterator().next();
...
{code}
> Add unit tests for NameNode failing to startup when name dir can not be
> written
> -------------------------------------------------------------------------------
>
> Key: HDFS-11085
> URL: https://issues.apache.org/jira/browse/HDFS-11085
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode, test
> Reporter: Mingliang Liu
> Assignee: Xiaobing Zhou
> Attachments: HDFS-11085.000.patch
>
>
> This can be placed in {{org.apache.hadoop.hdfs.server.namenode.TestStartup}}
> test class.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]