Processor Bundle Archetype

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Processor Bundle Archetype

Bryan Bende
After setting up a project to develop some custom processors, I started
thinking it would be useful to have a really easy way to jump start a new
project, so I created a Maven archetype that can be used to help get
started:

https://github.com/bbende/nifi-processor-bundle-archetype

If anyone has any feedback on useful defaults, or best practices to
include, let me know.

If something like this already exists, then I'll chalk this up to a good
learning experience since I learned a lot about multi-module archetypes :)

-Bryan
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Joe Witt
Bryan,

Sweet!  We've had a couple archetypes over the years but didn't do a good
job of staying up with them.  Will look into this thoroughly.  Very cool.

Thanks
Joe

On Sun, Jan 4, 2015 at 3:23 PM, Bryan Bende <[hidden email]> wrote:

> After setting up a project to develop some custom processors, I started
> thinking it would be useful to have a really easy way to jump start a new
> project, so I created a Maven archetype that can be used to help get
> started:
>
> https://github.com/bbende/nifi-processor-bundle-archetype
>
> If anyone has any feedback on useful defaults, or best practices to
> include, let me know.
>
> If something like this already exists, then I'll chalk this up to a good
> learning experience since I learned a lot about multi-module archetypes :)
>
> -Bryan
>
Reply | Threaded
Open this post in threaded view
|

RE: Processor Bundle Archetype

Mark Payne
In reply to this post by Bryan Bende
Bryan,
This is great! I've been meaning to do this for a while... just haven't gotten around to it. Very helpful.
It's done pretty well, too, I would say. I have just a few things I'd point out:
In the Processor implementation, I would avoid the:this.myProperty = context.getProperty(MY_PROPERTY).getValue();
and defining the myProperty variable altogether.
This approach is not thread-safe, and the context.getProperty() returns PropertyValue, which has some nice convenience methods like "asInteger", etc.
In the onTrigger method, the argument names are 'processContext' and 'processSession'. I would call these simply 'context' and 'session', as it's much easier to type and these are the names that are typically used.
In the processor's directory you may also want to build a directory structure of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
with a stubbed out documentation. The Standard Processors all use the same documentation.
Then, in the application, if you right-click on a Processor and click "Usage", that's where the information comes from.
This is very helpful! I will be building this locally so I can start making use of it.

> Date: Sun, 4 Jan 2015 15:23:56 -0500
> Subject: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
>
> After setting up a project to develop some custom processors, I started
> thinking it would be useful to have a really easy way to jump start a new
> project, so I created a Maven archetype that can be used to help get
> started:
>
> https://github.com/bbende/nifi-processor-bundle-archetype
>
> If anyone has any feedback on useful defaults, or best practices to
> include, let me know.
>
> If something like this already exists, then I'll chalk this up to a good
> learning experience since I learned a lot about multi-module archetypes :)
>
> -Bryan
     
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Bryan Bende
Mark,

Thanks for the feedback! and glad it is useful for you.

I just made the updates you suggested so you should be able to pull them
down from GitHub.

If you were thinking of anything different for the documentation stub let
me know. I just took an example that had Uses Attributes, Modifies
Attributes, Properties, and Relationships, and then removed the specific
content.

-Bryan

On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]> wrote:

> Bryan,
> This is great! I've been meaning to do this for a while... just haven't
> gotten around to it. Very helpful.
> It's done pretty well, too, I would say. I have just a few things I'd
> point out:
> In the Processor implementation, I would avoid the:this.myProperty =
> context.getProperty(MY_PROPERTY).getValue();
> and defining the myProperty variable altogether.
> This approach is not thread-safe, and the context.getProperty() returns
> PropertyValue, which has some nice convenience methods like "asInteger",
> etc.
> In the onTrigger method, the argument names are 'processContext' and
> 'processSession'. I would call these simply 'context' and 'session', as
> it's much easier to type and these are the names that are typically used.
> In the processor's directory you may also want to build a directory
> structure
> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> with a stubbed out documentation. The Standard Processors all use the same
> documentation.
> Then, in the application, if you right-click on a Processor and click
> "Usage", that's where the information comes from.
> This is very helpful! I will be building this locally so I can start
> making use of it.
>
> > Date: Sun, 4 Jan 2015 15:23:56 -0500
> > Subject: Processor Bundle Archetype
> > From: [hidden email]
> > To: [hidden email]
> >
> > After setting up a project to develop some custom processors, I started
> > thinking it would be useful to have a really easy way to jump start a new
> > project, so I created a Maven archetype that can be used to help get
> > started:
> >
> > https://github.com/bbende/nifi-processor-bundle-archetype
> >
> > If anyone has any feedback on useful defaults, or best practices to
> > include, let me know.
> >
> > If something like this already exists, then I'll chalk this up to a good
> > learning experience since I learned a lot about multi-module archetypes
> :)
> >
> > -Bryan
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Processor Bundle Archetype

Mark Payne
All,
Bryan has done a great job of creating a Maven archetype for creating a processor bundle (processor + nar + parent). I think it will be extremely helpful to have, and Bryan has chosen to contribute the archetype back to the community.
The question is where in the source tree does it make sense to put it?
I could see putting it directly under nifi/ or nifi/commons but I imagine that there will be more archetypes in the future -- for reporting tasks, for controller services, and perhaps other things.  So maybe we would create a nifi/maven-archetypes or a nifi/commons/maven-archetypes directory.
Any thoughts on where best to add this into the source tree?
Thanks-Mark

Date: Mon, 19 Jan 2015 21:48:26 -0500
Subject: Re: Processor Bundle Archetype
From: [hidden email]
To: [hidden email]

Hey Mark,

Since it looks like the develop branch is back to having the nar-maven-plugin and nifi as the two top level directories, where would you want to put the archetype? I guess it could be a directory under nifi ?

And do you have a preference on the artifactId? In my own repo I called it nifi-processor-bundle-archetype, but I wasn't sure if something else made more sense within the actual NiFi source code.

-Bryan

On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]> wrote:



Bryan,
That's great - I was hoping you'd go ahead and contribute that back. I think it's best if you create the patch/pull-request so that all of the git patch magic can take affect and show you as the contributor. I think putting it into that new directory with the nar plugin is the way to go, too.
I created a ticket that you can submit the patch/PR to: https://issues.apache.org/jira/browse/NIFI-272
Many thanks!-Mark

Date: Fri, 16 Jan 2015 09:27:09 -0500
Subject: Re: Processor Bundle Archetype
From: [hidden email]
To: [hidden email]

Hey Mark,
Glad you like the archetype so much! I would love to contribute it to the official codebase. I could probably put together a patch/pull-request over the weekend if that works, or if you are looking to get it in there today, I have no problem with you taking the reigns and doing it. I was looking at the latest code last night and I saw one of Joe W's email about the latest directory structure, so I assume we could put the archetype along side the nar plugin. Let me know what you want to do.
-Bryan
On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]> wrote:



Hey Bryan,
Sorry, I never did write back. I did look at the documentation that you put together, and it's perfect. Every time I write Processor, I end up copying another index.html and gutting it to look just like this one and then filling in. So nice to not have to do that every time. I appreciate all the work you put into this!
Were you interested in putting this into the Apache NiFi codebase? Or did you want to keep it separate?
Thanks-Mark

