[ 
https://issues.apache.org/jira/browse/HADOOP-2385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557478#action_12557478
 ] 

Doug Cutting commented on HADOOP-2385:
--------------------------------------

> This means that the configuration classes should be public then, right?

Yes, if the parameters they access should be publicly accessible.  One might 
argue that certain parameters are only consumed internally and don't need 
public accessors, but, more typically, parameter accessors are on public 
classes.

> And it doesn't matter where the get/setters are.
> Particularly we can combine all of them in one class
> or even place them in the Configuration class. Is it what you want?

They shouldn't be all in one place or all in Configuration for the same reason 
that we don't put everything in a single file: we should attempt to keep 
related things together, to localize changes.  So an HDFS-specific parameter 
accessor should be on an HDFS-specific class.  How fine-grained we localize 
isn't clear.  Generally, finer is better: find the most-specific public class 
that encompasses the use and add the accessor there.  So if something's only 
used in the Datanode, but used in a few different classes there, then it might 
best be on Datanode.

> What I meant is that we keep placing logically independent
> code inside e.g. FSNamesystem, which makes it bigger, while it could easily 
> be made a separate class.
> And configuration is just an example of such logically independent part.

If configuration stuff is not specific to FSNamesystem (i.e., logically 
independent) then it shouldn't go there.  If it is specific to FSNamesystem 
then it could go there, or perhaps on a new class that's used only by 
FSNamesystem, e.g., FSNamesystemParams.  If it's used equally by FSNamesystem 
and other classes then it could either go on an existing shared class (e.g., 
Namenode) or a new shared class (NamenodeParams).


> Validate configuration parameters
> ---------------------------------
>
>                 Key: HADOOP-2385
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2385
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: dfs
>    Affects Versions: 0.16.0
>            Reporter: Robert Chansler
>
> Configuration parameters should be fully validated before name nodes or data 
> nodes begin service.
> Required parameters must be present.
> Required and optional parameters must have values of proper type and range.
> Undefined parameters must not be present.
> (I was recently observing some confusion whose root cause was a mis-spelled 
> parameter.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to