nycleaner / code-experience Goto Github PK
View Code? Open in Web Editor NEWThe Programming experience
The Programming experience
1.(http://www.cnblogs.com/porco/p/4642434.html)
假设[1,2,3,4]被分成两个分区,为 分区1([1,2]),分区2([3,4])
首先用seqOp对分区1进行操作:
x=(0,0) y=1 -----> (1,1) #对分区进行第一次seqOp操作时,x为zero value
x=(1,1) y=2 -----> (3,2) #对分区进行的第二次及以后的seqOp操作,x为前一次seqOp的执行结果
同样对分区2进行操作:
x=(0,0) y=3 -----> (3,1)
x=(3,1) y=4 -----> (7,2)
然后用combOp对两个分区seqOp作用后的结果进行操作:
分区1:
x=(0,0) y=(3,2) ------> (3,2) #对第一个分区进行combOp操作时,x为zero value
x=(3,2) y=(7,2) ------> (10,4) #对第二个及以后分区进行combOp操作时,x为前一分区combOp处理后的结果
可以看出,例子实际上即 (rdd.sum(),rdd.count())
aggregate的作用大概是对每个partition应用seqOp操作和combOp操作,然后对这个由各个partitions的结果构成的结果空间再做一次combOp。zeroValue是初值,seqOp输入U和T,U的初值就是zeroValue,T是RDD的element,seqOp对每个element操作的结果作为下一个element的U。combOp的输入是U1,U2,其中U1的初值是zeroValue,U2是各个partitions的输出。
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.