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

Vinayakumar B commented on HDFS-6702:
-------------------------------------

Patch looks good 

One nit.
{code}
+    final List<StorageTypeProto> protos = new ArrayList<StorageTypeProto>(
+        types.length);
+    for (int i = startIdx; i < types.length; ++i) {
+      protos.add(convertStorageType(types[i]));
+    }
{code}
Here, initialCapacity can be given as {{types.length-startIdx}}, otherwise 
extra allocation will happen for non-zero startIdx.

+1 on addressing this

> DFSClient should create blocks using StorageType 
> -------------------------------------------------
>
>                 Key: HDFS-6702
>                 URL: https://issues.apache.org/jira/browse/HDFS-6702
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode, hdfs-client
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>         Attachments: h6702_20140719.patch, h6702_20140721.patch, 
> h6702_20140721b.patch
>
>
> When DFSClient asks NN for a new block (via addBlock), NN returns a 
> LocatedBlock with storage type information.  However, DFSClient does not use 
> StorageType to create blocks with DN.  As a result, the block replicas could 
> possibly be created with a different storage type.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to