[
https://issues.apache.org/jira/browse/HDFS-1833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019938#comment-13019938
]
Tsz Wo (Nicholas), SZE commented on HDFS-1833:
----------------------------------------------
Thanks Daryn for the review.
1) {{PipelineAck}} is declared in {{DataTransferProtocol}}. Changing it
requires a protocol change. Let do it later when we are changing
{{DataTransferProtocol}}.
2) The original code is {{numTargets != 0}}. {{numTargets}} could be -1 or
>0. So checking {{type != PacketResponderType.LAST_IN_PIPELINE}} is correct.
3) I think it is necessary. It was introduced earlier for some bug fixes.
4) You are right. I did not study the loop structure. Let do this further
improvement later.
5) The original code is
{code}
short ackLen = numTargets == 0 ? 0 : ack.getNumOfReplies();
{code}
So {{type == PacketResponderType.LAST_IN_PIPELINE}} is correct.
> Refactor BlockReceiver
> ----------------------
>
> Key: HDFS-1833
> URL: https://issues.apache.org/jira/browse/HDFS-1833
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: data-node
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Priority: Minor
> Fix For: 0.23.0
>
> Attachments: h1833_20110412.patch, h1833_20110413.patch
>
>
> There are repeated codes for creating log/error messages in BlockReceiver.
> Also, some comment in the codes are incorrect, e.g.
> {code}
> private int numTargets; // number of downstream datanodes including myself
> {code}
> but the count indeed excludes the current datanode.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira