> ...
> 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 <pmgheap....@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

Reply via email to