> Date: Wed, 7 Jan 2015 20:42:10 -0500
> Subject: Re: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
>
> Mark,
>
> Thanks for the feedback! and glad it is useful for you.
>
> I just made the updates you suggested so you should be able to pull them
> down from GitHub.
>
> If you were thinking of anything different for the documentation stub let
> me know. I just took an example that had Uses Attributes, Modifies
> Attributes, Properties, and Relationships, and then removed the specific
> content.
>
> -Bryan
>
> On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]> wrote:
>
> > Bryan,
> > This is great! I've been meaning to do this for a while... just haven't
> > gotten around to it. Very helpful.
> > It's done pretty well, too, I would say. I have just a few things I'd
> > point out:
> > In the Processor implementation, I would avoid the:this.myProperty =
> > context.getProperty(MY_PROPERTY).getValue();
> > and defining the myProperty variable altogether.
> > This approach is not thread-safe, and the context.getProperty() returns
> > PropertyValue, which has some nice convenience methods like "asInteger",
> > etc.
> > In the onTrigger method, the argument names are 'processContext' and
> > 'processSession'. I would call these simply 'context' and 'session', as
> > it's much easier to type and these are the names that are typically used.
> > In the processor's directory you may also want to build a directory
> > structure
> > of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> > with a stubbed out documentation. The Standard Processors all use the same
> > documentation.
> > Then, in the application, if you right-click on a Processor and click
> > "Usage", that's where the information comes from.
> > This is very helpful! I will be building this locally so I can start
> > making use of it.
> >
> > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> > > Subject: Processor Bundle Archetype
> > > From: [hidden email]
> > > To: [hidden email]
> > >
> > > After setting up a project to develop some custom processors, I started
> > > thinking it would be useful to have a really easy way to jump start a new
> > > project, so I created a Maven archetype that can be used to help get
> > > started:
> > >
> > > https://github.com/bbende/nifi-processor-bundle-archetype
> > >
> > > If anyone has any feedback on useful defaults, or best practices to
> > > include, let me know.
> > >
> > > If something like this already exists, then I'll chalk this up to a good
> > > learning experience since I learned a lot about multi-module archetypes
> > :)
> > >
> > > -Bryan
> >
> >
     

     

     
Reply | Threaded
Open this post in threaded view
|

RE: Processor Bundle Archetype

Joe Witt
I recommend nifi/maven - archetypes.

Thanks Bryan!
On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:

> All,
> Bryan has done a great job of creating a Maven archetype for creating a
> processor bundle (processor + nar + parent). I think it will be extremely
> helpful to have, and Bryan has chosen to contribute the archetype back to
> the community.
> The question is where in the source tree does it make sense to put it?
> I could see putting it directly under nifi/ or nifi/commons but I imagine
> that there will be more archetypes in the future -- for reporting tasks,
> for controller services, and perhaps other things.  So maybe we would
> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes directory.
> Any thoughts on where best to add this into the source tree?
> Thanks-Mark
>
> Date: Mon, 19 Jan 2015 21:48:26 -0500
> Subject: Re: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
>
> Hey Mark,
>
> Since it looks like the develop branch is back to having the
> nar-maven-plugin and nifi as the two top level directories, where would you
> want to put the archetype? I guess it could be a directory under nifi ?
>
> And do you have a preference on the artifactId? In my own repo I called it
> nifi-processor-bundle-archetype, but I wasn't sure if something else made
> more sense within the actual NiFi source code.
>
> -Bryan
>
> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]> wrote:
>
>
>
> Bryan,
> That's great - I was hoping you'd go ahead and contribute that back. I
> think it's best if you create the patch/pull-request so that all of the git
> patch magic can take affect and show you as the contributor. I think
> putting it into that new directory with the nar plugin is the way to go,
> too.
> I created a ticket that you can submit the patch/PR to:
> https://issues.apache.org/jira/browse/NIFI-272
> Many thanks!-Mark
>
> Date: Fri, 16 Jan 2015 09:27:09 -0500
> Subject: Re: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
>
> Hey Mark,
> Glad you like the archetype so much! I would love to contribute it to the
> official codebase. I could probably put together a patch/pull-request over
> the weekend if that works, or if you are looking to get it in there today,
> I have no problem with you taking the reigns and doing it. I was looking at
> the latest code last night and I saw one of Joe W's email about the latest
> directory structure, so I assume we could put the archetype along side the
> nar plugin. Let me know what you want to do.
> -Bryan
> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]> wrote:
>
>
>
> Hey Bryan,
> Sorry, I never did write back. I did look at the documentation that you
> put together, and it's perfect. Every time I write Processor, I end up
> copying another index.html and gutting it to look just like this one and
> then filling in. So nice to not have to do that every time. I appreciate
> all the work you put into this!
> Were you interested in putting this into the Apache NiFi codebase? Or did
> you want to keep it separate?
> Thanks-Mark
>
> > Date: Wed, 7 Jan 2015 20:42:10 -0500
> > Subject: Re: Processor Bundle Archetype
> > From: [hidden email]
> > To: [hidden email]
> >
> > Mark,
> >
> > Thanks for the feedback! and glad it is useful for you.
> >
> > I just made the updates you suggested so you should be able to pull them
> > down from GitHub.
> >
> > If you were thinking of anything different for the documentation stub let
> > me know. I just took an example that had Uses Attributes, Modifies
> > Attributes, Properties, and Relationships, and then removed the specific
> > content.
> >
> > -Bryan
> >
> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]> wrote:
> >
> > > Bryan,
> > > This is great! I've been meaning to do this for a while... just haven't
> > > gotten around to it. Very helpful.
> > > It's done pretty well, too, I would say. I have just a few things I'd
> > > point out:
> > > In the Processor implementation, I would avoid the:this.myProperty =
> > > context.getProperty(MY_PROPERTY).getValue();
> > > and defining the myProperty variable altogether.
> > > This approach is not thread-safe, and the context.getProperty() returns
> > > PropertyValue, which has some nice convenience methods like
> "asInteger",
> > > etc.
> > > In the onTrigger method, the argument names are 'processContext' and
> > > 'processSession'. I would call these simply 'context' and 'session', as
> > > it's much easier to type and these are the names that are typically
> used.
> > > In the processor's directory you may also want to build a directory
> > > structure
> > >
> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> > > with a stubbed out documentation. The Standard Processors all use the
> same
> > > documentation.
> > > Then, in the application, if you right-click on a Processor and click
> > > "Usage", that's where the information comes from.
> > > This is very helpful! I will be building this locally so I can start
> > > making use of it.
> > >
> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> > > > Subject: Processor Bundle Archetype
> > > > From: [hidden email]
> > > > To: [hidden email]
> > > >
> > > > After setting up a project to develop some custom processors, I
> started
> > > > thinking it would be useful to have a really easy way to jump start
> a new
> > > > project, so I created a Maven archetype that can be used to help get
> > > > started:
> > > >
> > > > https://github.com/bbende/nifi-processor-bundle-archetype
> > > >
> > > > If anyone has any feedback on useful defaults, or best practices to
> > > > include, let me know.
> > > >
> > > > If something like this already exists, then I'll chalk this up to a
> good
> > > > learning experience since I learned a lot about multi-module
> archetypes
> > > :)
> > > >
> > > > -Bryan
> > >
> > >
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Bryan Bende
Sounds good. Is there any preference on the artifactId?

I originally called it nifi-processor-bundle-archetype, but maybe
processor-bundle-archetype makes more sense now since it will already be
clear that it is part of NiFi.

-Bryan.

On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:

