Ignite Plugin development ...

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

Ignite Plugin development ...

Hi,
Please give us some additional samples (design patterns) in order to develop apache-ignite plugins.
What kind of plugin should I can develop on it (security, compression, communication so.) ?

I documented myself using ignite API and some internet samples (Security Plugin - http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/).

API for plugins is stable?



Thank you all for your great work.
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

myset wrote
Please give us some additional samples (design patterns) in order to develop apache-ignite plugins.
What kind of plugin should I can develop on it (security, compression, communication so.) ?
You should implement plugins if you would like to enhance Ignite public APIs with additional functionality (see GridGain enterprise edition). For example, plugin can be used for adding security or, maybe, data compression.

However, if you need to change the underlying behavior without affecting the public API, you should look at the Ignite SPIs, and provide your own SPI implementation. For example, if you need to change the communication protocol, you can plugin your own version of the Communication SPI.

There are also other pluggable components in Ignite, such as Marshaller, Logger, LifecycleBean, etc. that you can easily customize without implementing plugins or SPIs.

myset wrote
I documented myself using ignite API and some internet samples (Security Plugin - http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/).

API for plugins is stable?
The APIs for plugins are stable. There was a slight change in APIs when we moved from RC3 to the 1.0 release. Starting with 1.0 release, the APIs are stable.

myset wrote
Thank you all for your great work.
Thanks for all your feedback! It really helps us improve the product and provide better experience to our users.
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

Thank you for feedbacks Dmitriy
ash ash
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

This post has NOT been accepted by the mailing list yet.
I tried to get the security plugin to work but Ignite does not seem to pick up the plugin when it starts up.

All I get in the startup log is:
[15:52:49] Configured plugins:
[15:52:49]   ^-- None

I have checked that I'm setting the pluginConfigurations to the class of the plugin but it does not pick it up.

Please could you provide an example of a simple plugin and the necessary cache config so that the plugin gets picked up from the cache config ?

I can perhaps then extend this to implement authentication.

I'm currently stuck on not even having the plugin getting picked up .

thanks.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

ash wrote
I tried to get the security plugin to work but Ignite does not seem to pick up the plugin when it starts up.

All I get in the startup log is:
[15:52:49] Configured plugins:
[15:52:49]   ^-- None

I have checked that I'm setting the pluginConfigurations to the class of the plugin but it does not pick it up.

Please could you provide an example of a simple plugin and the necessary cache config so that the plugin gets picked up from the cache config ?

I can perhaps then extend this to implement authentication.

I'm currently stuck on not even having the plugin getting picked up .

thanks.
Hi,

To activate a plugin you need to create 'META-INF/services/org.apache.ignite.plugin.PluginProvider' file (has to be available on classpath) and list your plugin providers class names there (one full class name per line). For example, if there are two plugins, this file will have two lines, like this:

my.package.MyPluginProvider1
my.package.MyPluginProvider2

Once the provider is listed there, the corresponding plugin will be activated. Note that the plugin configuration is actually optional in this case.

Let me know if this helps.

-Val
ash ash
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

This post has NOT been accepted by the mailing list yet.
I tried this but can not get the plugin to start up.
So I made the folder as you mentioned :
 META-INF/services/org.apache.ignite.plugin.PluginProvider

In there put the line:
org.apache.ignite.examples.computegrid.cluster.WhiteListPluginProvider

The class WhiteListPluginProvider is below and I've implemented two of the Ignite interfaces I think are for the plugins to load up.

I'm using the Cluster example config file example-ignite.xml in the hope that I can start a cluster and see other nodes joining and then authenticate them.
I've imported the code for the ClusterGroupExample and added the META-INF folder to that src tree locally etc.

This is what is in the class WhiteListPluginProvider ( code below).

This is what Im confused about:
1) What interfaces do I need to implement ?
Below I've implemented PluginConfiguration and ginProvider<WhiteListPluginProvider> 

2) Why isnt the plugin getting loaded and then I should get the System.out messages as
on the overridden method onIgniteStart(), I'm printing a message to Sys out.

Please could you have a look at the below and perhaps modify it so atleast the plugin starts and I
get some messgaes in System.out ?

Thanks.


package org.apache.ignite.examples.computegrid.cluster;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.processors.security.GridSecurityProcessor;
import org.apache.ignite.plugin.*;
import org.jetbrains.annotations.Nullable;

import java.io.Serializable;
import java.util.UUID;

