"A simple multi-processing based MapReduce framework"
Project description
A Multi-processing based single-host MapReduce Framework
This is a simple mapreduce framework.
Sample program
from mapreduce import *
def mapper_2(item):
return (item +5)*23 - 1
def reducer_2(accumulated, item):
return accumulated + item
def is_prime(n):
for i in range(2,ceil(sqrt(n))):
if n%i == 0:
return False
return True
if __name__ == "__main__":
workers = 1
N = 150000
print('* map & reduce ')
mr = MapReducer().workers(workers).mapper(mapper_2).reducer(reducer_2,0)
result=mr(range(N))
print(' MR Result :', result)
n=sum([(n +5)*23 - 1 for n in range(N)])
print(' Validation:',n)
History
0.1.0
First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mapreduce-py-0.1.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for mapreduce_py-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca47a85e7aa70113e98b866ae55ad5f7db086a11f144e1e9d2b03b56ecbe865d |
|
MD5 | 971a1ae745b44802d7ea7008703552c4 |
|
BLAKE2b-256 | 12f4ae451c9478c64503d6950e774ab824a785cd472f55fdb98a9b8e900a8144 |