Chapter 3. Building a Grid Computing platform with Rio
Prev | Part I. Getting Started Guide | Next

## Chapter 3. Building a Grid Computing platform with Rio

In this chapter we will learn how to build our own Grid Computing platform allowing us to deploy and execute many jobs on the Grid even ones we will code AFTER the grid has been done. We will also learn how to spread the load among all the nodes of our cluster.

### Note

This chapter is still a work in progress and may not be complete or valid!

## Understanding the architecture

Your Grid Computing platform will be running tasks (or jobs). So let's start by defining the task contract (interface):

    public interface Task extends Entry {
        Entry execute() throws Exception;
    }

As you can see the contract of the `Task` is pretty much basic: a single method called `execute()` which will be run on the nodes of your Grid Computing platform. The method returns an `Entry` object being the result of the task run.

The Grid Computing platform will make use of JavaSpaces (the space). Your tasks (or jobs) will be run by a client which will `write` Task entries in the space and wait for specific `Entry` results. A worker will be waiting for `Task` entries, `take` it, `execute` it, and `write` the result in the space.

In order to ease development of the specific tasks, our specific task will derive from the following `AbstractTask`:

    public class AbstractTask implements Task {
        public String clientID;

        public AbstractTask() {}

        public Entry execute() throws Exception {
            throw new UnsupportedOperationException();
        }
    }

Prev | Up | Next
Development with Spring | Home | Building the generic worker