diff options
author | KeheCAI <caikehe@gmail.com> | 2015-04-25 08:42:38 -0400 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-04-25 08:42:38 -0400 |
commit | cca9905b93483614b330b09b36c6526b551e17dc (patch) | |
tree | 75253b705590fb9ff152ee75ef83969986d2212d /examples/src/main | |
parent | 59b7cfc41b2c06fbfbf6aca16c1619496a8d1d00 (diff) | |
download | spark-cca9905b93483614b330b09b36c6526b551e17dc.tar.gz spark-cca9905b93483614b330b09b36c6526b551e17dc.tar.bz2 spark-cca9905b93483614b330b09b36c6526b551e17dc.zip |
update the deprecated CountMinSketchMonoid function to TopPctCMS function
http://twitter.github.io/algebird/index.html#com.twitter.algebird.legacy.CountMinSketchMonoid$
The CountMinSketchMonoid has been deprecated since 0.8.1. Newer code should use TopPctCMS.monoid().
![image](https://cloud.githubusercontent.com/assets/1327396/7269619/d8b48b92-e8d5-11e4-8902-087f630e6308.png)
Author: KeheCAI <caikehe@gmail.com>
Closes #5629 from caikehe/master and squashes the following commits:
e8aa06f [KeheCAI] update algebird-core to version 0.9.0 from 0.8.1
5653351 [KeheCAI] change scala code style
4c0dfd1 [KeheCAI] update the deprecated CountMinSketchMonoid function to TopPctCMS function
Diffstat (limited to 'examples/src/main')
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdCMS.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdCMS.scala b/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdCMS.scala index 62f49530ed..c10de84a80 100644 --- a/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdCMS.scala +++ b/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdCMS.scala @@ -18,6 +18,7 @@ package org.apache.spark.examples.streaming import com.twitter.algebird._ +import com.twitter.algebird.CMSHasherImplicits._ import org.apache.spark.SparkConf import org.apache.spark.SparkContext._ @@ -67,7 +68,8 @@ object TwitterAlgebirdCMS { val users = stream.map(status => status.getUser.getId) - val cms = new CountMinSketchMonoid(EPS, DELTA, SEED, PERC) + // val cms = new CountMinSketchMonoid(EPS, DELTA, SEED, PERC) + val cms = TopPctCMS.monoid[Long](EPS, DELTA, SEED, PERC) var globalCMS = cms.zero val mm = new MapMonoid[Long, Int]() var globalExact = Map[Long, Int]() |