> I recommend nifi/maven - archetypes.
>
> Thanks Bryan!
> On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
>
>> All,
>> Bryan has done a great job of creating a Maven archetype for creating a
>> processor bundle (processor + nar + parent). I think it will be extremely
>> helpful to have, and Bryan has chosen to contribute the archetype back to
>> the community.
>> The question is where in the source tree does it make sense to put it?
>> I could see putting it directly under nifi/ or nifi/commons but I imagine
>> that there will be more archetypes in the future -- for reporting tasks,
>> for controller services, and perhaps other things.  So maybe we would
>> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes directory.
>> Any thoughts on where best to add this into the source tree?
>> Thanks-Mark
>>
>> Date: Mon, 19 Jan 2015 21:48:26 -0500
>> Subject: Re: Processor Bundle Archetype
>> From: [hidden email]
>> To: [hidden email]
>>
>> Hey Mark,
>>
>> Since it looks like the develop branch is back to having the
>> nar-maven-plugin and nifi as the two top level directories, where would you
>> want to put the archetype? I guess it could be a directory under nifi ?
>>
>> And do you have a preference on the artifactId? In my own repo I called
>> it nifi-processor-bundle-archetype, but I wasn't sure if something else
>> made more sense within the actual NiFi source code.
>>
>> -Bryan
>>
>> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]> wrote:
>>
>>
>>
>> Bryan,
>> That's great - I was hoping you'd go ahead and contribute that back. I
>> think it's best if you create the patch/pull-request so that all of the git
>> patch magic can take affect and show you as the contributor. I think
>> putting it into that new directory with the nar plugin is the way to go,
>> too.
>> I created a ticket that you can submit the patch/PR to:
>> https://issues.apache.org/jira/browse/NIFI-272
>> Many thanks!-Mark
>>
>> Date: Fri, 16 Jan 2015 09:27:09 -0500
>> Subject: Re: Processor Bundle Archetype
>> From: [hidden email]
>> To: [hidden email]
>>
>> Hey Mark,
>> Glad you like the archetype so much! I would love to contribute it to the
>> official codebase. I could probably put together a patch/pull-request over
>> the weekend if that works, or if you are looking to get it in there today,
>> I have no problem with you taking the reigns and doing it. I was looking at
>> the latest code last night and I saw one of Joe W's email about the latest
>> directory structure, so I assume we could put the archetype along side the
>> nar plugin. Let me know what you want to do.
>> -Bryan
>> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]> wrote:
>>
>>
>>
>> Hey Bryan,
>> Sorry, I never did write back. I did look at the documentation that you
>> put together, and it's perfect. Every time I write Processor, I end up
>> copying another index.html and gutting it to look just like this one and
>> then filling in. So nice to not have to do that every time. I appreciate
>> all the work you put into this!
>> Were you interested in putting this into the Apache NiFi codebase? Or did
>> you want to keep it separate?
>> Thanks-Mark
>>
>> > Date: Wed, 7 Jan 2015 20:42:10 -0500
>> > Subject: Re: Processor Bundle Archetype
>> > From: [hidden email]
>> > To: [hidden email]
>> >
>> > Mark,
>> >
>> > Thanks for the feedback! and glad it is useful for you.
>> >
>> > I just made the updates you suggested so you should be able to pull them
>> > down from GitHub.
>> >
>> > If you were thinking of anything different for the documentation stub
>> let
>> > me know. I just took an example that had Uses Attributes, Modifies
>> > Attributes, Properties, and Relationships, and then removed the specific
>> > content.
>> >
>> > -Bryan
>> >
>> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]>
>> wrote:
>> >
>> > > Bryan,
>> > > This is great! I've been meaning to do this for a while... just
>> haven't
>> > > gotten around to it. Very helpful.
>> > > It's done pretty well, too, I would say. I have just a few things I'd
>> > > point out:
>> > > In the Processor implementation, I would avoid the:this.myProperty =
>> > > context.getProperty(MY_PROPERTY).getValue();
>> > > and defining the myProperty variable altogether.
>> > > This approach is not thread-safe, and the context.getProperty()
>> returns
>> > > PropertyValue, which has some nice convenience methods like
>> "asInteger",
>> > > etc.
>> > > In the onTrigger method, the argument names are 'processContext' and
>> > > 'processSession'. I would call these simply 'context' and 'session',
>> as
>> > > it's much easier to type and these are the names that are typically
>> used.
>> > > In the processor's directory you may also want to build a directory
>> > > structure
>> > >
>> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
>> > > with a stubbed out documentation. The Standard Processors all use the
>> same
>> > > documentation.
>> > > Then, in the application, if you right-click on a Processor and click
>> > > "Usage", that's where the information comes from.
>> > > This is very helpful! I will be building this locally so I can start
>> > > making use of it.
>> > >
>> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
>> > > > Subject: Processor Bundle Archetype
>> > > > From: [hidden email]
>> > > > To: [hidden email]
>> > > >
>> > > > After setting up a project to develop some custom processors, I
>> started
>> > > > thinking it would be useful to have a really easy way to jump start
>> a new
>> > > > project, so I created a Maven archetype that can be used to help get
>> > > > started:
>> > > >
>> > > > https://github.com/bbende/nifi-processor-bundle-archetype
>> > > >
>> > > > If anyone has any feedback on useful defaults, or best practices to
>> > > > include, let me know.
>> > > >
>> > > > If something like this already exists, then I'll chalk this up to a
>> good
>> > > > learning experience since I learned a lot about multi-module
>> archetypes
>> > > :)
>> > > >
>> > > > -Bryan
>> > >
>> > >
>>
>>
>>
>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

RE: Processor Bundle Archetype

Mark Payne
Bryan,
I would forgo the 'nifi-' prefix personally. We go back & forth a bit on this with our artifacts, admittedly. But when you use a Maven archetype you'll be specifying the groupId as well as the artifactId, and since the groupId would be 'org.apache.nifi' I think in this case the 'nifi-' prefix is redundant.
Thanks-Mark

> Date: Tue, 20 Jan 2015 09:17:23 -0500
> Subject: Re: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
>
> Sounds good. Is there any preference on the artifactId?
>
> I originally called it nifi-processor-bundle-archetype, but maybe
> processor-bundle-archetype makes more sense now since it will already be
> clear that it is part of NiFi.
>
> -Bryan.
>
> On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:
>
> > I recommend nifi/maven - archetypes.
> >
> > Thanks Bryan!
> > On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
> >
> >> All,
> >> Bryan has done a great job of creating a Maven archetype for creating a
> >> processor bundle (processor + nar + parent). I think it will be extremely
> >> helpful to have, and Bryan has chosen to contribute the archetype back to
> >> the community.
> >> The question is where in the source tree does it make sense to put it?
> >> I could see putting it directly under nifi/ or nifi/commons but I imagine
> >> that there will be more archetypes in the future -- for reporting tasks,
> >> for controller services, and perhaps other things.  So maybe we would
> >> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes directory.
> >> Any thoughts on where best to add this into the source tree?
> >> Thanks-Mark
> >>
> >> Date: Mon, 19 Jan 2015 21:48:26 -0500
> >> Subject: Re: Processor Bundle Archetype
> >> From: [hidden email]
> >> To: [hidden email]
> >>
> >> Hey Mark,
> >>
> >> Since it looks like the develop branch is back to having the
> >> nar-maven-plugin and nifi as the two top level directories, where would you
> >> want to put the archetype? I guess it could be a directory under nifi ?
> >>
> >> And do you have a preference on the artifactId? In my own repo I called
> >> it nifi-processor-bundle-archetype, but I wasn't sure if something else
> >> made more sense within the actual NiFi source code.
> >>
> >> -Bryan
> >>
> >> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]> wrote:
> >>
> >>
> >>
> >> Bryan,
> >> That's great - I was hoping you'd go ahead and contribute that back. I
> >> think it's best if you create the patch/pull-request so that all of the git
> >> patch magic can take affect and show you as the contributor. I think
> >> putting it into that new directory with the nar plugin is the way to go,
> >> too.
> >> I created a ticket that you can submit the patch/PR to:
> >> https://issues.apache.org/jira/browse/NIFI-272
> >> Many thanks!-Mark
> >>
> >> Date: Fri, 16 Jan 2015 09:27:09 -0500
> >> Subject: Re: Processor Bundle Archetype
> >> From: [hidden email]
> >> To: [hidden email]
> >>
> >> Hey Mark,
> >> Glad you like the archetype so much! I would love to contribute it to the
> >> official codebase. I could probably put together a patch/pull-request over
> >> the weekend if that works, or if you are looking to get it in there today,
> >> I have no problem with you taking the reigns and doing it. I was looking at
> >> the latest code last night and I saw one of Joe W's email about the latest
> >> directory structure, so I assume we could put the archetype along side the
> >> nar plugin. Let me know what you want to do.
> >> -Bryan
> >> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]> wrote:
> >>
> >>
> >>
> >> Hey Bryan,
> >> Sorry, I never did write back. I did look at the documentation that you
> >> put together, and it's perfect. Every time I write Processor, I end up
> >> copying another index.html and gutting it to look just like this one and
> >> then filling in. So nice to not have to do that every time. I appreciate
> >> all the work you put into this!
> >> Were you interested in putting this into the Apache NiFi codebase? Or did
> >> you want to keep it separate?
> >> Thanks-Mark
> >>
> >> > Date: Wed, 7 Jan 2015 20:42:10 -0500
> >> > Subject: Re: Processor Bundle Archetype
> >> > From: [hidden email]
> >> > To: [hidden email]
> >> >
> >> > Mark,
> >> >
> >> > Thanks for the feedback! and glad it is useful for you.
> >> >
> >> > I just made the updates you suggested so you should be able to pull them
> >> > down from GitHub.
> >> >
> >> > If you were thinking of anything different for the documentation stub
> >> let
> >> > me know. I just took an example that had Uses Attributes, Modifies
> >> > Attributes, Properties, and Relationships, and then removed the specific
> >> > content.
> >> >
> >> > -Bryan
> >> >
> >> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]>
> >> wrote:
> >> >
> >> > > Bryan,
> >> > > This is great! I've been meaning to do this for a while... just
> >> haven't
> >> > > gotten around to it. Very helpful.
> >> > > It's done pretty well, too, I would say. I have just a few things I'd
> >> > > point out:
> >> > > In the Processor implementation, I would avoid the:this.myProperty =
> >> > > context.getProperty(MY_PROPERTY).getValue();
> >> > > and defining the myProperty variable altogether.
> >> > > This approach is not thread-safe, and the context.getProperty()
> >> returns
> >> > > PropertyValue, which has some nice convenience methods like
> >> "asInteger",
> >> > > etc.
> >> > > In the onTrigger method, the argument names are 'processContext' and
> >> > > 'processSession'. I would call these simply 'context' and 'session',
> >> as
> >> > > it's much easier to type and these are the names that are typically
> >> used.
> >> > > In the processor's directory you may also want to build a directory
> >> > > structure
> >> > >
> >> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> >> > > with a stubbed out documentation. The Standard Processors all use the
> >> same
> >> > > documentation.
> >> > > Then, in the application, if you right-click on a Processor and click
> >> > > "Usage", that's where the information comes from.
> >> > > This is very helpful! I will be building this locally so I can start
> >> > > making use of it.
> >> > >
> >> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> >> > > > Subject: Processor Bundle Archetype
> >> > > > From: [hidden email]
> >> > > > To: [hidden email]
> >> > > >
> >> > > > After setting up a project to develop some custom processors, I
> >> started
> >> > > > thinking it would be useful to have a really easy way to jump start
> >> a new
> >> > > > project, so I created a Maven archetype that can be used to help get
> >> > > > started:
> >> > > >
> >> > > > https://github.com/bbende/nifi-processor-bundle-archetype
> >> > > >
> >> > > > If anyone has any feedback on useful defaults, or best practices to
> >> > > > include, let me know.
> >> > > >
> >> > > > If something like this already exists, then I'll chalk this up to a
> >> good
> >> > > > learning experience since I learned a lot about multi-module
> >> archetypes
> >> > > :)
> >> > > >
> >> > > > -Bryan
> >> > >
> >> > >
> >>
> >>
> >>
> >>
> >>
> >>
> >
     
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Adam Taft
The advantage of naming your artifact with a redundant prefix project name
(like 'nifi-*') is that if you ever look at a big pile of jars, you can
somewhat eyeball them and know where they came from. i.e. nifi-utils.jar is
better than utils.jar, in terms of identifying its source.  Likewise, you
help avoid jar naming clashes for generically named jars.

