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

Steve Loughran commented on HDFS-190:
-------------------------------------

you are right...but we should really move the DNs to the yarn service model 
(some other JIRA of mine there) and only start threads in the startService() 
call, as it is the DN starts threads in its ctor, which totally makes a mess of 
any subclass overriding methods those threads call.

> DataNode should be marked as final to prevent subclassing
> ---------------------------------------------------------
>
>                 Key: HDFS-190
>                 URL: https://issues.apache.org/jira/browse/HDFS-190
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Steve Loughran
>            Priority: Minor
>
> Reviewing the DataNode core, it starts a thread in its constructor calling 
> back in to the Run() method. This is generally perceived as very dangerous, 
> as if DataNode were ever subclassed, the subclass would start to be invoked 
> in the run() method before its own constructor had finished working.
> 1. Consider splitting the constructor from the start() operation.
> 2. If this cannot be changed, mark DataNode as final so nobody can subclass 
> it.  Though if the latter were done, it would be convenient to have a method 
> to let external management components poll for the health of the node, and to 
> pick up reasons for the node shutting down.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to