Rank Product¶
The Rank Product is defined and two scalable
Spark algorithms provided:
* org.dataalgorithms.chapB04.rankproduct.spark.SparkRankProductUsingGroupByKey
* org.dataalgorithms.chapB04.rankproduct.spark.SparkRankProductUsingCombineByKey
Note that the solution using combineByKey() is more efficient than the
solution using groupByKey().
The key for using combineByKey() is to define a basic efficient serializable
data structure C and then provide 3 basic functions (createCombiner(),
mergeValue(), and mergeCombiners()).
public <C> JavaPairRDD<K,C> combineByKey(Function<V,C> createCombiner,
Function2<C,V,C> mergeValue,
Function2<C,C,C> mergeCombiners)
createCombineraccepts a single input valueVand creates an instance ofCmergeValue()accepts two input parameters:VandCand then create a new instance ofCmergeCombiners()accepts two input parameters:C1(of typeC) andC2(of typeC) and then create a new instance ofC(by mergingC1andC2)
O'Reilly Webinar Slides¶
Suggestions¶
Please share your comments/suggestions: mahmoud.parsian@yahoo.com