I don't believe this matters for the archetype or the maven plugin.  But it
might be nice for other released artifacts.

On Tue, Jan 20, 2015 at 9:26 AM, Mark Payne <[hidden email]> wrote:

> Bryan,
> I would forgo the 'nifi-' prefix personally. We go back & forth a bit on
> this with our artifacts, admittedly. But when you use a Maven archetype
> you'll be specifying the groupId as well as the artifactId, and since the
> groupId would be 'org.apache.nifi' I think in this case the 'nifi-' prefix
> is redundant.
> Thanks-Mark
>
> > Date: Tue, 20 Jan 2015 09:17:23 -0500
> > Subject: Re: Processor Bundle Archetype
> > From: [hidden email]
> > To: [hidden email]
> > CC: [hidden email]
> >
> > Sounds good. Is there any preference on the artifactId?
> >
> > I originally called it nifi-processor-bundle-archetype, but maybe
> > processor-bundle-archetype makes more sense now since it will already be
> > clear that it is part of NiFi.
> >
> > -Bryan.
> >
> > On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:
> >
> > > I recommend nifi/maven - archetypes.
> > >
> > > Thanks Bryan!
> > > On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
> > >
> > >> All,
> > >> Bryan has done a great job of creating a Maven archetype for creating
> a
> > >> processor bundle (processor + nar + parent). I think it will be
> extremely
> > >> helpful to have, and Bryan has chosen to contribute the archetype
> back to
> > >> the community.
> > >> The question is where in the source tree does it make sense to put it?
> > >> I could see putting it directly under nifi/ or nifi/commons but I
> imagine
> > >> that there will be more archetypes in the future -- for reporting
> tasks,
> > >> for controller services, and perhaps other things.  So maybe we would
> > >> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes
> directory.
> > >> Any thoughts on where best to add this into the source tree?
> > >> Thanks-Mark
> > >>
> > >> Date: Mon, 19 Jan 2015 21:48:26 -0500
> > >> Subject: Re: Processor Bundle Archetype
> > >> From: [hidden email]
> > >> To: [hidden email]
> > >>
> > >> Hey Mark,
> > >>
> > >> Since it looks like the develop branch is back to having the
> > >> nar-maven-plugin and nifi as the two top level directories, where
> would you
> > >> want to put the archetype? I guess it could be a directory under nifi
> ?
> > >>
> > >> And do you have a preference on the artifactId? In my own repo I
> called
> > >> it nifi-processor-bundle-archetype, but I wasn't sure if something
> else
> > >> made more sense within the actual NiFi source code.
> > >>
> > >> -Bryan
> > >>
> > >> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]>
> wrote:
> > >>
> > >>
> > >>
> > >> Bryan,
> > >> That's great - I was hoping you'd go ahead and contribute that back. I
> > >> think it's best if you create the patch/pull-request so that all of
> the git
> > >> patch magic can take affect and show you as the contributor. I think
> > >> putting it into that new directory with the nar plugin is the way to
> go,
> > >> too.
> > >> I created a ticket that you can submit the patch/PR to:
> > >> https://issues.apache.org/jira/browse/NIFI-272
> > >> Many thanks!-Mark
> > >>
> > >> Date: Fri, 16 Jan 2015 09:27:09 -0500
> > >> Subject: Re: Processor Bundle Archetype
> > >> From: [hidden email]
> > >> To: [hidden email]
> > >>
> > >> Hey Mark,
> > >> Glad you like the archetype so much! I would love to contribute it to
> the
> > >> official codebase. I could probably put together a patch/pull-request
> over
> > >> the weekend if that works, or if you are looking to get it in there
> today,
> > >> I have no problem with you taking the reigns and doing it. I was
> looking at
> > >> the latest code last night and I saw one of Joe W's email about the
> latest
> > >> directory structure, so I assume we could put the archetype along
> side the
> > >> nar plugin. Let me know what you want to do.
> > >> -Bryan
> > >> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]>
> wrote:
> > >>
> > >>
> > >>
> > >> Hey Bryan,
> > >> Sorry, I never did write back. I did look at the documentation that
> you
> > >> put together, and it's perfect. Every time I write Processor, I end up
> > >> copying another index.html and gutting it to look just like this one
> and
> > >> then filling in. So nice to not have to do that every time. I
> appreciate
> > >> all the work you put into this!
> > >> Were you interested in putting this into the Apache NiFi codebase? Or
> did
> > >> you want to keep it separate?
> > >> Thanks-Mark
> > >>
> > >> > Date: Wed, 7 Jan 2015 20:42:10 -0500
> > >> > Subject: Re: Processor Bundle Archetype
> > >> > From: [hidden email]
> > >> > To: [hidden email]
> > >> >
> > >> > Mark,
> > >> >
> > >> > Thanks for the feedback! and glad it is useful for you.
> > >> >
> > >> > I just made the updates you suggested so you should be able to pull
> them
> > >> > down from GitHub.
> > >> >
> > >> > If you were thinking of anything different for the documentation
> stub
> > >> let
> > >> > me know. I just took an example that had Uses Attributes, Modifies
> > >> > Attributes, Properties, and Relationships, and then removed the
> specific
> > >> > content.
> > >> >
> > >> > -Bryan
> > >> >
> > >> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]>
> > >> wrote:
> > >> >
> > >> > > Bryan,
> > >> > > This is great! I've been meaning to do this for a while... just
> > >> haven't
> > >> > > gotten around to it. Very helpful.
> > >> > > It's done pretty well, too, I would say. I have just a few things
> I'd
> > >> > > point out:
> > >> > > In the Processor implementation, I would avoid
> the:this.myProperty =
> > >> > > context.getProperty(MY_PROPERTY).getValue();
> > >> > > and defining the myProperty variable altogether.
> > >> > > This approach is not thread-safe, and the context.getProperty()
> > >> returns
> > >> > > PropertyValue, which has some nice convenience methods like
> > >> "asInteger",
> > >> > > etc.
> > >> > > In the onTrigger method, the argument names are 'processContext'
> and
> > >> > > 'processSession'. I would call these simply 'context' and
> 'session',
> > >> as
> > >> > > it's much easier to type and these are the names that are
> typically
> > >> used.
> > >> > > In the processor's directory you may also want to build a
> directory
> > >> > > structure
> > >> > >
> > >>
> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> > >> > > with a stubbed out documentation. The Standard Processors all use
> the
> > >> same
> > >> > > documentation.
> > >> > > Then, in the application, if you right-click on a Processor and
> click
> > >> > > "Usage", that's where the information comes from.
> > >> > > This is very helpful! I will be building this locally so I can
> start
> > >> > > making use of it.
> > >> > >
> > >> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> > >> > > > Subject: Processor Bundle Archetype
> > >> > > > From: [hidden email]
> > >> > > > To: [hidden email]
> > >> > > >
> > >> > > > After setting up a project to develop some custom processors, I
> > >> started
> > >> > > > thinking it would be useful to have a really easy way to jump
> start
> > >> a new
> > >> > > > project, so I created a Maven archetype that can be used to
> help get
> > >> > > > started:
> > >> > > >
> > >> > > > https://github.com/bbende/nifi-processor-bundle-archetype
> > >> > > >
> > >> > > > If anyone has any feedback on useful defaults, or best
> practices to
> > >> > > > include, let me know.
> > >> > > >
> > >> > > > If something like this already exists, then I'll chalk this up
> to a
> > >> good
> > >> > > > learning experience since I learned a lot about multi-module
> > >> archetypes
> > >> > > :)
> > >> > > >
> > >> > > > -Bryan
> > >> > >
> > >> > >
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Joey Echeverria
+1 on Adam's comment. Keep the nifi- prefix for released jars, but
it's unnecessary for plugins or archetypes.

