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

Tsz Wo (Nicholas), SZE commented on HDFS-2371:
----------------------------------------------

The refactoring looks good.  Some comments:

- For the comments above the fields, it is better to use javadoc /** */ since 
the javadoc will show up in eclipse or if the -private option is specified in 
the javadoc tool.

- There are some TODOs.

- The following should use <= (less than or equal)
{code}
      this.transferToAllowed = datanode.transferToAllowed &&
        (!is32Bit || length < Integer.MAX_VALUE);
{code}

- checksum, chunkSize and endOffset can be changed to final (use local 
variables in the constructor)

- getStartOffset(..) is not used.

- Use {{chunkSize*(long)maxChunks}} in the following. 
{code}
+    int dataLen = (int) Math.min(endOffset - offset,
+                             (((long) chunkSize) * ((long) maxChunks)));
{code}
                
> Refactor BlockSender.java for better readability
> ------------------------------------------------
>
>                 Key: HDFS-2371
>                 URL: https://issues.apache.org/jira/browse/HDFS-2371
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: data-node
>            Reporter: Suresh Srinivas
>             Fix For: 0.24.0
>
>         Attachments: HDFS-2371.txt
>
>
> BlockSender.java is hard to read and understand. I propose refactoring it for 
> better readability

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to