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

John Zhuge commented on HDFS-10287:
-----------------------------------

+1 LGTM. Thanks [~boky01] for submitting the patch.

Initially I expected {{MiniDFSCluster}} to extend {{AbstractService}} just like 
{{MiniYARNCluster}}, but now I am ok with your patch. Just keep it simple until 
a real use case calls for it.

I think unit test {{testDualClusters}} is redundant because 
{{testClusterWithoutSystemProperties}} already proves 
{{cluster.getDataDirectory() == getProp(HDFS_MINIDFS_BASEDIR) + "/data"}}. This 
unit test sets {{HDFS_MINIDFS_BASEDIR}} to 2 different values and brings up 2 
clusters, of course they will have different data directory.

> MiniDFSCluster should implement AutoCloseable
> ---------------------------------------------
>
>                 Key: HDFS-10287
>                 URL: https://issues.apache.org/jira/browse/HDFS-10287
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>    Affects Versions: 2.7.0
>            Reporter: John Zhuge
>            Assignee: John Zhuge
>            Priority: Trivial
>         Attachments: HDFS-10287.01.patch
>
>
> {{MiniDFSCluster}} should implement {{AutoCloseable}} in order to support 
> [try-with-resources|https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html].
>  It will make test code a little cleaner and more reliable.
> Since {{AutoCloseable}} is only in Java 1.7 or later, this can not be 
> backported to Hadoop version prior to 2.7.



--
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