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

Kai Zheng commented on HDFS-8294:
---------------------------------

It's a good work. A few comments:
1. It doesn't make much sense to me in the following change. Could you clarify 
or refine a little bit? 
{code}
   public void initializeBlockRecovery(long recoveryId) {
     setBlockUCState(BlockUCState.UNDER_RECOVERY);
     blockRecoveryId = recoveryId;
-    if (replicas == null || replicas.length == 0) {
+    if (replicas == null) {
+      NameNode.blockStateChangeLog.warn("BLOCK*" +
+          " BlockInfoStripedUnderConstruction.initLeaseRecovery:" +
+          " No blocks found, lease removed.");
+      return;
+    }
+    if (replicas.length == 0) {
       NameNode.blockStateChangeLog.warn("BLOCK*" +
           " BlockInfoStripedUnderConstruction.initLeaseRecovery:" +
           " No blocks found, lease removed.");
{code}
2. Maybe we could declare cellSize as long in {{offsetInBlkToOffsetInBG}} to 
avoid the cast in it?
3. Looks like more issues than the description listed were addressed. Would you 
update the issue description for better understanding all the changes?

> Erasure Coding: Fix Findbug warnings present in erasure coding
> --------------------------------------------------------------
>
>                 Key: HDFS-8294
>                 URL: https://issues.apache.org/jira/browse/HDFS-8294
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>              Labels: BB2015-05-RFC
>         Attachments: HDFS-8294-HDFS-7285.00.patch, 
> HDFS-8294-HDFS-7285.01.patch, HDFS-8294-HDFS-7285.02.patch, 
> HDFS-8294-HDFS-7285.03.patch
>
>
> Following are the findbug warnings :-
> # Possible null pointer dereference of arr$ in 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStripedUnderConstruction.initializeBlockRecovery(long)
> {code}
> Bug type NP_NULL_ON_SOME_PATH (click for details) 
> In class 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStripedUnderConstruction
> In method 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStripedUnderConstruction.initializeBlockRecovery(long)
> Value loaded from arr$
> Dereferenced at BlockInfoStripedUnderConstruction.java:[line 206]
> Known null at BlockInfoStripedUnderConstruction.java:[line 200]
> {code}
> # Found reliance on default encoding in 
> org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager.createErasureCodingZone(String,
>  ECSchema): String.getBytes()
> Found reliance on default encoding in 
> org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager.getECZoneInfo(INodesInPath):
>  new String(byte[])
> {code}
> Bug type DM_DEFAULT_ENCODING (click for details) 
> In class org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager
> In method 
> org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager.createErasureCodingZone(String,
>  ECSchema)
> Called method String.getBytes()
> At ErasureCodingZoneManager.java:[line 116]
> Bug type DM_DEFAULT_ENCODING (click for details) 
> In class org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager
> In method 
> org.apache.hadoop.hdfs.server.namenode.ErasureCodingZoneManager.getECZoneInfo(INodesInPath)
> Called method new String(byte[])
> At ErasureCodingZoneManager.java:[line 81]
> {code}
> # Inconsistent synchronization of 
> org.apache.hadoop.hdfs.DFSOutputStream.streamer; locked 90% of time
> {code}
> Bug type IS2_INCONSISTENT_SYNC (click for details) 
> In class org.apache.hadoop.hdfs.DFSOutputStream
> Field org.apache.hadoop.hdfs.DFSOutputStream.streamer
> Synchronized 90% of the time
> Unsynchronized access at DFSOutputStream.java:[line 142]
> Unsynchronized access at DFSOutputStream.java:[line 853]
> Unsynchronized access at DFSOutputStream.java:[line 617]
> Unsynchronized access at DFSOutputStream.java:[line 620]
> Unsynchronized access at DFSOutputStream.java:[line 630]
> Unsynchronized access at DFSOutputStream.java:[line 338]
> Unsynchronized access at DFSOutputStream.java:[line 734]
> Unsynchronized access at DFSOutputStream.java:[line 897]
> {code}
> # Dead store to offSuccess in 
> org.apache.hadoop.hdfs.StripedDataStreamer.endBlock()
> {code}
> Bug type DLS_DEAD_LOCAL_STORE (click for details) 
> In class org.apache.hadoop.hdfs.StripedDataStreamer
> In method org.apache.hadoop.hdfs.StripedDataStreamer.endBlock()
> Local variable named offSuccess
> At StripedDataStreamer.java:[line 105]
> {code}
> # Result of integer multiplication cast to long in 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStriped.spaceConsumed()
> {code}
> Bug type ICAST_INTEGER_MULTIPLY_CAST_TO_LONG (click for details) 
> In class org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStriped
> In method 
> org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoStriped.spaceConsumed()
> At BlockInfoStriped.java:[line 208]
> {code}
> # Result of integer multiplication cast to long in 
> org.apache.hadoop.hdfs.util.StripedBlockUtil.constructInternalBlock(LocatedStripedBlock,
>  int, int, int, int)
> {code}
> Bug type ICAST_INTEGER_MULTIPLY_CAST_TO_LONG (click for details) 
> In class org.apache.hadoop.hdfs.util.StripedBlockUtil
> In method 
> org.apache.hadoop.hdfs.util.StripedBlockUtil.constructInternalBlock(LocatedStripedBlock,
>  int, int, int, int)
> At StripedBlockUtil.java:[line 85]
> {code}
> # Switch statement found in 
> org.apache.hadoop.hdfs.DFSStripedInputStream.fetchBlockByteRange(long, long, 
> long, byte[], int, Map) where default case is missing
> {code}
> Bug type SF_SWITCH_NO_DEFAULT (click for details) 
> In class org.apache.hadoop.hdfs.DFSStripedInputStream
> In method 
> org.apache.hadoop.hdfs.DFSStripedInputStream.fetchBlockByteRange(long, long, 
> long, byte[], int, Map)
> At DFSStripedInputStream.java:[lines 468-491]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to