The set of examples for Gawain Framework.
You can find this example here. To launch the example, you need to do the following:
- Clone project:
$ git clone https://github.com/smecsia/gawain-examples && cd gawain-examples
- Launch ActiveMQ via docker-compose:
$ docker-compose up
- Launch two nodes (in different terminals), indicating the total nodes count (2) and required precision (1000):
$ ./gradlew run -Dargs=pi,node,2,10000
- 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
- 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
- You should see something like the following on your screen:
Pi approx is 3.141592653589543306140794660119395....