Hi Joe,

But if I have multiple threads running for that processor, won’t each
instance have its own copy of that member variable?

Thanks,
Phil

On Mon, 9 Dec 2019 at 12:41, Joe Witt <joe.w...@gmail.com> wrote:

> Phil
>
> You can have a class member variable and just protect access to it.  This
> is quite common in many processors.
>
> Thanks
>
> On Sun, Dec 8, 2019 at 7:30 PM Phil H <gippyp...@gmail.com> wrote:
>
> > Hi there,
> >
> > I have a custom processor that I want to contain some shared data across
> > threads (this data is based on analysis of flow files, so constantly
> > changing). I can’t use a static variable though, because I use the same
> > processor more than once within my flow in different contexts. If there
> > isn’t a “proper” way to do this in the NiFi API, is there a way to
> > programmatically access the componentID (as shown in the UI) so I could
> use
> > that as a key to a Map containing the data?
> >
> > Thanks,
> > Phil
> >
>

Reply via email to