[
https://issues.apache.org/jira/browse/YARN-11419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678466#comment-17678466
]
ASF GitHub Bot commented on YARN-11419:
---------------------------------------
smallzhongfeng commented on code in PR #5309:
URL: https://github.com/apache/hadoop/pull/5309#discussion_r1080761997
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/SharedCacheClientImpl.java:
##########
@@ -158,14 +158,8 @@ public void release(ApplicationId applicationId, String
resourceKey)
public String getFileChecksum(Path sourceFile)
throws IOException {
FileSystem fs = sourceFile.getFileSystem(this.conf);
- FSDataInputStream in = null;
- try {
- in = fs.open(sourceFile);
+ try (FSDataInputStream in = fs.open(sourceFile)) {
Review Comment:
yes.
> Remove redundant exception capture in NMClientAsyncImpl and improve
> readability in ContainerShellWebSocket, etc
> ----------------------------------------------------------------------------------------------------------------
>
> Key: YARN-11419
> URL: https://issues.apache.org/jira/browse/YARN-11419
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: client
> Reporter: jingxiong zhong
> Priority: Minor
> Labels: pull-request-available
>
> Make the code more readable.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]