You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Xuan Gong (JIRA)" <ji...@apache.org> on 2016/06/05 04:27:59 UTC

[jira] [Commented] (YARN-5199) Close LogReader in in AHSWebServices#getStreamingOutput and FileInputStream in NMWebServices#getLogs

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

Xuan Gong commented on YARN-5199:
---------------------------------

In AHSWebServices#getStreamingOutput, simple added a try-finally block to close the LogReader.
In NMWebServices#getLogs, I am using "The try-with-resources Statement" to close final FileInputStream object.

Here is the oracle doc for this:

https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

"The try-with-resources Statement" is available for Java 7 and later version, and I think that branch-2.9 definitely needs the user to upgrade their java version to Java7. 

> Close LogReader in in AHSWebServices#getStreamingOutput and FileInputStream in NMWebServices#getLogs
> ----------------------------------------------------------------------------------------------------
>
>                 Key: YARN-5199
>                 URL: https://issues.apache.org/jira/browse/YARN-5199
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Xuan Gong
>            Assignee: Xuan Gong
>         Attachments: YARN-5199.1.patch
>
>




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

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org