public class WhiteListPluginProvider implements PluginConfiguration
        ,PluginProvider<WhiteListPluginProvider> {

    @Override
    public String name() {
        return "WhiteListPluginProvider";
    }

    @Override
    public String version() {
        return "1.0.0";
    }

    @Nullable
    @Override
    public Object createComponent(PluginContext ctx, Class cls) {
        System.out.println("Creating component");
        if (cls.isAssignableFrom(GridSecurityProcessor.class)) {
            return new WhiteListSecurityProcessor();
        } else {
            return null;
        }
    }

    @Override
    public void validateNewNode(ClusterNode var1) throws PluginValidationException{
       System.out.println("NEW Node");
    }

    @Override
    public void onIgniteStop(boolean var1){
        System.out.println("Ignite stopping");
    }

    @Override
    public String copyright() {
        return "Test";
    }


    @Override
    public void initExtensions(PluginContext var1, ExtensionRegistry var2){

    }


    @Override
    public void receiveDiscoveryData(UUID var1, Serializable var2){

    }


    @Override
    public void onIgniteStart() throws IgniteCheckedException {
        System.out.println("Ignite starting");

    }

    @Nullable
    public Serializable provideDiscoveryData(UUID var1) {
     return null;
    }

    public void stop(boolean var1) throws IgniteCheckedException {

    }

    @Override
    public void start(PluginContext var1) throws IgniteCheckedException{
        System.out.println("Starting the local plugin for Authentication");

    }

    @Override
    public IgnitePlugin plugin() {
        System.out.println("****new plugin");
        return new WhiteListNullPlugin();
    }

}
myset myset
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

Hi,

It works for me (I've my own SecurityPlugin) ...

....
[2015-08-26 18:10:25,016][DEBUG][ro.myset.appcore.grid.plugins.security.SecurityPluginProvider:99:plugin] -
[18:10:25] Configured plugins:
[18:10:25]   ^-- SecurityPlugin 1.0
[18:10:25]   ^-- MYSET SOLUTIONS S.R.L.
...


Steps


1. Add a plain text file to META-INF/services/ with filename org.apache.ignite.plugin.PluginProvider
    META-INF/services/org.apache.ignite.plugin.PluginProvider

2. Add following text (your canonical class name without .java) into META-INF/services/org.apache.ignite.plugin.PluginProvider
   
    org.apache.ignite.examples.computegrid.cluster.WhiteListPluginProvider

3. You shoud create your own classes like this:
     public class WhiteListPluginConfiguration implements PluginConfiguration
     ...

    public class WhiteListPluginProvider implements PluginProvider<WhiteListPluginConfiguration>
    ...
    and the rest



ash ash
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

This post has NOT been accepted by the mailing list yet.
Hi.

Thanks - got it working finally :)

[20:35:14] Configured plugins:
[20:35:14]   ^-- WhiteListPluginProvider 1.0.0
[20:35:14]   ^-- @Copyright Testing new plugin

cheers.

On 26 August 2015 at 16:19, myset [via Apache Ignite Users] <[hidden email]> wrote:
Hi,

It works for me (I've my own SecurityPlugin) ...

....
[2015-08-26 18:10:25,016][DEBUG][ro.myset.appcore.grid.plugins.security.SecurityPluginProvider:99:plugin] -
[18:10:25] Configured plugins:
[18:10:25]   ^-- SecurityPlugin 1.0
[18:10:25]   ^-- MYSET SOLUTIONS S.R.L.
...


Steps


1. Add a plain text file to META-INF/services/ with filename org.apache.ignite.plugin.PluginProvider
    META-INF/services/org.apache.ignite.plugin.PluginProvider

2. Add following text (your canonical class name without .java) into META-INF/services/org.apache.ignite.plugin.PluginProvider
   
    org.apache.ignite.examples.computegrid.cluster.WhiteListPluginProvider

3. You shoud create your own classes like this:
     public class WhiteListPluginConfiguration implements PluginConfiguration
     ...

    public class WhiteListPluginProvider implements PluginProvider<WhiteListPluginConfiguration>
    ...
    and the rest






If you reply to this email, your message will be added to the discussion below:
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Plugin-development-tp336p1137.html
To unsubscribe from Ignite Plugin development ..., click here.
NAML

Amit Pundir Amit Pundir
Reply | Threaded
Open this post in threaded view
|

Re: Ignite Plugin development ...

Hi,
I am writing a plugin and have followed the steps mentioned on this
conversation but the plugin is not discovered by Ignite node on start up.

I have created META-INF/services directories on my Ignite *server* node
under the 'libs' directory. I also tried keeping it at the same level as
'libs'.

I am using Ignite 2.0. Could you please tell me how you got it to work.


Thanks



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

Re: Ignite Plugin development ...

Previous example was done with 1.0 . It work also in 2.0.
Be aware of definition within
META-INF/services/org.apache.ignite.plugin.PluginProvider
and implementation itself.

Ex.
#SecurityPluginProvider comment line
ro.myset.appcore.grid.plugins.security.SecurityPluginProvider



Output log...

...
[09:43:43] VM information: Java(TM) SE Runtime Environment 1.8.0_112-b16
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.112-b16
[09:43:44] Configured plugins:
[09:43:44]   ^-- SecurityPlugin 1.0
[09:43:44]   ^-- MYSET SOLUTIONS S.R.L.
[09:43:44]
...



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

Re: Ignite Plugin development ...

Hi, in this examples you have either WhiteListNullPlugin or
WhiteListAuthenticator

    @Override
    public IgnitePlugin plugin() {
        System.out.println("****new plugin");
        return new WhiteListNullPlugin();
    }

    @Override
    public IgnitePlugin plugin() {
        return new WhiteListAuthenticator();
    }

Could you provide example implementation of this WhiteListHullPlugin /
WhiteListAuthenticator class?

Thanks
Michal



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