[
https://issues.apache.org/jira/browse/HDFS-8081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14484756#comment-14484756
]
Yi Liu commented on HDFS-8081:
------------------------------
Hi Konst, the patch looks good. Few nits:
*1.*
{quote}
// Part I. Analyze the state of the file with respect to the input data.
{quote}
{quote}
// Part II.
// Allocate a new block, add it to the INode and the BlocksMap.
{quote}
Since in the patch we have two methods, could we remove the original comments
since the new methods comment already cover them.
*2.*
{code}
if (targets == null && onRetryBlock[0] != null) {
{code}
For current code logic, if {{targest}} is null, then {{onRetryBlock\[0\] !=
null}} should be true (Since {{chooseTarget4NewBlock}} will never return
null).
Could you remove {{onRetryBlock\[0\] != null}} or just assert it? Otherwise it
has some misunderstanding: even {{targets == null}}, if {{onRetryBlock\[0\]}}
is null, then we still call {{storeAllocatedBlock}}.
> Split getAdditionalBlock() into two methods.
> --------------------------------------------
>
> Key: HDFS-8081
> URL: https://issues.apache.org/jira/browse/HDFS-8081
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 2.7.0
> Reporter: Konstantin Shvachko
> Assignee: Konstantin Shvachko
> Attachments: HDFS-8081-01.patch
>
>
> A minor refactoring to introduce two methods one corresponding to Part I and
> another to Part II to make {{getAdditionalBlock()}} more readable.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)