-Joey

On Tue, Jan 20, 2015 at 6:54 AM, Adam Taft <[hidden email]> wrote:

> The advantage of naming your artifact with a redundant prefix project name
> (like 'nifi-*') is that if you ever look at a big pile of jars, you can
> somewhat eyeball them and know where they came from. i.e. nifi-utils.jar is
> better than utils.jar, in terms of identifying its source.  Likewise, you
> help avoid jar naming clashes for generically named jars.
>
> I don't believe this matters for the archetype or the maven plugin.  But it
> might be nice for other released artifacts.
>
> On Tue, Jan 20, 2015 at 9:26 AM, Mark Payne <[hidden email]> wrote:
>
>> Bryan,
>> I would forgo the 'nifi-' prefix personally. We go back & forth a bit on
>> this with our artifacts, admittedly. But when you use a Maven archetype
>> you'll be specifying the groupId as well as the artifactId, and since the
>> groupId would be 'org.apache.nifi' I think in this case the 'nifi-' prefix
>> is redundant.
>> Thanks-Mark
>>
>> > Date: Tue, 20 Jan 2015 09:17:23 -0500
>> > Subject: Re: Processor Bundle Archetype
>> > From: [hidden email]
>> > To: [hidden email]
>> > CC: [hidden email]
>> >
>> > Sounds good. Is there any preference on the artifactId?
>> >
>> > I originally called it nifi-processor-bundle-archetype, but maybe
>> > processor-bundle-archetype makes more sense now since it will already be
>> > clear that it is part of NiFi.
>> >
>> > -Bryan.
>> >
>> > On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:
>> >
>> > > I recommend nifi/maven - archetypes.
>> > >
>> > > Thanks Bryan!
>> > > On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
>> > >
>> > >> All,
>> > >> Bryan has done a great job of creating a Maven archetype for creating
>> a
>> > >> processor bundle (processor + nar + parent). I think it will be
>> extremely
>> > >> helpful to have, and Bryan has chosen to contribute the archetype
>> back to
>> > >> the community.
>> > >> The question is where in the source tree does it make sense to put it?
>> > >> I could see putting it directly under nifi/ or nifi/commons but I
>> imagine
>> > >> that there will be more archetypes in the future -- for reporting
>> tasks,
>> > >> for controller services, and perhaps other things.  So maybe we would
>> > >> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes
>> directory.
>> > >> Any thoughts on where best to add this into the source tree?
>> > >> Thanks-Mark
>> > >>
>> > >> Date: Mon, 19 Jan 2015 21:48:26 -0500
>> > >> Subject: Re: Processor Bundle Archetype
>> > >> From: [hidden email]
>> > >> To: [hidden email]
>> > >>
>> > >> Hey Mark,
>> > >>
>> > >> Since it looks like the develop branch is back to having the
>> > >> nar-maven-plugin and nifi as the two top level directories, where
>> would you
>> > >> want to put the archetype? I guess it could be a directory under nifi
>> ?
>> > >>
>> > >> And do you have a preference on the artifactId? In my own repo I
>> called
>> > >> it nifi-processor-bundle-archetype, but I wasn't sure if something
>> else
>> > >> made more sense within the actual NiFi source code.
>> > >>
>> > >> -Bryan
>> > >>
>> > >> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]>
>> wrote:
>> > >>
>> > >>
>> > >>
>> > >> Bryan,
>> > >> That's great - I was hoping you'd go ahead and contribute that back. I
>> > >> think it's best if you create the patch/pull-request so that all of
>> the git
>> > >> patch magic can take affect and show you as the contributor. I think
>> > >> putting it into that new directory with the nar plugin is the way to
>> go,
>> > >> too.
>> > >> I created a ticket that you can submit the patch/PR to:
>> > >> https://issues.apache.org/jira/browse/NIFI-272
>> > >> Many thanks!-Mark
>> > >>
>> > >> Date: Fri, 16 Jan 2015 09:27:09 -0500
>> > >> Subject: Re: Processor Bundle Archetype
>> > >> From: [hidden email]
>> > >> To: [hidden email]
>> > >>
>> > >> Hey Mark,
>> > >> Glad you like the archetype so much! I would love to contribute it to
>> the
>> > >> official codebase. I could probably put together a patch/pull-request
>> over
>> > >> the weekend if that works, or if you are looking to get it in there
>> today,
>> > >> I have no problem with you taking the reigns and doing it. I was
>> looking at
>> > >> the latest code last night and I saw one of Joe W's email about the
>> latest
>> > >> directory structure, so I assume we could put the archetype along
>> side the
>> > >> nar plugin. Let me know what you want to do.
>> > >> -Bryan
>> > >> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]>
>> wrote:
>> > >>
>> > >>
>> > >>
>> > >> Hey Bryan,
>> > >> Sorry, I never did write back. I did look at the documentation that
>> you
>> > >> put together, and it's perfect. Every time I write Processor, I end up
>> > >> copying another index.html and gutting it to look just like this one
>> and
>> > >> then filling in. So nice to not have to do that every time. I
>> appreciate
>> > >> all the work you put into this!
>> > >> Were you interested in putting this into the Apache NiFi codebase? Or
>> did
>> > >> you want to keep it separate?
>> > >> Thanks-Mark
>> > >>
>> > >> > Date: Wed, 7 Jan 2015 20:42:10 -0500
>> > >> > Subject: Re: Processor Bundle Archetype
>> > >> > From: [hidden email]
>> > >> > To: [hidden email]
>> > >> >
>> > >> > Mark,
>> > >> >
>> > >> > Thanks for the feedback! and glad it is useful for you.
>> > >> >
>> > >> > I just made the updates you suggested so you should be able to pull
>> them
>> > >> > down from GitHub.
>> > >> >
>> > >> > If you were thinking of anything different for the documentation
>> stub
>> > >> let
>> > >> > me know. I just took an example that had Uses Attributes, Modifies
>> > >> > Attributes, Properties, and Relationships, and then removed the
>> specific
>> > >> > content.
>> > >> >
>> > >> > -Bryan
>> > >> >
>> > >> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]>
>> > >> wrote:
>> > >> >
>> > >> > > Bryan,
>> > >> > > This is great! I've been meaning to do this for a while... just
>> > >> haven't
>> > >> > > gotten around to it. Very helpful.
>> > >> > > It's done pretty well, too, I would say. I have just a few things
>> I'd
>> > >> > > point out:
>> > >> > > In the Processor implementation, I would avoid
>> the:this.myProperty =
>> > >> > > context.getProperty(MY_PROPERTY).getValue();
>> > >> > > and defining the myProperty variable altogether.
>> > >> > > This approach is not thread-safe, and the context.getProperty()
>> > >> returns
>> > >> > > PropertyValue, which has some nice convenience methods like
>> > >> "asInteger",
>> > >> > > etc.
>> > >> > > In the onTrigger method, the argument names are 'processContext'
>> and
>> > >> > > 'processSession'. I would call these simply 'context' and
>> 'session',
>> > >> as
>> > >> > > it's much easier to type and these are the names that are
>> typically
>> > >> used.
>> > >> > > In the processor's directory you may also want to build a
>> directory
>> > >> > > structure
>> > >> > >
>> > >>
>> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
>> > >> > > with a stubbed out documentation. The Standard Processors all use
>> the
>> > >> same
>> > >> > > documentation.
>> > >> > > Then, in the application, if you right-click on a Processor and
>> click
>> > >> > > "Usage", that's where the information comes from.
>> > >> > > This is very helpful! I will be building this locally so I can
>> start
>> > >> > > making use of it.
>> > >> > >
>> > >> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
>> > >> > > > Subject: Processor Bundle Archetype
>> > >> > > > From: [hidden email]
>> > >> > > > To: [hidden email]
>> > >> > > >
>> > >> > > > After setting up a project to develop some custom processors, I
>> > >> started
>> > >> > > > thinking it would be useful to have a really easy way to jump
>> start
>> > >> a new
>> > >> > > > project, so I created a Maven archetype that can be used to
>> help get
>> > >> > > > started:
>> > >> > > >
>> > >> > > > https://github.com/bbende/nifi-processor-bundle-archetype
>> > >> > > >
>> > >> > > > If anyone has any feedback on useful defaults, or best
>> practices to
>> > >> > > > include, let me know.
>> > >> > > >
>> > >> > > > If something like this already exists, then I'll chalk this up
>> to a
>> > >> good
>> > >> > > > learning experience since I learned a lot about multi-module
>> > >> archetypes
>> > >> > > :)
>> > >> > > >
>> > >> > > > -Bryan
>> > >> > >
>> > >> > >
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >
>>
>>



