[
https://issues.apache.org/jira/browse/HDFS-5464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14062867#comment-14062867
]
Colin Patrick McCabe commented on HDFS-5464:
--------------------------------------------
To be honest, I don't think this change makes the code any clearer. Setting
block lengths to negative, and then flipping them back later, is a hack that
needs to be explained by comments. It's not obvious to me that this hack is
any better than the hack of adding a sentinel element to the list. In fact, I
would argue the sentinel element is somewhat clearer, since you're not
overloading the meaning of what "block length" means to mean "block length and
also whether I checked this recently."
> Simplify block report diff calculation
> --------------------------------------
>
> Key: HDFS-5464
> URL: https://issues.apache.org/jira/browse/HDFS-5464
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Reporter: Tsz Wo Nicholas Sze
> Assignee: Tsz Wo Nicholas Sze
> Priority: Minor
> Attachments: h5464_20131105.patch, h5464_20131105b.patch,
> h5464_20131105c.patch, h5464_20140715.patch, h5464_20140715b.patch
>
>
> The current calculation in BlockManager.reportDiff(..) is unnecessarily
> complicated. We could simplify the calculation.
--
This message was sent by Atlassian JIRA
(v6.2#6252)