You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2016/03/02 12:48:29 UTC

spark git commit: [MINOR][STREAMING] Replace deprecated `apply` with `create` in example.

Repository: spark
Updated Branches:
  refs/heads/master b4d096ded -> 366f26d2d


[MINOR][STREAMING] Replace deprecated `apply` with `create` in example.

## What changes were proposed in this pull request?

Twitter Algebird deprecated `apply` in HyperLogLog.scala.
```
deprecated("Use toHLL", since = "0.10.0 / 2015-05")
def apply[T <% Array[Byte]](t: T) = create(t)
```
This PR replace the deprecated usage `apply` with new `create`
according to the upstream change.

## How was this patch tested?
manual.
```
/bin/spark-submit --class org.apache.spark.examples.streaming.TwitterAlgebirdHLL examples/target/scala-2.11/spark-examples-2.0.0-SNAPSHOT-hadoop2.2.0.jar
```

Author: Dongjoon Hyun <do...@apache.org>

Closes #11451 from dongjoon-hyun/replace_deprecated_hll_apply.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/366f26d2
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/366f26d2
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/366f26d2

Branch: refs/heads/master
Commit: 366f26d2da0437aab99fd88b70ca12ae18958451
Parents: b4d096d
Author: Dongjoon Hyun <do...@apache.org>
Authored: Wed Mar 2 11:48:23 2016 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Wed Mar 2 11:48:23 2016 +0000

----------------------------------------------------------------------
 .../org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/366f26d2/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala b/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala
index 0ec6214..6442b2a 100644
--- a/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala
+++ b/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterAlgebirdHLL.scala
@@ -62,7 +62,7 @@ object TwitterAlgebirdHLL {
     var userSet: Set[Long] = Set()
 
     val approxUsers = users.mapPartitions(ids => {
-      ids.map(id => hll(id))
+      ids.map(id => hll.create(id))
     }).reduce(_ + _)
 
     val exactUsers = users.map(id => Set(id)).reduce(_ ++ _)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org