hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kai Zheng (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7855) Separate class Packet from DFSOutputStream
Date Mon, 02 Mar 2015 09:39:05 GMT

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

Kai Zheng commented on HDFS-7855:
---------------------------------

Hi [~libo-intel],

Thanks for your update. I looked at the new codes and have following comments. 
1. Would you add some comment for the new standalone class {{DFSPacket}} ? You might also
need to *update/correct* existing comments and *add* comments as well for public/protected
methods.
2. Minor, {{sequencenumber}} better to be {{sequence number}}
3. Ref. the following codes:
{code}
+    boolean correct = true;
+    int totalLen = headerLen + data.length + checksum.length;
+    for(int i = headerLen; i < totalLen; i++) {
+      if(i < headerLen + checksum.length){
+        if(readBuf[i] != checksum[i - headerLen])
+          correct = false;
+      }else{
+        if(readBuf[i] != data[i - headerLen - checksum.length])
+          correct = false;
+      }
+    }
+    Assert.assertEquals(correct, true);
{code}
* The logic is mainly to compare the checksum part and data part are the same with the original
ones, and could use {{Arrays.equal}} to make it simple.
* Please correct the coding format according to the project conventions.
* Please use {{Assert.assertTrue}} instead.

> Separate class Packet from DFSOutputStream
> ------------------------------------------
>
>                 Key: HDFS-7855
>                 URL: https://issues.apache.org/jira/browse/HDFS-7855
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Li Bo
>            Assignee: Li Bo
>         Attachments: HDFS-7855-001.patch, HDFS-7855-002.patch, HDFS-7855-003.patch
>
>
> Class Packet is an inner class in DFSOutputStream and also used by DataStreamer. This
sub task separates Packet out of DFSOutputStream to aid the separation in HDFS-7854.



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

Mime
View raw message