--
Joey Echeverria
Reply | Threaded
Open this post in threaded view
|

Re: Processor Bundle Archetype

Joe Witt
Adam's comments here are no doubt 100% accurate.  I could before the
release vote do the following:
1) Fix the org.apache.nifi package name (not because it matters but to be
consistent)
2) Change the versioning of nar-maven-plugin to 1.0.0 because truly we do
consider that thing very stable.
3) Go through each artifact we'd put out and clean up their naming to
ensure it is 'nifi-something'.  I agree it is quite annoying not to know
the general provenance of an artifact just by its name.

I suspect I could do all of that rapidly tonight and unless anyone objects
I will do so.  I will then go ahead and re-prepare/stage the releases and
send a real VOTE thread for us to get this thing going.

In the meantime please keep feedback coming on the mechanics of the release
- can you validate it?


Thanks
Joe

On Tue, Jan 20, 2015 at 10:43 AM, Joey Echeverria <[hidden email]> wrote:

> +1 on Adam's comment. Keep the nifi- prefix for released jars, but
> it's unnecessary for plugins or archetypes.
>
> -Joey
>
> On Tue, Jan 20, 2015 at 6:54 AM, Adam Taft <[hidden email]> wrote:
> > The advantage of naming your artifact with a redundant prefix project
> name
> > (like 'nifi-*') is that if you ever look at a big pile of jars, you can
> > somewhat eyeball them and know where they came from. i.e. nifi-utils.jar
> is
> > better than utils.jar, in terms of identifying its source.  Likewise, you
> > help avoid jar naming clashes for generically named jars.
> >
> > I don't believe this matters for the archetype or the maven plugin.  But
> it
> > might be nice for other released artifacts.
> >
> > On Tue, Jan 20, 2015 at 9:26 AM, Mark Payne <[hidden email]>
> wrote:
> >
> >> Bryan,
> >> I would forgo the 'nifi-' prefix personally. We go back & forth a bit on
> >> this with our artifacts, admittedly. But when you use a Maven archetype
> >> you'll be specifying the groupId as well as the artifactId, and since
> the
> >> groupId would be 'org.apache.nifi' I think in this case the 'nifi-'
> prefix
> >> is redundant.
> >> Thanks-Mark
> >>
> >> > Date: Tue, 20 Jan 2015 09:17:23 -0500
> >> > Subject: Re: Processor Bundle Archetype
> >> > From: [hidden email]
> >> > To: [hidden email]
> >> > CC: [hidden email]
> >> >
> >> > Sounds good. Is there any preference on the artifactId?
> >> >
> >> > I originally called it nifi-processor-bundle-archetype, but maybe
> >> > processor-bundle-archetype makes more sense now since it will already
> be
> >> > clear that it is part of NiFi.
> >> >
> >> > -Bryan.
> >> >
> >> > On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:
> >> >
> >> > > I recommend nifi/maven - archetypes.
> >> > >
> >> > > Thanks Bryan!
> >> > > On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
> >> > >
> >> > >> All,
> >> > >> Bryan has done a great job of creating a Maven archetype for
> creating
> >> a
> >> > >> processor bundle (processor + nar + parent). I think it will be
> >> extremely
> >> > >> helpful to have, and Bryan has chosen to contribute the archetype
> >> back to
> >> > >> the community.
> >> > >> The question is where in the source tree does it make sense to put
> it?
> >> > >> I could see putting it directly under nifi/ or nifi/commons but I
> >> imagine
> >> > >> that there will be more archetypes in the future -- for reporting
> >> tasks,
> >> > >> for controller services, and perhaps other things.  So maybe we
> would
> >> > >> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes
> >> directory.
> >> > >> Any thoughts on where best to add this into the source tree?
> >> > >> Thanks-Mark
> >> > >>
> >> > >> Date: Mon, 19 Jan 2015 21:48:26 -0500
> >> > >> Subject: Re: Processor Bundle Archetype
> >> > >> From: [hidden email]
> >> > >> To: [hidden email]
> >> > >>
> >> > >> Hey Mark,
> >> > >>
> >> > >> Since it looks like the develop branch is back to having the
> >> > >> nar-maven-plugin and nifi as the two top level directories, where
> >> would you
> >> > >> want to put the archetype? I guess it could be a directory under
> nifi
> >> ?
> >> > >>
> >> > >> And do you have a preference on the artifactId? In my own repo I
> >> called
> >> > >> it nifi-processor-bundle-archetype, but I wasn't sure if something
> >> else
> >> > >> made more sense within the actual NiFi source code.
> >> > >>
> >> > >> -Bryan
> >> > >>
> >> > >> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]>
> >> wrote:
> >> > >>
> >> > >>
> >> > >>
> >> > >> Bryan,
> >> > >> That's great - I was hoping you'd go ahead and contribute that
> back. I
> >> > >> think it's best if you create the patch/pull-request so that all of
> >> the git
> >> > >> patch magic can take affect and show you as the contributor. I
> think
> >> > >> putting it into that new directory with the nar plugin is the way
> to
> >> go,
> >> > >> too.
> >> > >> I created a ticket that you can submit the patch/PR to:
> >> > >> https://issues.apache.org/jira/browse/NIFI-272
> >> > >> Many thanks!-Mark
> >> > >>
> >> > >> Date: Fri, 16 Jan 2015 09:27:09 -0500
> >> > >> Subject: Re: Processor Bundle Archetype
> >> > >> From: [hidden email]
> >> > >> To: [hidden email]
> >> > >>
> >> > >> Hey Mark,
> >> > >> Glad you like the archetype so much! I would love to contribute it
> to
> >> the
> >> > >> official codebase. I could probably put together a
> patch/pull-request
> >> over
> >> > >> the weekend if that works, or if you are looking to get it in there
> >> today,
> >> > >> I have no problem with you taking the reigns and doing it. I was
> >> looking at
> >> > >> the latest code last night and I saw one of Joe W's email about the
> >> latest
> >> > >> directory structure, so I assume we could put the archetype along
> >> side the
> >> > >> nar plugin. Let me know what you want to do.
> >> > >> -Bryan
> >> > >> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]>
> >> wrote:
> >> > >>
> >> > >>
> >> > >>
> >> > >> Hey Bryan,
> >> > >> Sorry, I never did write back. I did look at the documentation that
> >> you
> >> > >> put together, and it's perfect. Every time I write Processor, I
> end up
> >> > >> copying another index.html and gutting it to look just like this
> one
> >> and
> >> > >> then filling in. So nice to not have to do that every time. I
> >> appreciate
> >> > >> all the work you put into this!
> >> > >> Were you interested in putting this into the Apache NiFi codebase?
> Or
> >> did
> >> > >> you want to keep it separate?
> >> > >> Thanks-Mark
> >> > >>
> >> > >> > Date: Wed, 7 Jan 2015 20:42:10 -0500
> >> > >> > Subject: Re: Processor Bundle Archetype
> >> > >> > From: [hidden email]
> >> > >> > To: [hidden email]
> >> > >> >
> >> > >> > Mark,
> >> > >> >
> >> > >> > Thanks for the feedback! and glad it is useful for you.
> >> > >> >
> >> > >> > I just made the updates you suggested so you should be able to
> pull
> >> them
> >> > >> > down from GitHub.
> >> > >> >
> >> > >> > If you were thinking of anything different for the documentation
> >> stub
> >> > >> let
> >> > >> > me know. I just took an example that had Uses Attributes,
> Modifies
> >> > >> > Attributes, Properties, and Relationships, and then removed the
> >> specific
> >> > >> > content.
> >> > >> >
> >> > >> > -Bryan
> >> > >> >
> >> > >> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]
> >
> >> > >> wrote:
> >> > >> >
> >> > >> > > Bryan,
> >> > >> > > This is great! I've been meaning to do this for a while... just
> >> > >> haven't
> >> > >> > > gotten around to it. Very helpful.
> >> > >> > > It's done pretty well, too, I would say. I have just a few
> things
> >> I'd
> >> > >> > > point out:
> >> > >> > > In the Processor implementation, I would avoid
> >> the:this.myProperty =
> >> > >> > > context.getProperty(MY_PROPERTY).getValue();
> >> > >> > > and defining the myProperty variable altogether.
> >> > >> > > This approach is not thread-safe, and the context.getProperty()
> >> > >> returns
> >> > >> > > PropertyValue, which has some nice convenience methods like
> >> > >> "asInteger",
> >> > >> > > etc.
> >> > >> > > In the onTrigger method, the argument names are
> 'processContext'
> >> and
> >> > >> > > 'processSession'. I would call these simply 'context' and
> >> 'session',
> >> > >> as
> >> > >> > > it's much easier to type and these are the names that are
> >> typically
> >> > >> used.
> >> > >> > > In the processor's directory you may also want to build a
> >> directory
> >> > >> > > structure
> >> > >> > >
> >> > >>
> >>
> of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> >> > >> > > with a stubbed out documentation. The Standard Processors all
> use
> >> the
> >> > >> same
> >> > >> > > documentation.
> >> > >> > > Then, in the application, if you right-click on a Processor and
> >> click
> >> > >> > > "Usage", that's where the information comes from.
> >> > >> > > This is very helpful! I will be building this locally so I can
> >> start
> >> > >> > > making use of it.
> >> > >> > >
> >> > >> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> >> > >> > > > Subject: Processor Bundle Archetype
> >> > >> > > > From: [hidden email]
> >> > >> > > > To: [hidden email]
> >> > >> > > >
> >> > >> > > > After setting up a project to develop some custom
> processors, I
> >> > >> started
> >> > >> > > > thinking it would be useful to have a really easy way to jump
> >> start
> >> > >> a new
> >> > >> > > > project, so I created a Maven archetype that can be used to
> >> help get
> >> > >> > > > started:
> >> > >> > > >
> >> > >> > > > https://github.com/bbende/nifi-processor-bundle-archetype
> >> > >> > > >
> >> > >> > > > If anyone has any feedback on useful defaults, or best
> >> practices to
> >> > >> > > > include, let me know.
> >> > >> > > >
> >> > >> > > > If something like this already exists, then I'll chalk this
> up
> >> to a
> >> > >> good
> >> > >> > > > learning experience since I learned a lot about multi-module
> >> > >> archetypes
> >> > >> > > :)
> >> > >> > > >
> >> > >> > > > -Bryan
> >> > >> > >
> >> > >> > >
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >
> >>
> >>
>
>
>
> --
> Joey Echeverria
>
Reply | Threaded
Open this post in threaded view
|

