Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move shortest path and PageRank to bagel.examples

  • Loading branch information...
commit c1104058c6201d5a2b59dff1babcb71523f156fe 1 parent 563c5e7
@ankurdave authored
View
4 ...l/src/main/scala/bagel/ShortestPath.scala → ...n/scala/bagel/examples/ShortestPath.scala
@@ -1,10 +1,11 @@
-package bagel
+package bagel.examples
import spark._
import spark.SparkContext._
import scala.math.min
+import bagel._
import bagel.Pregel._
object ShortestPath {
@@ -80,6 +81,7 @@ object ShortestPath {
}
}
+@serializable
object MinCombiner extends Combiner[SPMessage, Int] {
def createCombiner(msg: SPMessage): Int =
msg.value
View
5 .../main/scala/bagel/WikipediaPageRank.scala → ...la/bagel/examples/WikipediaPageRank.scala
@@ -1,8 +1,9 @@
-package bagel
+package bagel.examples
import spark._
import spark.SparkContext._
+import bagel._
import bagel.Pregel._
import scala.collection.mutable.ArrayBuffer
@@ -75,6 +76,7 @@ object WikipediaPageRank {
}
}
+@serializable
object PRCombiner extends Combiner[PRMessage, Double] {
def createCombiner(msg: PRMessage): Double =
msg.value
@@ -103,6 +105,7 @@ object PRCombiner extends Combiner[PRMessage, Double] {
}
}
+@serializable
object PRNoCombiner extends DefaultCombiner[PRMessage] {
def compute(numVertices: Long, epsilon: Double)(self: PRVertex, messages: Option[ArrayBuffer[PRMessage]], superstep: Int): (PRVertex, Iterable[PRMessage]) =
PRCombiner.compute(numVertices, epsilon)(self, messages match {
Please sign in to comment.
Something went wrong with that request. Please try again.