hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-6885) Fix wrong use of BytesWritable in FSEditLogOp#RenameOp
Date Mon, 23 Nov 2015 04:03:11 GMT

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

Hudson commented on HDFS-6885:
------------------------------

SUCCESS: Integrated in Hadoop-Yarn-trunk #1434 (See [https://builds.apache.org/job/Hadoop-Yarn-trunk/1434/])
HDFS-6885. Fix wrong use of BytesWritable in FSEditLogOp#RenameOp. (wheat9: rev bfbcfe73644db6c047d774c4a461da27915eef84)
* hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java


> Fix wrong use of BytesWritable in FSEditLogOp#RenameOp
> ------------------------------------------------------
>
>                 Key: HDFS-6885
>                 URL: https://issues.apache.org/jira/browse/HDFS-6885
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>            Priority: Minor
>              Labels: BB2015-05-TBR
>             Fix For: 2.8.0
>
>         Attachments: HDFS-6885.001.patch
>
>
> After readField using BytesWritable, the data length should be {{writable.getLength()}},
instead of {{writable.getBytes().length}} which is the buffer length. 
> This will cause returned {{Rename[]}} is longer than expected and may include some incorrect
values (Currently they are Rename#NONE, and have not caused problem but code logic is incorrect).

> {code}
> BytesWritable writable = new BytesWritable();
> writable.readFields(in);
> byte[] bytes = writable.getBytes();
> Rename[] options = new Rename[bytes.length];
> for (int i = 0; i < bytes.length; i++) {
>   options[i] = Rename.valueOf(bytes[i]);
> }
> {code}



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

Mime
View raw message