You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Alan Conway <ac...@redhat.com> on 2009/11/27 17:33:58 UTC

[c++] Plugin initialization ordering (was Re: C++: Plugin::initOrder???)

On 11/25/2009 03:42 PM, Steve Huston wrote:
>> On 11/24/2009 08:07 PM, Steve Huston wrote:
>>> A new method was added this week: qpid::Plugin::initOrder()
[snip]
> Could you please document this mechanism and how it should be used
> somewhere?

I've extended the doc comment, is this clear?
      /** 

       * Initialization order. If a plugin does not override this, it 

       * returns DEFAULT_INIT_ORDER. Plugins that need to be initialized 

       * earlier/later than normal can override initOrder to return 

       * a lower/higher value than DEFAULT_INIT_ORDER. 

       */
      QPID_COMMON_EXTERN virtual int initOrder() const;


> The point is that other people develop related pieces and there was no
> discussion, rationale, etc. about it, how it's solving a problem, how
> to use it, etc. The only reason I found out about it was the
> entrypoint wasn't exported so the Windows build broke.

Point taken and apologies again. Lets have the discussion now and if we come up 
with a better solution I'll be happy to implement it. I've opened:

https://issues.apache.org/jira/browse/QPID-2223

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [c++] Plugin initialization ordering (was Re: C++: Plugin::initOrder???)

Posted by Alan Conway <ac...@redhat.com>.
On 11/30/2009 10:52 AM, Andrew Stitcher wrote:
> On Fri, 2009-11-27 at 11:33 -0500, Alan Conway wrote:
>> ...
>> Point taken and apologies again. Lets have the discussion now and if we come up
>> with a better solution I'll be happy to implement it. I've opened:
>>
>> https://issues.apache.org/jira/browse/QPID-2223
>
> One comment I'd make is that the implementation is, how shall I put it,
> unscalable.
>
> Using a vector, and sorting it for every insertion of a plugin, starts
> to be a problem if you have a large number of plugins. Okay, you'd
> probably need many more plugins than we currently have but isn't that
> what we have the set<>  or perhaps map<>  data structures for?
>
> If the sort was run just once after all the plugins have been added it'd
> be fine, but otherwise I'd suggest using a set<>  with a custom "operator
> <".
>

I'd be surprised if anyone ever loaded 1000s or even 100s of plugins, but it 
would be easy to fix if you think that's a real concern.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [c++] Plugin initialization ordering (was Re: C++: Plugin::initOrder???)

Posted by Andrew Stitcher <as...@redhat.com>.
On Fri, 2009-11-27 at 11:33 -0500, Alan Conway wrote:
> ...
> Point taken and apologies again. Lets have the discussion now and if we come up 
> with a better solution I'll be happy to implement it. I've opened:
> 
> https://issues.apache.org/jira/browse/QPID-2223

One comment I'd make is that the implementation is, how shall I put it,
unscalable.

Using a vector, and sorting it for every insertion of a plugin, starts
to be a problem if you have a large number of plugins. Okay, you'd
probably need many more plugins than we currently have but isn't that
what we have the set<> or perhaps map<> data structures for?

If the sort was run just once after all the plugins have been added it'd
be fine, but otherwise I'd suggest using a set<> with a custom "operator
<".

Andrew




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org