Jul
01
2008

GridGain at the Tampa JUG

Dmitriy Setrakyan, Founder and Director of Development at GridGain , presented at the Tampa JUG on June 24th, 2008 and showed us just how easy grid computing can be with Java and GridGain. Dmitriy showed the group how to take a simple "Hello World" example and grid enable it within about 10 minutes. Here is my explanation of the demo:

In our Java Class, we create a simple public static void main(String[] args) method that calls a static method named sayHello().

...
public static void sayHello() {
    System.out.println("Hello World");
}

public static void main(String[] args) {
    sayHello();
}
...

Now we can run our class and see "Hello World" printed out. Next we need to "grid-ify" our little application by adding the GridGain dependencies to our project Classpath and by adding a few key lines to our code:

...
@Gridify
public static void sayHello() {
    System.out.println("Hello World");
}

public static void main(String[] args) {
    GridFactory.start();
    try {
        sayHello();
    } finally {
        GridFactory.stop();
    }
}
...

So, we added the @Gridify annotation to our sayHello() method, the GridFactory.start() and GridFactory.stop() lines and a try/finally block to our code. Now, all we have to do is start up a few GridGain nodes (this is done manually by going to GRIDGAIN_HOME/bin/gridgain.bat) and then running our little application. Our application starts it’s own node, GridFactory.start(), and then the sayHello() method will run on one of our running nodes! Pretty simple? Yeah, obviously there is bit more we can dive into other than grid enabling a "Hello World" application, but when Dmitriy did this simple demo at the Tampa JUG, it got me to start playing with GridGain .

Written by R.J. Salicco in: Development |

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Axiomatic IT Incorporated | Aeros Theme | TheBuckmaker.com WordPress Themes