You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/03/02 19:15:35 UTC
spark git commit: aggregateMessages example in graphX doc
Repository: spark
Updated Branches:
refs/heads/master 9ce12aaf2 -> e7d8ae444
aggregateMessages example in graphX doc
Examples illustrating difference between legacy mapReduceTriplets usage and aggregateMessages usage has type issues on the reduce for both operators.
Being just an example- changed example to reduce the message String by concatenation. Although non-optimal for performance.
Author: DEBORAH SIEGEL <de...@DEBORAHs-MacBook-Pro.local>
Closes #4853 from d3borah/master and squashes the following commits:
db54173 [DEBORAH SIEGEL] fixed aggregateMessages example in graphX doc
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e7d8ae44
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e7d8ae44
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e7d8ae44
Branch: refs/heads/master
Commit: e7d8ae444fead27fe85a879f2f7a4cfdd8c47b16
Parents: 9ce12aa
Author: DEBORAH SIEGEL <de...@DEBORAHs-MacBook-Pro.local>
Authored: Mon Mar 2 10:15:32 2015 -0800
Committer: Reynold Xin <rx...@databricks.com>
Committed: Mon Mar 2 10:15:32 2015 -0800
----------------------------------------------------------------------
docs/graphx-programming-guide.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/e7d8ae44/docs/graphx-programming-guide.md
----------------------------------------------------------------------
diff --git a/docs/graphx-programming-guide.md b/docs/graphx-programming-guide.md
index 28bdf81..c601d79 100644
--- a/docs/graphx-programming-guide.md
+++ b/docs/graphx-programming-guide.md
@@ -663,7 +663,7 @@ val graph: Graph[Int, Float] = ...
def msgFun(triplet: Triplet[Int, Float]): Iterator[(Int, String)] = {
Iterator((triplet.dstId, "Hi"))
}
-def reduceFun(a: Int, b: Int): Int = a + b
+def reduceFun(a: String, b: String): String = a + " " + b
val result = graph.mapReduceTriplets[String](msgFun, reduceFun)
{% endhighlight %}
@@ -674,7 +674,7 @@ val graph: Graph[Int, Float] = ...
def msgFun(triplet: EdgeContext[Int, Float, String]) {
triplet.sendToDst("Hi")
}
-def reduceFun(a: Int, b: Int): Int = a + b
+def reduceFun(a: String, b: String): String = a + " " + b
val result = graph.aggregateMessages[String](msgFun, reduceFun)
{% endhighlight %}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org