jira and PR cleanup

2017-07-14 Thread Joe Witt
team,

Our PR count is floating upward again and I suspect we have some
old/outdated JIRAs that need to be dispositioned.  For those with time
available a great place to help would be with reviewing/working active
PRs/contributions.

Thanks
Joe


Re: Expression language support in EvaluateXPath

2017-07-14 Thread Mark Payne
Hello,

In glancing at the processor I believe the reason that the Expression Language 
is not supported is due to efficiency purposes.
The processor grabs up to 50 FlowFiles, then compiles the XPath Expressions and 
runs them over all 50 FlowFiles. If we
did support Expression Language and EL were used, we would have to re-compile 
the XPath Expression for every FlowFile.
That said, there's no reason we can't do that. However, in order to avoid 
hurting performance when not necessary it would need
to contain a bit of logic to pre-compile the expressions that aren't configured 
with Expression Language, so it's not a trivial change.
If you're interested in updating the Processor, though, I'd be happy to review 
it.

Thanks
-Mark



> On Jul 14, 2017, at 6:51 AM, claudiu-stanciu  
> wrote:
> 
> Hello,
> 
> I saw that  EvaluateXPath declares that expression language is not supported
> 
>   
> 
> My question is: can we have support for expression language with XPath ?
> (I'm not an expression language or xpath expert :) ).
> 
> This would be nice when you want to pass the xpath from a content or an
> attribute.
> 
> Thank you
> 
> 
> 
> --
> View this message in context: 
> http://apache-nifi-developer-list.39713.n7.nabble.com/Expression-language-support-in-EvaluateXPath-tp16441.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.



Re: Trigger timer-driven processor to run from outside NIFI

2017-07-14 Thread 尹文才
Thanks very much Koji for your quick response and your example, I will look
into your example. 

Regards,
Ben

2017-07-14 17:27 GMT+08:00 Koji Kawamura :

> Hi Ben,
>
> If the processor is running, stop will wait for the thread to complete.
> Please see stop() method here.
> https://github.com/apache/nifi/blob/master/nifi-nar-
> bundles/nifi-framework-bundle/nifi-framework/nifi-framework-
> core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
>
> To stop or start a processor, you just need to update its state. I have an
> example here. Please refer updateProcessorState function.
> https://github.com/ijokarumawak/nifi-api-client-js/blob/master/nifi-api-
> client.js
>
> Trying to reply from mobile at best effort. Excuse me for typos if any..
>
> Thanks,
> Koji
>
>
> On Jul 14, 2017 5:29 PM, "尹文才"  wrote:
>
> Hi Koji, I tried to play with the NIFI REST API with chrome postman app,
> when you mentioned about restart the processor via REST API, did you mean
> first sending stop command and then send start command via the API "PUT
> /processors/{id}"? By the way, when I send the stop command to the
> processor, will it finish its work
> and then stop the processor or will it simply kill the task directly?
> Thanks.
>
> Regards,
> Ben
>
> 2017-07-14 15:13 GMT+08:00 尹文才 :
>
> > Thanks Koji, I checked the NIFI REST API and it seems that I need to use
> > Groovy to do it(I don't understand Groovy), is there any Java related
> > examples which interact with NIFI via REST API? Thanks.
> >
> > Regards,
> > Ben
> >
> > 2017-07-14 13:49 GMT+08:00 Koji Kawamura :
> >
> >> Hi Ben,
> >>
> >> Just an idea, using ListenHTTP or HandleHTTPRequest (or whatever
> >> listener type processor you can use) in front of your processor might
> >> be helpful. You also need to change your processor to support incoming
> >> FlowFile as well if it doesn't currently. This way, the outside
> >> application can send a simple HTTP request to do your processor its
> >> job.
> >>
> >> Another possible way would be using NiFi REST API, stop the processor
> >> and then restart it. When the processor is restarted, its onTrigger
> >> will be called, and it will wait for next time to be scheduled (next
> >> 5min in your case).
> >>
> >> Thanks,
> >> Koji
> >>
> >> On Wed, Jul 12, 2017 at 5:04 PM, 尹文才  wrote:
> >> > Hi guys, is it possible for a Java application outside the NIFI
> >> environment
> >> > to trigger a timer-driven processor to do its work(I mean its
> ontrigger
> >> > method will be called) when the processor is not yet due to be
> >> triggered?
> >> > The reason why I'm asking about this is because I have a Java
> >> applicatiion
> >> > with UI outside NIFI and there're some configuration data that could
> be
> >> > updated into a database, and my processor in NIFI need to get the
> >> updated
> >> > configuration
> >> > data from that database as soon as possible, but my processor is
> >> configured
> >> > to be timer driven of 5 mins. I hope the processor could be triggered
> to
> >> > run after the configuration is updated by the Java application when
> it's
> >> > not yet reached
> >> > the time for it to be triggered. Thanks.
> >> >
> >> > Regards,
> >> > Ben
> >>
> >
> >
>


Expression language support in EvaluateXPath

2017-07-14 Thread claudiu-stanciu
Hello,

I saw that  EvaluateXPath declares that expression language is not supported

  

My question is: can we have support for expression language with XPath ?
(I'm not an expression language or xpath expert :) ).

This would be nice when you want to pass the xpath from a content or an
attribute.

Thank you



--
View this message in context: 
http://apache-nifi-developer-list.39713.n7.nabble.com/Expression-language-support-in-EvaluateXPath-tp16441.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.


Re: Trigger timer-driven processor to run from outside NIFI

2017-07-14 Thread Koji Kawamura
Hi Ben,

If the processor is running, stop will wait for the thread to complete.
Please see stop() method here.
https://github.com/apache/nifi/blob/master/nifi-nar-
bundles/nifi-framework-bundle/nifi-framework/nifi-framework-
core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java

To stop or start a processor, you just need to update its state. I have an
example here. Please refer updateProcessorState function.
https://github.com/ijokarumawak/nifi-api-client-js/blob/master/nifi-api-client.js

Trying to reply from mobile at best effort. Excuse me for typos if any..

Thanks,
Koji


On Jul 14, 2017 5:29 PM, "尹文才"  wrote:

Hi Koji, I tried to play with the NIFI REST API with chrome postman app,
when you mentioned about restart the processor via REST API, did you mean
first sending stop command and then send start command via the API "PUT
/processors/{id}"? By the way, when I send the stop command to the
processor, will it finish its work
and then stop the processor or will it simply kill the task directly?
Thanks.

Regards,
Ben

2017-07-14 15:13 GMT+08:00 尹文才 :

> Thanks Koji, I checked the NIFI REST API and it seems that I need to use
> Groovy to do it(I don't understand Groovy), is there any Java related
> examples which interact with NIFI via REST API? Thanks.
>
> Regards,
> Ben
>
> 2017-07-14 13:49 GMT+08:00 Koji Kawamura :
>
>> Hi Ben,
>>
>> Just an idea, using ListenHTTP or HandleHTTPRequest (or whatever
>> listener type processor you can use) in front of your processor might
>> be helpful. You also need to change your processor to support incoming
>> FlowFile as well if it doesn't currently. This way, the outside
>> application can send a simple HTTP request to do your processor its
>> job.
>>
>> Another possible way would be using NiFi REST API, stop the processor
>> and then restart it. When the processor is restarted, its onTrigger
>> will be called, and it will wait for next time to be scheduled (next
>> 5min in your case).
>>
>> Thanks,
>> Koji
>>
>> On Wed, Jul 12, 2017 at 5:04 PM, 尹文才  wrote:
>> > Hi guys, is it possible for a Java application outside the NIFI
>> environment
>> > to trigger a timer-driven processor to do its work(I mean its ontrigger
>> > method will be called) when the processor is not yet due to be
>> triggered?
>> > The reason why I'm asking about this is because I have a Java
>> applicatiion
>> > with UI outside NIFI and there're some configuration data that could be
>> > updated into a database, and my processor in NIFI need to get the
>> updated
>> > configuration
>> > data from that database as soon as possible, but my processor is
>> configured
>> > to be timer driven of 5 mins. I hope the processor could be triggered
to
>> > run after the configuration is updated by the Java application when
it's
>> > not yet reached
>> > the time for it to be triggered. Thanks.
>> >
>> > Regards,
>> > Ben
>>
>
>


Re: Trigger timer-driven processor to run from outside NIFI

2017-07-14 Thread 尹文才
Thanks Koji, I checked the NIFI REST API and it seems that I need to use
Groovy to do it(I don't understand Groovy), is there any Java related
examples which interact with NIFI via REST API? Thanks.

Regards,
Ben

2017-07-14 13:49 GMT+08:00 Koji Kawamura :

> Hi Ben,
>
> Just an idea, using ListenHTTP or HandleHTTPRequest (or whatever
> listener type processor you can use) in front of your processor might
> be helpful. You also need to change your processor to support incoming
> FlowFile as well if it doesn't currently. This way, the outside
> application can send a simple HTTP request to do your processor its
> job.
>
> Another possible way would be using NiFi REST API, stop the processor
> and then restart it. When the processor is restarted, its onTrigger
> will be called, and it will wait for next time to be scheduled (next
> 5min in your case).
>
> Thanks,
> Koji
>
> On Wed, Jul 12, 2017 at 5:04 PM, 尹文才  wrote:
> > Hi guys, is it possible for a Java application outside the NIFI
> environment
> > to trigger a timer-driven processor to do its work(I mean its ontrigger
> > method will be called) when the processor is not yet due to be triggered?
> > The reason why I'm asking about this is because I have a Java
> applicatiion
> > with UI outside NIFI and there're some configuration data that could be
> > updated into a database, and my processor in NIFI need to get the updated
> > configuration
> > data from that database as soon as possible, but my processor is
> configured
> > to be timer driven of 5 mins. I hope the processor could be triggered to
> > run after the configuration is updated by the Java application when it's
> > not yet reached
> > the time for it to be triggered. Thanks.
> >
> > Regards,
> > Ben
>


Re: Adding properties

2017-07-14 Thread Koji Kawamura
Hi,

By looking at GetMongo source code and its docs, I believe it doesn't
write specified 'Mongo Collection Name' to any attribute of outgoing
FlowFiles. So you wouldn't be able to refer it from other processors
at downstream of your flow.
Please file a JIRA if this is needed.
https://issues.apache.org/jira/projects/NIFI

Usually, UpdateAttribute is used to set a 'filename' FlowFile
attribute using NiFi Attribute Expression Language, e.g. Add
'filename' dynamic property to UpdateAttribute with setting such as
"${collectionname}_${now():format('MMdd_HHmmss')}". But
collectionname is not available as I mentioned before.

The reason you get "myproperty is invalid" error is because GetMongo
doesn't support any dynamic properties.

Hope this helps.

Thanks,
Koji

On Thu, Jul 13, 2017 at 3:05 AM, plj  wrote:
> Howdy,
>
>   I've been away from NiFi for awhile and have forgotten how to do some
> things.  I'm using the GetMongo processor (1.2) and I want to use the 'Mongo
> Collection Name' property later .  How do I do that?
>   I've tried adding a property to the GetMongo processor but it always
> complaints that it isn't legal.  I added the property myproperty and set the
> value to collectionname.  I get the error:
>
> "'myproperty' validated against 'collectionname' is invalid because
> 'myproperty' is not a supported property"
>
> Eventually I would like to save the results from the GetMongo to a file.  I
> would like the filename to be the collectionname_date_time.  How should I be
> doing this.
>
> Thank for your help
>
>
>
> --
> View this message in context: 
> http://apache-nifi-developer-list.39713.n7.nabble.com/Adding-properties-tp16413.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.