[ 
https://issues.apache.org/jira/browse/HADOOP-785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517938
 ] 

Enis Soztutar commented on HADOOP-785:
--------------------------------------

BTW, a related issue about configuration parameters is that the names of the 
parameters are used in different contexts(in hadoop-*.xml files and in the 
code), sometimes resulting in misspelling and confusion. How about the 
following *slightly ugly* way to programaticaly access parameter names. 

{code}
public class ParameterNames {
  private static final int prefixLength 
    = ParameterNames.class.getCanonicalName().length() + 1;
  
  public static final class fs {
    public static final class trash {
      public static final class root { }
      public static final class interval { }
    }
    public static final class file {
      public static final class impl { }
    }
  }
  public static String getName(Class<?> clazz) {
    return clazz.getCanonicalName().substring(prefixLength);
  } 
}
{code}

and the code to use the name would be : 
{code}
String trashPath = 
conf.get(ParameterNames.getName(ParameterNames.fs.trash.root.class))
{code}



> Divide the server and client configurations
> -------------------------------------------
>
>                 Key: HADOOP-785
>                 URL: https://issues.apache.org/jira/browse/HADOOP-785
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: conf
>    Affects Versions: 0.9.0
>            Reporter: Owen O'Malley
>            Assignee: Arun C Murthy
>             Fix For: 0.15.0
>
>
> The configuration system is easy to misconfigure and I think we need to 
> strongly divide the server from client configs. 
> An example of the problem was a configuration where the task tracker has a 
> hadoop-site.xml that set mapred.reduce.tasks to 1. Therefore, the job tracker 
> had the right number of reduces, but the map task thought there was a single 
> reduce. This lead to a hard to find diagnose failure.
> Therefore, I propose separating out the configuration types as:
> class Configuration;
> // reads site-default.xml, hadoop-default.xml
> class ServerConf extends Configuration;
> // reads hadoop-server.xml, $super
> class DfsServerConf extends ServerConf;
> // reads dfs-server.xml, $super
> class MapRedServerConf extends ServerConf;
> // reads mapred-server.xml, $super
> class ClientConf extends Configuration;
> // reads hadoop-client.xml, $super
> class JobConf extends ClientConf;
> // reads job.xml, $super
> Note in particular, that nothing corresponds to hadoop-site.xml, which 
> overrides both client and server configs. Furthermore, the properties from 
> the *-default.xml files should never be saved into the job.xml.

-- 
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