[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to