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

Andy Isaacson commented on HDFS-3924:
-------------------------------------

{code}
@@ -234,8 +235,8 @@ class BlockStorageLocationUtil {
         }
         // Get the VolumeId by indexing into the list of VolumeIds
         // provided by the datanode
-        HdfsVolumeId id = new HdfsVolumeId(metaVolumeIds.get(volumeIndex)[0],
-            true);
+        int volumeId = 
ByteBuffer.wrap(metaVolumeIds.get(volumeIndex)).getInt();
+        HdfsVolumeId id = new HdfsVolumeId(volumeId, true);
         // Find out which index we are in the LocatedBlock's replicas
         LocatedBlock locBlock = extBlockToLocBlock.get(extBlock);
         DatanodeInfo[] dnInfos = locBlock.getLocations();
{code}
This change is a wire compatibility change; the old code puts 1 byte in the 
protobuf and the new code requires 4 bytes to decode (else {{.getInt}} throws 
BufferUnderflowException), unless I'm missing something.

Maybe we don't care about wire compatibility, but if so we should explicitly 
state that we don't care.
                
> Multi-byte id in HdfsVolumeId
> -----------------------------
>
>                 Key: HDFS-3924
>                 URL: https://issues.apache.org/jira/browse/HDFS-3924
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs client
>    Affects Versions: 2.0.3-alpha
>            Reporter: Andrew Wang
>            Assignee: Andrew Wang
>         Attachments: hdfs-3924-1.patch
>
>
> Currently, the {{id}} in {{HdfsVolumeId}} is just a single byte. It'd be nice 
> to make this larger, for situations where there's a large number of disks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to