[
https://issues.apache.org/jira/browse/YARN-2775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14526366#comment-14526366
]
Tsuyoshi Ozawa commented on YARN-2775:
--------------------------------------
[~skrho], thank you for taking this issue. I agree with that we need to close
files after creating FileInputStream. How about using try-with-resources
statement since now we only supports JDK 7 or later?
http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html
{code}
try (final FileInputStream fis = ContainerLogsUtils.openLogFileForRead(
containerIdStr, logFile, nmContext)) {
} catch () {
}
{code}
> There is no close method in NMWebServices#getLogs()
> ---------------------------------------------------
>
> Key: YARN-2775
> URL: https://issues.apache.org/jira/browse/YARN-2775
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: nodemanager
> Reporter: skrho
> Priority: Minor
> Attachments: YARN-2775_001.patch
>
>
> If getLogs method is called, fileInputStream object is accumulated in
> memory..
> Because fileinputStream object is not closed..
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)