nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Bateman <r...@windofkeltia.com>
Subject Re: Static processor design
Date Sat, 09 Jan 2021 16:27:07 GMT
Mark,

Thanks for responding. I think my question is a little more naive than 
that on my part.

I want to get those files through there as fast as possible. If I ask 
for /n/ files, how many would contribute to them getting them through 
the quickest? After all, I will do nothing at all to any except transfer 
them on and I don't care how many.

I write a lot of custom processors that do specific things to flowfiles 
one at a time. This isn't one of those. I don't care what's coming 
through, I just want to get every flowfile straight through with no changes.

Thanks.

Russ

On 1/9/21 9:09 AM, Mark Bean wrote:
> Russell,
>
> You can use "session.get(N)" where N is an integer. This will get up to N
> flowfiles per OnTrigger() call.
>
> -Mark
>
>
> On Fri, Jan 8, 2021 at 5:07 PM Russell Bateman <russ@windofkeltia.com>
> wrote:
>
>> Very well, I have decided to force customer flowfiles through this
>> processor (I did check out the /Listen/* processors, but chose this
>> easier solution). This now works. However,
>>
>> It brings up another question: is this the most efficient way to pass
>> flowfiles straight through this processor (we're not processing them in
>> any way), or is there a batching technique that's faster, etc. I want
>> this to be straight-through, no back-pressure, throttling or influencing
>> their passage whatsoever (because I didn't want them coming through in
>> the first place). It should be ask if this processor weren't there.
>>
>> Thanks for any and all thoughts on this.
>>
>> public class HumanReadables extends AbstractProcessor{private boolean
>> propertyModified = false;@Override public void onTrigger( final
>> ProcessContext context, final ProcessSession session ) throws
>> ProcessException{FlowFile flowfile = session.get();if( propertyModified
>> ){propertyModified = false;// record effects of changed
>> properties...}if( nonNull( flowfile ) )session.transfer( flowfile,
>> SUCCESS );}...@Override public void onPropertyModified( final
>> PropertyDescriptor descriptor, final String oldValue, final String
>> newValue ){propertyModified = true;}
>>
>>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message