[
https://issues.apache.org/jira/browse/HDFS-10287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15256304#comment-15256304
]
Andras Bokor commented on HDFS-10287:
-------------------------------------
MiniDFSCluster supports try-with-resoucres right now:
MiniYARNCluster extends CompositeService
CompositeService extends AbstractService
AbstractService implements Service which extends Closeable which extends
AutoCloseable.
So it is not needed to add AutoClosable to MiniDFSCluster.
In addition [YARN-4959|https://issues.apache.org/jira/browse/YARN-4959] is
duplicates with this. I think it can be closed
What do you guys think about these?
> 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
>
> {{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)