[ 
https://issues.apache.org/jira/browse/YARN-4994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andras Bokor updated YARN-4994:
-------------------------------
    Description: 
In tests MiniYARNCluster is used with the following pattern:
In try-catch block create a MiniYARNCluster instance and in finally block close 
it.
[try-with-resources|https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html]
 is preferred from Java7 instead of the pattern above.

  was:
{{MiniYARNCluster}} 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.


> Use MiniYARNCluster with try-with-resources in tests
> ----------------------------------------------------
>
>                 Key: YARN-4994
>                 URL: https://issues.apache.org/jira/browse/YARN-4994
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: test
>    Affects Versions: 2.7.0
>            Reporter: Andras Bokor
>            Priority: Trivial
>             Fix For: 2.7.0
>
>
> In tests MiniYARNCluster is used with the following pattern:
> In try-catch block create a MiniYARNCluster instance and in finally block 
> close it.
> [try-with-resources|https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html]
>  is preferred from Java7 instead of the pattern above.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to