Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // map function returns a tuple of (1, Age)
- edge => edge.sendToDst(1, edge.srcAttr.age.toDouble),
- // reduce function combines (sumOfFollowers, sumOfAge)
- (a, b) => ((a._1 + b._1), (a._2 + b._2))
- ).mapValues((id, p) => p._2 / p._1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement