lizhangzhan / pymapreduce Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fdouetteau/pymapreduce
Simple MapReduce implementation in Python, for text file parallel processing
This project forked from fdouetteau/pymapreduce
Simple MapReduce implementation in Python, for text file parallel processing
Py MapReduce ================= Py MapReduce is a simple monoserver implementation of MapReduce in python, using the multiprocessing module. It can be use for instance for quick parallelization of file processing task, e.g. performing operations on each line of a large file. Simple operations (regexp matching etc..) are hard to multithread in python because of the Global Interpreter Lock (http://wiki.python.org/moin/GlobalInterpreterLock). Here multiprocessing can help Sample job (Word Count) ------------ class WC(Job): "Sample Word count parallel implementation" lc = 0 wc = 0 bc = 0 def __init__(self, f): self.file = f def reduce_start(self): self.lc = 0 self.wc = 0 self.bc = 0 def enumerate(self): return enumerate(open(self.file)) def map(self, pos, item): return (pos, (1, len(item.split()), len(item))) def reduce(self, pos, r): (lc, wc, bc) = r self.lc = self.lc + lc self.wc = self.wc + wc self.bc = self.bc + bc def reduce_stop(self): return (self.lc, self.wc, self.bc)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.