You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Andrey Gura <ag...@apache.org> on 2020/02/05 14:35:01 UTC

Explicit plugin providers configuration issue

Anton, Mikhail,

I stumbled upon impossibility to configure plugin with out adding
appropriate class names to org.apache.ignite.plugin.PluginProvider
file and found change where this possibility was added [1].

Thanks a lot for this change. I noticed also that
IgniteConfiguration.setPluginProviders() overrides plugins that
usually will be loaded by ServiceLoader. Is it deliberate decision? It
seems that better approach is using plugins from both sources:
ServiceLoader provided  and user provided via IgniteConfiguration.

WDYT?

[1] https://issues.apache.org/jira/browse/IGNITE-11744

Re: Explicit plugin providers configuration issue

Posted by Andrey Gura <ag...@apache.org>.
> ...
> So I think that we can't mix these two approaches.

Sounds reasonable. Thanks for clarification.

> Also, it's not clear for me -- are there any reasons to continue support
> of the ServiceLoader approach, given the fact that configurations needed
> for a plugin, in this case, are also specified via IgniteConfiguration?

I have two answers )

- No, there are no such reasons in the future (starting from next
major release).
- Yes, there is at least one reason at present - backward compatibility.

> Moreover, why someone should mix those approaches?

Actually mixed approach has the right to exist. But isn't matter.
Anyway, ServiceLoader based approach requires additional plugin
configuration and this is reason for some simplification.

On Wed, Feb 5, 2020 at 8:46 PM Mikhail Petrov <pm...@gmail.com> wrote:
>
> Hi, Andrey.
>
> The approach of setting plugins via IgniteConfiguration provides an
> additional feature to control the order in which plugins will be loaded.
> It's important in the case when several plugins provide different
> implementations of the same GridComponent while providing some other
> unique implementations (now the first found plugin that provides
> required component will be used for its obtaining).
>
> The ServiceLoader approach gives no mentioned above order guarantees.
>
> So I think that we can't mix these two approaches.
>
> Also, it's not clear for me -- are there any reasons to continue support
> of the ServiceLoader approach, given the fact that configurations needed
> for a plugin, in this case, are also specified via IgniteConfiguration?
> Moreover, why someone should mix those approaches?
>
> On 05.02.2020 17:35, Andrey Gura wrote:
> > Anton, Mikhail,
> >
> > I stumbled upon impossibility to configure plugin with out adding
> > appropriate class names to org.apache.ignite.plugin.PluginProvider
> > file and found change where this possibility was added [1].
> >
> > Thanks a lot for this change. I noticed also that
> > IgniteConfiguration.setPluginProviders() overrides plugins that
> > usually will be loaded by ServiceLoader. Is it deliberate decision? It
> > seems that better approach is using plugins from both sources:
> > ServiceLoader provided  and user provided via IgniteConfiguration.
> >
> > WDYT?
> >
> > [1] https://issues.apache.org/jira/browse/IGNITE-11744

Re: Explicit plugin providers configuration issue

Posted by Mikhail Petrov <pm...@gmail.com>.
Hi, Andrey.

The approach of setting plugins via IgniteConfiguration provides an 
additional feature to control the order in which plugins will be loaded.
It's important in the case when several plugins provide different 
implementations of the same GridComponent while providing some other 
unique implementations (now the first found plugin that provides 
required component will be used for its obtaining).

The ServiceLoader approach gives no mentioned above order guarantees.

So I think that we can't mix these two approaches.

Also, it's not clear for me -- are there any reasons to continue support 
of the ServiceLoader approach, given the fact that configurations needed 
for a plugin, in this case, are also specified via IgniteConfiguration?
Moreover, why someone should mix those approaches?

On 05.02.2020 17:35, Andrey Gura wrote:
> Anton, Mikhail,
>
> I stumbled upon impossibility to configure plugin with out adding
> appropriate class names to org.apache.ignite.plugin.PluginProvider
> file and found change where this possibility was added [1].
>
> Thanks a lot for this change. I noticed also that
> IgniteConfiguration.setPluginProviders() overrides plugins that
> usually will be loaded by ServiceLoader. Is it deliberate decision? It
> seems that better approach is using plugins from both sources:
> ServiceLoader provided  and user provided via IgniteConfiguration.
>
> WDYT?
>
> [1] https://issues.apache.org/jira/browse/IGNITE-11744