Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.8.0, 3.0.0-alpha1
-
Component/s: namenode
-
Labels:
-
Target Version/s:
-
Hadoop Flags:Reviewed
Description
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).
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]); }