hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Templeton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-4994) Use MiniYARNCluster with try-with-resources in tests
Date Tue, 26 Apr 2016 16:46:12 GMT

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

Daniel Templeton commented on YARN-4994:
----------------------------------------

Thanks for the test cleanup, [~boky01]!  Some comments:

# In {{TestHedgingRequestRMFailoverProxyProvider}}, I think it would be better to move the
conf settings out of the try than to move the conf creation into the try.
# In general, the second line of the try statement should be double-indented.  In some cases
it's not indented, and in others it's quadruple-indented.
# In {{TestMiniYarnCluster}}, your {{cluster2}} and {{cluster3}} should just be {{cluster}}.

Otherwise, looks good.


> 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
>            Assignee: Andras Bokor
>            Priority: Trivial
>             Fix For: 2.7.0
>
>         Attachments: HDFS-10287.01.patch
>
>
> 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 since Java7 instead of the pattern above.



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

Mime
View raw message