[ 
http://issues.apache.org/jira/browse/NUTCH-186?page=comments#action_12363903 ] 

Gal Nitzan commented on NUTCH-186:
----------------------------------

ok, JobConf extends NutchConf and in the (JobConf) constructor it adds the 
mapred-default.xml resource.

the call to add resource in NutchConf actually inserts any resource file before 
the nutch-site.xml so there is no way to override it. look at the code at the 
bottom.

the only thing required is to change line 85 in NutchConf to be:

    resourceNames.add(name); // add resouce name

instead of

    resourceNames.add(resourceNames.size()-1, name); // add second to last

and add one more line to JobConf constructor

    addConfResource("mapred-site.xml");


This way nutch-site.xml overides nutch-default.xml but other added resources 
can override nutch-site.xml which in my opinion is reasonable.

If acceptable I will create the patch.


--------------------------------- current code in ButchConf.Java 
-------------------------------------
  public synchronized void addConfResource(File file) {
    addConfResourceInternal(file);
  }
  private synchronized void addConfResourceInternal(Object name) {
    resourceNames.add(resourceNames.size()-1, name); // add second to last
    properties = null;                            // trigger reload
  }


> mapred-default.xml is over ridden by nutch-site.xml
> ---------------------------------------------------
>
>          Key: NUTCH-186
>          URL: http://issues.apache.org/jira/browse/NUTCH-186
>      Project: Nutch
>         Type: Bug
>     Versions: 0.8-dev
>  Environment: All
>     Reporter: Gal Nitzan
>     Priority: Minor

>
> If mapred.map.tasks and mapred.reduce.tasks are defined in nutch-site.xml and 
> also in mapred-default.xml the definitions from nutch-site.xml are those that 
> will take effect.
> So if a user mistakenly copies those entries into nutch-site.xml from the 
> nutch-default.xml she will not understand what happens.
> I would like to propose removing these setting completely from the 
> nutch-default.xml and put it only in mapred-default.xml where it belongs.
> I will be happy to supply a patch for that  if the proposition accepted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to