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

Arpit Agarwal commented on HDFS-11530:
--------------------------------------

Thanks for updating the patch [~linyiqun]. A few more comments:
# BlockPlacementPolicyDefault#chooseRandom, the continuation in the {{for}} 
loop at line 719 looks unnecessary. If we fail to place a block for the first 
storage type then the function is guaranteed to fail later, correct?
# DatanodeManager.java: DFSNetworkTopology.getInstance - can this method be 
simplified? We shouldn't use different initialization paths with reflection. 
Why not just define a method that returns the node factory for NetworkTopology 
and override it in DfsNetworkTopology? Then you can just call 
{{nt.init(nt.getNodeFactory())}} or something similar. Also the getInstance 
method should not reside in DFSNetworkTopology. We should avoid 
reflection/class hierarchy knowledge whenever possible.
# DatanodeDescriptor.java: The reflection checks at lines 503 and 901 also make 
me sad. However, I can't think of a better solution that works for branch-2 as 
Java 7 interfaces lack default methods...

> Use HDFS specific network topology to choose datanode in 
> BlockPlacementPolicyDefault
> ------------------------------------------------------------------------------------
>
>                 Key: HDFS-11530
>                 URL: https://issues.apache.org/jira/browse/HDFS-11530
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: 3.0.0-alpha2
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11530.001.patch, HDFS-11530.002.patch, 
> HDFS-11530.003.patch, HDFS-11530.004.patch, HDFS-11530.005.patch, 
> HDFS-11530.006.patch, HDFS-11530.007.patch, HDFS-11530.008.patch, 
> HDFS-11530.009.patch, HDFS-11530.010.patch, HDFS-11530.011.patch
>
>
> The work for {{chooseRandomWithStorageType}} has been merged in HDFS-11482. 
> But this method is contained in new topology {{DFSNetworkTopology}} which is 
> specified for HDFS. We should update this and let 
> {{BlockPlacementPolicyDefault}} use the new way since the original way is 
> inefficient.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to