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

Yongjun Zhang commented on HDFS-5970:
-------------------------------------

Hi Iunping, 

Thanks for your encouraging words! 

I need to mention that this bug is related to HDFS-5939 that I'm working on. I 
tried to address HDFS-5939 by adding "return null"
from within the chooseRandom mehtod. Thanks to [~wheat9] who suggested that we 
need to file this JIRA for callers of this method to 
be aware of that the method could return null when reviewing my HDFS-5939 fix. 
While we are still discussing the best solution for 
HDFS-5939, it's likely we will replace the "return null" I added with throwing 
an exception.

Prior to my change, the method chooseRandom already has a piece of code that 
returns null under certain condition, So this JIRA is 
still valid in that sense. However, we haven't got any report of null value 
returned from that piece of code yet, probably we can keep 
this JIRA open until we have a real case.  

Thanks.




> callers of NetworkTopology's chooseRandom method to expect null return value
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-5970
>                 URL: https://issues.apache.org/jira/browse/HDFS-5970
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: Yongjun Zhang
>
> Class NetworkTopology's method
>    public Node chooseRandom(String scope) 
> calls 
>    private Node chooseRandom(String scope, String excludedScope)
> which may return null value.
> Callers of this method such as BlockPlacementPolicyDefault etc need to be 
> aware that.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to