2.8.1 - Loading Plugin Provider

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

2.8.1 - Loading Plugin Provider

Hi ,

I saw that 'SetPluginConfiguration' in IgniteConfiguration has been
deprecated in 2.8.1:
( IgniteConfiguration javadoc :
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/IgniteConfiguration.html
)
*IgniteConfiguration setPluginConfigurations(PluginConfiguration...
pluginCfgs)*
Deprecated.
Since PluginProviders can be set explicitly via
setPluginProviders(PluginProvider[]) it's preferable to store
PluginConfiguration as a part of PluginProvider.

*IgniteConfiguration setPluginProviders(PluginProvider... pluginProvs)*
Sets plugin providers.


I guess we need to set Plugin Providers instead of setting Plugin
Configuration. The question is
 do we also need to load the plugin provider through the service loader of
the JDK ?
(
https://apacheignite.readme.io/docs/plugins ( Section : Load Plugin Provider
)
)

What is the purpose of doing this ?

regards,
Veena.






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider

This post was updated on .
Hi,
  You don't need to load the the plugin provider through the service loader
of
the JDK in addition to using setPluginProvider.

  It is preferable to use the service loader standalone like in MLPlugin
  see:
https://github.com/apache/ignite/blob/master/modules/ml/src/main/resources/META-INF/services/org.apache.ignite.plugin.PluginProvider

Thanks, Alex




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
VeenaMithare VeenaMithare
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider

Hi Alex,

Thanks for the reply,

1. I noticed that the ml plugin uses getPluginConfigurations which seems to
have been deprecated..

https://github.com/apache/ignite/blob/master/modules/ml/src/main/java/org/apache/ignite/ml/util/plugin/MLPluginProvider.java

Would that mean that the preferred way  to load a PluginProvider is through
setPluginProvider in the latest ignite version  ?

2. Why did the earlier versions of ignite have service loader framework to
load plugins?

regards,
Veena.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider

Veena,
  Per my previous note, the preferred way is to use the service provider as
noted in
  the documentation page: https://apacheignite.readme.io/docs/plugins
 
   That is how the ML and directIO plugins are designed.
  see: https://github.com/apache/ignite/tree/master/modules/ml
  and: https://github.com/apache/ignite/tree/master/modules/direct-io

Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
VeenaMithare VeenaMithare
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider - Conflicting documentation

This post was updated on .
Thanks Alex,

There seems to be two conflicting documentation on loading the plugin
provider :  

1. The first way as shown in this documentation
https://apacheignite.readme.io/docs/plugins :
 uses the Java Service Loader to load the plugin provider . It loads the
plugin configurations through the ignite configuration and hence needs to
use  getPluginConfigurations to get the right configuration for the plugin.
Concern : igniteconfiguration.getPluginConfigurations is deprecated in
2.8.1

2. The second way  : igniteconfiguration.getPluginConfigurations has been
deprecated in 2.8.1 .  The recommended way of sending configuration is by
calling igniteconfiguration.setPluginProvider .

Please note there was no 'setPluginProvider' method in the versions prior to
2.8.1.
(
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/IgniteConfiguration.html#getPluginConfigurations--
)



Concern : 2.8.1 plugin documentation talks about using service loader
framework. https://apacheignite.readme.io/docs/plugins. If we use
setPluginProvider, there is no need to load plugin provider through java
service loader.



Kindly let me know if this is a documentation bug, or a miss in my
understanding,



regards,
Veena.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider - Conflicting documentation

Veena,
   The recommended way is to use the service provider as detailed here:
https://apacheignite.readme.io/docs/plugins 

  Service Provider does not use IgniteConfiguration.getPluginConfiguration
inside of itself.

 Here is a link of the function that does the loading:
https://github.com/apache/ignite/blob/45e525865c6c93b999ab5030d7568add0bde96a2/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java#L1021





Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
VeenaMithare VeenaMithare
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider - Conflicting documentation

Okay.

>>   The recommended way is to use the service provider as detailed here:

How do we pass configuration for the provider in this approach.

regards,
Veena.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: 2.8.1 - Loading Plugin Provider - Conflicting documentation

Hello!

You do this with IgniteConfiguration.setPluginConfiguration().

Regards,
--
Ilya Kasnacheev


вт, 28 июл. 2020 г. в 13:04, VeenaMithare <[hidden email]>:
Okay.

>>   The recommended way is to use the service provider as detailed here:

How do we pass configuration for the provider in this approach.

regards,
Veena.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/