RE: custom plugin's constructor unable to access hadoop conf

2012-11-16 Thread Markus Jelsma
Something like that. It will be called after the object has been created and 
before Nutch' code calls the filter method. 
 
-Original message-
> From:Sourajit Basak 
> Sent: Fri 16-Nov-2012 12:48
> To: user@nutch.apache.org
> Subject: Re: custom plugin's constructor unable to access hadoop conf
> 
> Is it guaranteed that setConf(... will be called before any method gets
> invoked ? In this case filter(
> 
> 
> 
> On Fri, Nov 16, 2012 at 4:04 PM, Markus Jelsma
> wrote:
> 
> > That's because the object is not set in the constructor. You can access
> > Configuration after setConf() is called. So defer your work in the
> > constructor to this method.
> >
> >   public void setConf(Configuration conf) {
> > this.conf = conf;
> >   }
> >
> >
> >
> > -Original message-
> > > From:Sourajit Basak 
> > > Sent: Fri 16-Nov-2012 11:28
> > > To: user@nutch.apache.org
> > > Subject: custom plugin's constructor unable to access hadoop conf
> > >
> > > In my custom HtmlParseFilter plugin, I am getting a NPE on trying to
> > access
> > > the hadoop Configuration object in the plugin constructor. Is this a
> > known
> > > behavior ?
> > >
> >
> 


Re: custom plugin's constructor unable to access hadoop conf

2012-11-16 Thread Sourajit Basak
Is it guaranteed that setConf(... will be called before any method gets
invoked ? In this case filter(



On Fri, Nov 16, 2012 at 4:04 PM, Markus Jelsma
wrote:

> That's because the object is not set in the constructor. You can access
> Configuration after setConf() is called. So defer your work in the
> constructor to this method.
>
>   public void setConf(Configuration conf) {
> this.conf = conf;
>   }
>
>
>
> -Original message-
> > From:Sourajit Basak 
> > Sent: Fri 16-Nov-2012 11:28
> > To: user@nutch.apache.org
> > Subject: custom plugin's constructor unable to access hadoop conf
> >
> > In my custom HtmlParseFilter plugin, I am getting a NPE on trying to
> access
> > the hadoop Configuration object in the plugin constructor. Is this a
> known
> > behavior ?
> >
>


RE: custom plugin's constructor unable to access hadoop conf

2012-11-16 Thread Markus Jelsma
That's because the object is not set in the constructor. You can access 
Configuration after setConf() is called. So defer your work in the constructor 
to this method.

  public void setConf(Configuration conf) {
this.conf = conf;
  }

 
 
-Original message-
> From:Sourajit Basak 
> Sent: Fri 16-Nov-2012 11:28
> To: user@nutch.apache.org
> Subject: custom plugin's constructor unable to access hadoop conf
> 
> In my custom HtmlParseFilter plugin, I am getting a NPE on trying to access
> the hadoop Configuration object in the plugin constructor. Is this a known
> behavior ?
>