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

Lisheng Sun edited comment on HDFS-15264 at 5/3/20, 3:04 AM:
-------------------------------------------------------------

The findbugs should be not related to this patch.
[~ayushtkn] Could you help confirm fingbugs warnings that is related to this 
patch?
{code:java}
Code    Warning
WMI     org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.equals(Object) 
makes inefficient use of keySet iterator instead of entrySet iterator
Bug type WMI_WRONG_MAP_ITERATOR (click for details)
In class org.apache.hadoop.hdfs.server.protocol.SlowDiskReports
In method org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.equals(Object)
Field org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.slowDisks
At SlowDiskReports.java:[line 105]

Bad practice Warnings
Code    Warning
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setClusterId(String)
 unconditionally sets the field clusterId
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setForce(int)
 unconditionally sets the field force
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setForceFormat(boolean)
 unconditionally sets the field isForceFormat
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setInteractiveFormat(boolean)
 unconditionally sets the field isInteractiveFormat
Dodgy code Warnings
Code    Warning
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.qjournal.server.JournalNode.getJournalsStatus() due to 
return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.datanode.DataStorage.linkBlocksHelper(File, File, 
int, HardLink, boolean, File, List) due to return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.namenode.NNStorageRetentionManager.purgeOldLegacyOIVImages(String,
 long) due to return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1.visitFile(Path, 
BasicFileAttributes) due to return value of called method
UC      Useless condition: it's known that argv.length >= 1 at this point
UC      Useless condition: it's known that numBlocks == -1 at this point
{code}

1. Backport the patch to branch-3.1 as same to the tranch, that is not 
unchanged.

2.There are a few small changes when backport the patch to branch-2.10.
a.
{code:java}
 /**
   * Add datanode to suspectNodes and suspectAndDeadNodes.
   */
  public synchronized void addNodeToDetect(DFSInputStream dfsInputStream,
...      
{color:red}suspectAndDeadNodes.put(dfsInputStream, datanodeInfos);{color}
 ...
  }
{code}
  Map#putIfAbsent in DeadNodeDetector#addNodeToDetectis changed to Map#put. 
Since Map#putIfAbsent is supported from jdk 1.8, branch-2.10 is complied in 
jdk7.
b. It chages Lamda to normal method in 
TestDeadNodeDetection#startWaitForDeadNodeThread.




was (Author: leosun08):
The findbugs should be not related to this patch.
[~ayushtkn] Could you help confirm fingbugs warnings that is related to this 
patch?
{code:java}
Code    Warning
WMI     org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.equals(Object) 
makes inefficient use of keySet iterator instead of entrySet iterator
Bug type WMI_WRONG_MAP_ITERATOR (click for details)
In class org.apache.hadoop.hdfs.server.protocol.SlowDiskReports
In method org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.equals(Object)
Field org.apache.hadoop.hdfs.server.protocol.SlowDiskReports.slowDisks
At SlowDiskReports.java:[line 105]

Bad practice Warnings
Code    Warning
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setClusterId(String)
 unconditionally sets the field clusterId
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setForce(int)
 unconditionally sets the field force
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setForceFormat(boolean)
 unconditionally sets the field isForceFormat
ME      
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setInteractiveFormat(boolean)
 unconditionally sets the field isInteractiveFormat
Dodgy code Warnings
Code    Warning
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.qjournal.server.JournalNode.getJournalsStatus() due to 
return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.datanode.DataStorage.linkBlocksHelper(File, File, 
int, HardLink, boolean, File, List) due to return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.namenode.NNStorageRetentionManager.purgeOldLegacyOIVImages(String,
 long) due to return value of called method
NP      Possible null pointer dereference in 
org.apache.hadoop.hdfs.server.namenode.NNUpgradeUtil$1.visitFile(Path, 
BasicFileAttributes) due to return value of called method
UC      Useless condition: it's known that argv.length >= 1 at this point
UC      Useless condition: it's known that numBlocks == -1 at this point
{code}

1. Backport the patch to branch-3.1 as same to the tranch, that is not 
unchanged.
2.There are a few small changes when backport the patch to branch-2.10.
a.
{code:java}
 /**
   * Add datanode to suspectNodes and suspectAndDeadNodes.
   */
  public synchronized void addNodeToDetect(DFSInputStream dfsInputStream,
...      
{color:red}suspectAndDeadNodes.put(dfsInputStream, datanodeInfos);{color}
 ...
  }
{code}
  Map#putIfAbsent in DeadNodeDetector#addNodeToDetectis changed to Map#put. 
Since Map#putIfAbsent is supported from jdk 1.8, branch-2.10 is complied in 
jdk7.
b. It chages Lamda to normal method in 
TestDeadNodeDetection#startWaitForDeadNodeThread.



> Backport HDFS-13571,HDFS-15149 to branch-3.1, branch-2.10
> ---------------------------------------------------------
>
>                 Key: HDFS-15264
>                 URL: https://issues.apache.org/jira/browse/HDFS-15264
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Major
>         Attachments: HDFS-15264-branch-2.10.001.patch, 
> HDFS-15264-branch-2.10.002.patch, HDFS-15264-branch-2.10.003.patch, 
> HDFS-15264-branch-2.10.004.patch, HDFS-15264-branch-2.10.005.patch, 
> HDFS-15264-branch-3.1.001.patch, HDFS-15264-branch-3.1.002.patch, 
> HDFS-15264-branch-3.1.003.patch, HDFS-15264-branch-3.1.004.patch, 
> HDFS-15264.001.patch
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to