HDFS-6885. Fix wrong use of BytesWritable in FSEditLogOp#RenameOp. Contributed by Yi Liu.

This commit is contained in:
Haohui Mai 2015-11-22 17:16:51 -08:00
parent 5f688453df
commit bfbcfe7364
2 changed files with 6 additions and 2 deletions

View File

@ -2342,6 +2342,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8914. Document HA support in the HDFS HdfsDesign.md. HDFS-8914. Document HA support in the HDFS HdfsDesign.md.
(Lars Francke via wheat9) (Lars Francke via wheat9)
HDFS-6885. Fix wrong use of BytesWritable in FSEditLogOp#RenameOp.
(Yi Liu via wheat9)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -2705,9 +2705,10 @@ private static Rename[] readRenameOptions(DataInputStream in) throws IOException
writable.readFields(in); writable.readFields(in);
byte[] bytes = writable.getBytes(); byte[] bytes = writable.getBytes();
Rename[] options = new Rename[bytes.length]; int len = writable.getLength();
Rename[] options = new Rename[len];
for (int i = 0; i < bytes.length; i++) { for (int i = 0; i < len; i++) {
options[i] = Rename.valueOf(bytes[i]); options[i] = Rename.valueOf(bytes[i]);
} }
return options; return options;