Jim,
I'm more familiar with ExecuteScript, so someone might followup with better
information, but using ExecuteScript on 0.7 and 1.1 the worst I've had to
do to pick up script changes is to stop and restart the processor. You
mention refreshing the page didn't work, have you tried stopping and
restarting the processor instead of restarting NiFi?
Regarding the callbacks module, is it installed on your system, i.e. can
you import it in a Python shell? That module is not installed by default
on my Ubuntu 14.04 dev box, but it is in the PyPi repositories so you can
install it with "sudo pip install callbacks". If you don't have Pip,
that's usually available from your Linux package manager ("python-pip" on
Ubuntu).
Regards,
Joe
On Thu, Mar 30, 2017 at 7:14 AM, James McMahon <[email protected]> wrote:
> Hello. I am running NiFi v0.7. I've recently started working with
> InvokeScriptedProcessor processor (we'll label this as ISP) in an effort to
> establish logging resources once and only once via the initialize() feature
> of ISP.
>
> First impediment:
> I've noticed that ISP often does not detect refinements in my script. For
> example, in the UI the processor reported that on line 17 of my script name
> 'Streamcallback' was not defined. Easy to fix: typo needed to be
> StreamCallback. Corrected the script, refreshed the UI page, but the UI
> continued to report the same problem. Ultimately my only recourse was to
> completely stop and restart NiFi. Only then was that error was no longer
> reported.
> How should script changes be forced to the ISP processor?
>
> Second impediment:
> Am getting an import error, as follows:
> ImportError: no module named callbacks in <script> at line number 13
> Here is what I have on line 13:
> from callbacks import Compress, Decompress
> There's no magic or brilliance here. I copied this directly from an
> example recommended by Matt B. here: https://github.com/apache/
> nifi/blob/master/nifi-nar-bundles/nifi-scripting-bundle/
> nifi-scripting-processors/src/test/resources/jython/test_compress.py
> So suspecting that I needed to include a module with callbacks in my value
> for Module Directory in the ISP configuration, I did this at my Linux
> command line:
> locate callbacks
> I found this: /usr/lib/python2.6/site-packages/yum/callbacks.py.
> I included /usr/lib/python2.6/site-packages/yum in Module Directory
> comma-separated value list.
> This does not eliminate the error.
> Why is ISP still not recognizing callbacks, and how do I resolve this
> impediment?
> How can I determine whether callbacks is included in any of the many nars
> I find in nifi native install directories lib or lib_community?
>
> Thank you for any assistance or insights you can provide.
>
> Jim
>