This repository contains the source code for the articles series about MapReduce:
Please clone this directory by doing:
$ git clone https://github.com/rejux/mapreduce-python.git
$ cd mapreduce-python
You now have a copy of the mapreduce-python project on your host.
The content for the part 1 of the series is as follows:
$ ls -l
total 28
drwxr-xr-x 2 xxxxxx xxxxxx 4096 avril 15 08:52 input
-rw-r--r-- 1 xxxxxx xxxxxx 1101 avril 15 08:52 MIT-LICENSE.md
-rw-r--r-- 1 xxxxxx xxxxxx 1041 avril 15 08:52 one_process_MR.py
-rw-r--r-- 1 xxxxxx xxxxxx 2224 avril 15 08:52 README.md
-rw-r--r-- 1 xxxxxx xxxxxx 2436 avril 15 08:52 simple_MR.py
-rw-r--r-- 1 xxxxxx xxxxxx 6267 avril 15 08:52 tools_MR.py
The only prerequisites is the Python interpreter. The code has been run under a Python 3.5.x interpreter; but even a 2.7.x interpreter will suffice.
To run the code, execute the following commands according the part of the series you are currently reading. Remember to confer to the articles that also provide detailed instructions regarding the part you are intested in.
Execute the simple_MR.py program:
$ cd mapreduce-python
$ python simple_MR.py
Execute the one_process_MR.py program:
- from the Pyton REPL:
>>> import sys
>>> sys.argv = ['./input/text.txt']
or
>>> sys.argv = ['./input/sentence.txt']
then
>>> exec(open('one_process_MR.py').read())
- from the command line:
$ cd mapreduce-python
$ python -c "import sys ; sys.argv = ['./input/sentence.txt'] ; exec(open('one_process_MR.py').read())"
or
$ python -c "import sys ; sys.argv = ['./input/text.txt'] ; exec(open('one_process_MR.py').read())"
- Régis Kla, Ph.D. (klaregis@gmail.com) - RegisKlaBlog
This project is licensed under the MIT License - see the MIT-ICENSE.md file for details
See the MapReduce articles series.