Re: Error in Jython environment

2018-04-14 Thread Mike Thomsen
>From a lot of your posts, it seems like you're running into the same sort
of problem that some of my colleagues ran into with Jython. The fact is
that Jython is just not well supported by the Python community, and it's
going to keep getting worse as Python 2.X EOL deadline in 2020 (IIRC) gets
closer. As a Python developer, I think you might find it a lot easier to
switch to Python 3 for your code and turn these scripts into Flask-driven
microservices that are called by NiFi.

Mike

On Fri, Apr 13, 2018 at 5:47 PM James McMahon  wrote:

> No sir. When I run from the command line - I encapsulate script-specific
> command sequences in  code triggered by SCRIPT var value, and NiFi
> sequences encapsulated within NIFI var values - it runs in a Python
> environment. I attempted jython -V at the command line, and it was unable
> to find an installation of jython independent of that which comes embedded
> in NiFi 0.7.1.c.
>
> Assuming that I am operating in a Jython 2.7.0 environment when in NiFi,
> are there specific libraries or packages I should import to get it to
> recognize what seem to be very fundamental os package commands? Is it
> possible to override the use of the jython packages that I suspect are
> missing, and force it to use the python packages that I know are there?
>
> If I must abandon os.statvfs to get this to work in NiFi, have you seen
> anyone harvest disk usage information from any native NiFi processors? My
> thinking is this: if I can't climb the Jython mountain, maybe I can precede
> my ExecuteScript processor with something that does this check in advance.
> I would then rip these calls out of my python script (NIFI sections).
>
> Jim
>
> On Fri, Apr 13, 2018 at 2:59 PM, Joe Witt  wrote:
>
>> Independent of NiFi have you successfully used any version of Jython
>> to make that call?
>>
>> With the NiFi 1.x line that processor has been updated a little bit
>> and in particular i think we have Jython 2.7.1 (off memory so could be
>> totally nonsense) where as before we had 2.7.0 or something older...
>>
>> Thanks
>>
>> On Fri, Apr 13, 2018 at 6:37 PM, James McMahon 
>> wrote:
>> > Good afternoon. I am running a python script from an ExecuteScript
>> processor
>> > in NiFi 0.7.1.c. I'm assuming this is actually running in a Jython
>> > environment under the hood of the processor.
>> >
>> > General question: How can I tell what version of Jython i am employing?
>> >
>> > Specific problem: I employ an os.statvfs call to check available
>> capacity on
>> > my disk devices that host my content repo, and that host my data landing
>> > zone. In my command line environment - not jython - Python has this
>> library
>> > and so I can successfully make this call.
>> >
>> > In NiFi, I get this error at run time:
>> >
>> > javax.script.ScriptException: AttributeError: 'module' object has no
>> > attribute ;statvfs'
>> >
>> > How can I correct this? I am happy to replace it if necessary with
>> something
>> > Jython provides, but don't fully understand the Jython environment
>> within
>> > NiFi. Is there a suitable Jython equivalent to fix this problem? What
>> > package or module must i include in my script to get at that?
>> >
>> > Thanks in advance for your help.
>> >
>> > Jim
>>
>


Re: processGroupId URL

2018-04-14 Thread scott

Matt,

Thank you for your comments and for creating a Jira to add this 
improvement. I'll take your advice on the logging bulletins, I agree 
that can be done as a separate function.



Thanks,

Scott


On 04/11/2018 06:31 AM, Matt Gilman wrote:
tors you mentioned are bulletins. Bulletins are designed to be a 
notification about a passing event. They are not meant to be a 
persisted or acknowledged in any manner. The main factor there is the 
rate at which they are generated. A bulletin will be created for every 
log message with a severity matching or worse than the configured 
threshold. If you're looking to do something more meaningful with the 
logs you may want to consider introducing a tool built for that. We do 
offer a Reporting Task that will send the Bulletins via Site to Site 
to another NiFi instance which could be used to load/store them someplace.