You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Jeff Zemerick <jz...@apache.org> on 2018/03/28 12:57:41 UTC

Read processor property in init()

Hi everyone,

Is there a recommended method for making user-configurable property
values available to a processor's init()? I would like to load a large
index file but allow the user to specify the index's path. I am
guessing that init() is executed too early to read user properties.

Thanks for any suggestions.

Jeff

Re: Read processor property in init()

Posted by Sivaprasanna <si...@gmail.com>.
Yep. That’s correct.

On Thu, 29 Mar 2018 at 6:45 PM, Jeff Zemerick <jz...@apache.org> wrote:

> Thanks! Just to confirm, each time the processor is started the
> @OnScheduled annotated method is executed, right?
>
> Jeff
>
>
> On Wed, Mar 28, 2018 at 9:07 AM, Sivaprasanna <si...@gmail.com>
> wrote:
>
> > Just to add on top of what Mike said. The @OnScheduled annotation
> indicates
> > that the method that is marked with this annotation will run when a
> > processor is started every time. So basically the setup() will be called
> > and executed everytime the processor is started from the UI.
> >
> > On Wed, 28 Mar 2018 at 6:34 PM, Jeff Zemerick <jz...@apache.org>
> > wrote:
> >
> > > I will give that a go. Thanks for the quick answer, Mike!
> > >
> > > On Wed, Mar 28, 2018 at 9:01 AM, Mike Thomsen <mi...@gmail.com>
> > > wrote:
> > > > Just do...
> > > >
> > > > @OnScheduled
> > > > public void setup(ProcessContext context) {
> > > >     //Read properties and do setup.
> > > > }
> > > >
> > > > On Wed, Mar 28, 2018 at 8:57 AM, Jeff Zemerick <jzemerick@apache.org
> >
> > > wrote:
> > > >
> > > >> Hi everyone,
> > > >>
> > > >> Is there a recommended method for making user-configurable property
> > > >> values available to a processor's init()? I would like to load a
> large
> > > >> index file but allow the user to specify the index's path. I am
> > > >> guessing that init() is executed too early to read user properties.
> > > >>
> > > >> Thanks for any suggestions.
> > > >>
> > > >> Jeff
> > > >>
> > >
> >
>

Re: Read processor property in init()

Posted by Jeff Zemerick <jz...@apache.org>.
Thanks! Just to confirm, each time the processor is started the
@OnScheduled annotated method is executed, right?

Jeff


On Wed, Mar 28, 2018 at 9:07 AM, Sivaprasanna <si...@gmail.com>
wrote:

> Just to add on top of what Mike said. The @OnScheduled annotation indicates
> that the method that is marked with this annotation will run when a
> processor is started every time. So basically the setup() will be called
> and executed everytime the processor is started from the UI.
>
> On Wed, 28 Mar 2018 at 6:34 PM, Jeff Zemerick <jz...@apache.org>
> wrote:
>
> > I will give that a go. Thanks for the quick answer, Mike!
> >
> > On Wed, Mar 28, 2018 at 9:01 AM, Mike Thomsen <mi...@gmail.com>
> > wrote:
> > > Just do...
> > >
> > > @OnScheduled
> > > public void setup(ProcessContext context) {
> > >     //Read properties and do setup.
> > > }
> > >
> > > On Wed, Mar 28, 2018 at 8:57 AM, Jeff Zemerick <jz...@apache.org>
> > wrote:
> > >
> > >> Hi everyone,
> > >>
> > >> Is there a recommended method for making user-configurable property
> > >> values available to a processor's init()? I would like to load a large
> > >> index file but allow the user to specify the index's path. I am
> > >> guessing that init() is executed too early to read user properties.
> > >>
> > >> Thanks for any suggestions.
> > >>
> > >> Jeff
> > >>
> >
>

Re: Read processor property in init()

Posted by Sivaprasanna <si...@gmail.com>.
Just to add on top of what Mike said. The @OnScheduled annotation indicates
that the method that is marked with this annotation will run when a
processor is started every time. So basically the setup() will be called
and executed everytime the processor is started from the UI.

On Wed, 28 Mar 2018 at 6:34 PM, Jeff Zemerick <jz...@apache.org> wrote:

> I will give that a go. Thanks for the quick answer, Mike!
>
> On Wed, Mar 28, 2018 at 9:01 AM, Mike Thomsen <mi...@gmail.com>
> wrote:
> > Just do...
> >
> > @OnScheduled
> > public void setup(ProcessContext context) {
> >     //Read properties and do setup.
> > }
> >
> > On Wed, Mar 28, 2018 at 8:57 AM, Jeff Zemerick <jz...@apache.org>
> wrote:
> >
> >> Hi everyone,
> >>
> >> Is there a recommended method for making user-configurable property
> >> values available to a processor's init()? I would like to load a large
> >> index file but allow the user to specify the index's path. I am
> >> guessing that init() is executed too early to read user properties.
> >>
> >> Thanks for any suggestions.
> >>
> >> Jeff
> >>
>

Re: Read processor property in init()

Posted by Jeff Zemerick <jz...@apache.org>.
I will give that a go. Thanks for the quick answer, Mike!

On Wed, Mar 28, 2018 at 9:01 AM, Mike Thomsen <mi...@gmail.com> wrote:
> Just do...
>
> @OnScheduled
> public void setup(ProcessContext context) {
>     //Read properties and do setup.
> }
>
> On Wed, Mar 28, 2018 at 8:57 AM, Jeff Zemerick <jz...@apache.org> wrote:
>
>> Hi everyone,
>>
>> Is there a recommended method for making user-configurable property
>> values available to a processor's init()? I would like to load a large
>> index file but allow the user to specify the index's path. I am
>> guessing that init() is executed too early to read user properties.
>>
>> Thanks for any suggestions.
>>
>> Jeff
>>

Re: Read processor property in init()

Posted by Mike Thomsen <mi...@gmail.com>.
Just do...

@OnScheduled
public void setup(ProcessContext context) {
    //Read properties and do setup.
}

On Wed, Mar 28, 2018 at 8:57 AM, Jeff Zemerick <jz...@apache.org> wrote:

> Hi everyone,
>
> Is there a recommended method for making user-configurable property
> values available to a processor's init()? I would like to load a large
> index file but allow the user to specify the index's path. I am
> guessing that init() is executed too early to read user properties.
>
> Thanks for any suggestions.
>
> Jeff
>