RE: Processor Bundle Archetype

Mark Payne
Joe,
I uploaded the text file that we build to NIFI-270. This should include the new mapping of all artifacts (where appropriate) to include the 'nifi-' prefix and includes fixing some other naming issues, such as having directories named 'nar' instead of 'nifi-jetty-nar' for instance.
Thanks-Mark

> Date: Tue, 20 Jan 2015 11:11:37 -0500
> Subject: Re: Processor Bundle Archetype
> From: [hidden email]
> To: [hidden email]
>
> Adam's comments here are no doubt 100% accurate.  I could before the
> release vote do the following:
> 1) Fix the org.apache.nifi package name (not because it matters but to be
> consistent)
> 2) Change the versioning of nar-maven-plugin to 1.0.0 because truly we do
> consider that thing very stable.
> 3) Go through each artifact we'd put out and clean up their naming to
> ensure it is 'nifi-something'.  I agree it is quite annoying not to know
> the general provenance of an artifact just by its name.
>
> I suspect I could do all of that rapidly tonight and unless anyone objects
> I will do so.  I will then go ahead and re-prepare/stage the releases and
> send a real VOTE thread for us to get this thing going.
>
> In the meantime please keep feedback coming on the mechanics of the release
> - can you validate it?
>
>
> Thanks
> Joe
>
> On Tue, Jan 20, 2015 at 10:43 AM, Joey Echeverria <[hidden email]> wrote:
>
> > +1 on Adam's comment. Keep the nifi- prefix for released jars, but
> > it's unnecessary for plugins or archetypes.
> >
> > -Joey
> >
> > On Tue, Jan 20, 2015 at 6:54 AM, Adam Taft <[hidden email]> wrote:
> > > The advantage of naming your artifact with a redundant prefix project
> > name
> > > (like 'nifi-*') is that if you ever look at a big pile of jars, you can
> > > somewhat eyeball them and know where they came from. i.e. nifi-utils.jar
> > is
> > > better than utils.jar, in terms of identifying its source.  Likewise, you
> > > help avoid jar naming clashes for generically named jars.
> > >
> > > I don't believe this matters for the archetype or the maven plugin.  But
> > it
> > > might be nice for other released artifacts.
> > >
> > > On Tue, Jan 20, 2015 at 9:26 AM, Mark Payne <[hidden email]>
> > wrote:
> > >
> > >> Bryan,
> > >> I would forgo the 'nifi-' prefix personally. We go back & forth a bit on
> > >> this with our artifacts, admittedly. But when you use a Maven archetype
> > >> you'll be specifying the groupId as well as the artifactId, and since
> > the
> > >> groupId would be 'org.apache.nifi' I think in this case the 'nifi-'
> > prefix
> > >> is redundant.
> > >> Thanks-Mark
> > >>
> > >> > Date: Tue, 20 Jan 2015 09:17:23 -0500
> > >> > Subject: Re: Processor Bundle Archetype
> > >> > From: [hidden email]
> > >> > To: [hidden email]
> > >> > CC: [hidden email]
> > >> >
> > >> > Sounds good. Is there any preference on the artifactId?
> > >> >
> > >> > I originally called it nifi-processor-bundle-archetype, but maybe
> > >> > processor-bundle-archetype makes more sense now since it will already
> > be
> > >> > clear that it is part of NiFi.
> > >> >
> > >> > -Bryan.
> > >> >
> > >> > On Tue, Jan 20, 2015 at 8:45 AM, Joe Witt <[hidden email]> wrote:
> > >> >
> > >> > > I recommend nifi/maven - archetypes.
> > >> > >
> > >> > > Thanks Bryan!
> > >> > > On Jan 20, 2015 8:44 AM, "Mark Payne" <[hidden email]> wrote:
> > >> > >
> > >> > >> All,
> > >> > >> Bryan has done a great job of creating a Maven archetype for
> > creating
> > >> a
> > >> > >> processor bundle (processor + nar + parent). I think it will be
> > >> extremely
> > >> > >> helpful to have, and Bryan has chosen to contribute the archetype
> > >> back to
> > >> > >> the community.
> > >> > >> The question is where in the source tree does it make sense to put
> > it?
> > >> > >> I could see putting it directly under nifi/ or nifi/commons but I
> > >> imagine
> > >> > >> that there will be more archetypes in the future -- for reporting
> > >> tasks,
> > >> > >> for controller services, and perhaps other things.  So maybe we
> > would
> > >> > >> create a nifi/maven-archetypes or a nifi/commons/maven-archetypes
> > >> directory.
> > >> > >> Any thoughts on where best to add this into the source tree?
> > >> > >> Thanks-Mark
> > >> > >>
> > >> > >> Date: Mon, 19 Jan 2015 21:48:26 -0500
> > >> > >> Subject: Re: Processor Bundle Archetype
> > >> > >> From: [hidden email]
> > >> > >> To: [hidden email]
> > >> > >>
> > >> > >> Hey Mark,
> > >> > >>
> > >> > >> Since it looks like the develop branch is back to having the
> > >> > >> nar-maven-plugin and nifi as the two top level directories, where
> > >> would you
> > >> > >> want to put the archetype? I guess it could be a directory under
> > nifi
> > >> ?
> > >> > >>
> > >> > >> And do you have a preference on the artifactId? In my own repo I
> > >> called
> > >> > >> it nifi-processor-bundle-archetype, but I wasn't sure if something
> > >> else
> > >> > >> made more sense within the actual NiFi source code.
> > >> > >>
> > >> > >> -Bryan
> > >> > >>
> > >> > >> On Fri, Jan 16, 2015 at 9:37 AM, Mark Payne <[hidden email]>
> > >> wrote:
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >> Bryan,
> > >> > >> That's great - I was hoping you'd go ahead and contribute that
> > back. I
> > >> > >> think it's best if you create the patch/pull-request so that all of
> > >> the git
> > >> > >> patch magic can take affect and show you as the contributor. I
> > think
> > >> > >> putting it into that new directory with the nar plugin is the way
> > to
> > >> go,
> > >> > >> too.
> > >> > >> I created a ticket that you can submit the patch/PR to:
> > >> > >> https://issues.apache.org/jira/browse/NIFI-272
> > >> > >> Many thanks!-Mark
> > >> > >>
> > >> > >> Date: Fri, 16 Jan 2015 09:27:09 -0500
> > >> > >> Subject: Re: Processor Bundle Archetype
> > >> > >> From: [hidden email]
> > >> > >> To: [hidden email]
> > >> > >>
> > >> > >> Hey Mark,
> > >> > >> Glad you like the archetype so much! I would love to contribute it
> > to
> > >> the
> > >> > >> official codebase. I could probably put together a
> > patch/pull-request
> > >> over
> > >> > >> the weekend if that works, or if you are looking to get it in there
> > >> today,
> > >> > >> I have no problem with you taking the reigns and doing it. I was
> > >> looking at
> > >> > >> the latest code last night and I saw one of Joe W's email about the
> > >> latest
> > >> > >> directory structure, so I assume we could put the archetype along
> > >> side the
> > >> > >> nar plugin. Let me know what you want to do.
> > >> > >> -Bryan
> > >> > >> On Fri, Jan 16, 2015 at 8:45 AM, Mark Payne <[hidden email]>
> > >> wrote:
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >> Hey Bryan,
> > >> > >> Sorry, I never did write back. I did look at the documentation that
> > >> you
> > >> > >> put together, and it's perfect. Every time I write Processor, I
> > end up
> > >> > >> copying another index.html and gutting it to look just like this
> > one
> > >> and
> > >> > >> then filling in. So nice to not have to do that every time. I
> > >> appreciate
> > >> > >> all the work you put into this!
> > >> > >> Were you interested in putting this into the Apache NiFi codebase?
> > Or
> > >> did
> > >> > >> you want to keep it separate?
> > >> > >> Thanks-Mark
> > >> > >>
> > >> > >> > Date: Wed, 7 Jan 2015 20:42:10 -0500
> > >> > >> > Subject: Re: Processor Bundle Archetype
> > >> > >> > From: [hidden email]
> > >> > >> > To: [hidden email]
> > >> > >> >
> > >> > >> > Mark,
> > >> > >> >
> > >> > >> > Thanks for the feedback! and glad it is useful for you.
> > >> > >> >
> > >> > >> > I just made the updates you suggested so you should be able to
> > pull
> > >> them
> > >> > >> > down from GitHub.
> > >> > >> >
> > >> > >> > If you were thinking of anything different for the documentation
> > >> stub
> > >> > >> let
> > >> > >> > me know. I just took an example that had Uses Attributes,
> > Modifies
> > >> > >> > Attributes, Properties, and Relationships, and then removed the
> > >> specific
> > >> > >> > content.
> > >> > >> >
> > >> > >> > -Bryan
> > >> > >> >
> > >> > >> > On Wed, Jan 7, 2015 at 4:34 PM, Mark Payne <[hidden email]
> > >
> > >> > >> wrote:
> > >> > >> >
> > >> > >> > > Bryan,
> > >> > >> > > This is great! I've been meaning to do this for a while... just
> > >> > >> haven't
> > >> > >> > > gotten around to it. Very helpful.
> > >> > >> > > It's done pretty well, too, I would say. I have just a few
> > things
> > >> I'd
> > >> > >> > > point out:
> > >> > >> > > In the Processor implementation, I would avoid
> > >> the:this.myProperty =
> > >> > >> > > context.getProperty(MY_PROPERTY).getValue();
> > >> > >> > > and defining the myProperty variable altogether.
> > >> > >> > > This approach is not thread-safe, and the context.getProperty()
> > >> > >> returns
> > >> > >> > > PropertyValue, which has some nice convenience methods like
> > >> > >> "asInteger",
> > >> > >> > > etc.
> > >> > >> > > In the onTrigger method, the argument names are
> > 'processContext'
> > >> and
> > >> > >> > > 'processSession'. I would call these simply 'context' and
> > >> 'session',
> > >> > >> as
> > >> > >> > > it's much easier to type and these are the names that are
> > >> typically
> > >> > >> used.
> > >> > >> > > In the processor's directory you may also want to build a
> > >> directory
> > >> > >> > > structure
> > >> > >> > >
> > >> > >>
> > >>
> > of:src/main/resources/docs/org.apache.nifi.processors.MyProcessor/index.html
> > >> > >> > > with a stubbed out documentation. The Standard Processors all
> > use
> > >> the
> > >> > >> same
> > >> > >> > > documentation.
> > >> > >> > > Then, in the application, if you right-click on a Processor and
> > >> click
> > >> > >> > > "Usage", that's where the information comes from.
> > >> > >> > > This is very helpful! I will be building this locally so I can
> > >> start
> > >> > >> > > making use of it.
> > >> > >> > >
> > >> > >> > > > Date: Sun, 4 Jan 2015 15:23:56 -0500
> > >> > >> > > > Subject: Processor Bundle Archetype
> > >> > >> > > > From: [hidden email]
> > >> > >> > > > To: [hidden email]
> > >> > >> > > >
> > >> > >> > > > After setting up a project to develop some custom
> > processors, I
> > >> > >> started
> > >> > >> > > > thinking it would be useful to have a really easy way to jump
> > >> start
> > >> > >> a new
> > >> > >> > > > project, so I created a Maven archetype that can be used to
> > >> help get
> > >> > >> > > > started:
> > >> > >> > > >
> > >> > >> > > > https://github.com/bbende/nifi-processor-bundle-archetype
> > >> > >> > > >
> > >> > >> > > > If anyone has any feedback on useful defaults, or best
> > >> practices to
> > >> > >> > > > include, let me know.
> > >> > >> > > >
> > >> > >> > > > If something like this already exists, then I'll chalk this
> > up
> > >> to a
> > >> > >> good
> > >> > >> > > > learning experience since I learned a lot about multi-module
> > >> > >> archetypes
> > >> > >> > > :)
> > >> > >> > > >
> > >> > >> > > > -Bryan
> > >> > >> > >
> > >> > >> > >
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >
> > >>
> > >>
> >
> >
> >
> > --
> > Joey Echeverria
> >