smecsia / gawain-examples

Examples of usage the Gawain Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gawain Examples

The set of examples for Gawain Framework.

Multi-node Pi approximation

You can find this example here. To launch the example, you need to do the following:

  1. Clone project:
$ git clone https://github.com/smecsia/gawain-examples && cd gawain-examples
  1. Launch ActiveMQ via docker-compose:
$ docker-compose up
  1. Launch two nodes (in different terminals), indicating the total nodes count (2) and required precision (1000):
$ ./gradlew run -Dargs=pi,node,2,10000
  1. Launch "map" part of map-reduce, indicating the nodes count and the count of numbers in set. This will randomly distribute the input set of numbers between our two nodes using the ActiveMQ queue:
$ ./gradlew run -Dargs=pi,map,2,10000
  1. Launch "reduce" part of map-reduce, indicating the nodes count and the count of numbers in Nilakant set. This will initialize the reduce process on both nodes using the ActiveMQ topic:
$ ./gradlew run -Dargs=pi,reduce,2,20000
  1. You should see something like the following on your screen:
Pi approx is 3.141592653589543306140794660119395....

About

Examples of usage the Gawain Framework


Languages

Language:Groovy 97.7%Language:Shell 2.3%