[
https://issues.apache.org/jira/browse/YARN-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14244628#comment-14244628
]
Zhijie Shen commented on YARN-2937:
-----------------------------------
1. What's the problem around Random?
{code}
- Random r = new Random();
- long randomPosition = Math.abs(r.nextLong()) % totalAvailable;
+ long randomPosition = Math.abs(RandomUtils.nextLong()) % totalAvailable;
{code}
2. Can we use IOUtils?
{code}
- // Close the streams
- try {
- in.close();
- } catch (IOException e2) {
- LOG.warn("Error closing the stream: " + getMtabFileName(), e2);
+ if(in != null) {
+ // Close the streams
+ try {
+ in.close();
+ } catch (IOException e2) {
+ LOG.warn("Error closing the stream: " + getMtabFileName(), e2);
+ }
{code}
3. Is this removed because bufReader will consequently close fileReader too?
{code}
- if (fileReader != null) {
- fileReader.close();
- }
{code}
4. Again, would you mind explaining a bit about what have been excluded in
findbugs-exclude.xml? Thanks!
> Fix new findbugs warnings in hadoop-yarn-nodemanager
> ----------------------------------------------------
>
> Key: YARN-2937
> URL: https://issues.apache.org/jira/browse/YARN-2937
> Project: Hadoop YARN
> Issue Type: Improvement
> Reporter: Varun Saxena
> Assignee: Varun Saxena
> Fix For: 2.7.0
>
> Attachments: HADOOP-11373.patch, YARN-2937.001.patch,
> YARN-2937.002.patch, YARN-2937.003.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)