Guys, I also added aggregateGlobalValue,
aggregateGlobalValueUsingLocalEdges, and pickRandomVertex   primitives and
their tests. These are syntactic sugars over map reducing over the vertices.

The last primitive is formSupervertices, which I'll send this afternoon.
Then my primitives are done and I can start implementing the algorithms.

Thanks,

semih


On Thu, Jan 23, 2014 at 5:29 PM, Semih Salihoglu <semih@stanford.edu> wrote:

> I added two more primitives and their tests. They're two very similar
> primitives, updateSelfUsingAnotherVertex, and updateAnotherVertexUsingSelf.
>  Appears in matching algorithms as well as algorithms that contain a
> pointer jumping phase, such as Boruvka's minimum spanning tree algorithm,
> METIS, or multi-level clustering algorithms.
>
> The only two primitives left is formSupervertices and
> aggregateGlobalValue, the latter is simply a MapReduce operation on the
> vertices (possibly using local edges) with a single reducer. Basically
> imitates what aggregators of Pregel does.
>
>
> On Thu, Jan 23, 2014 at 8:36 AM, Semih Salihoglu <semih@stanford.edu>wrote:
>
>> Done.
>>
>>
>> On Wed, Jan 22, 2014 at 1:21 PM, Ankur Dave <notifications@github.com>wrote:
>>
>>> In graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala:
>>>
>>> > +   * @param edgeDirection the direction along which to collect
>>> > +   * the local edges of vertices
>>> > +   *
>>> > +   * @return the local edges for each vertex
>>> > +   */
>>> > +  def collectEdges(edgeDirection: EdgeDirection): VertexRDD[Array[Edge[ED]]] = {
>>> > +    graph.mapReduceTriplets[Array[Edge[ED]]](
>>> > +      edge => {
>>> > +        val msgToSrc = (edge.srcId, Array(new Edge(edge.srcId, edge.dstId, edge.attr)))
>>> > +        val msgToDst = (edge.dstId, Array(new Edge(edge.srcId, edge.dstId, edge.attr)))
>>> > +        edgeDirection match {
>>> > +          case EdgeDirection.Either => Iterator(msgToSrc, msgToDst)
>>> > +          case EdgeDirection.In => Iterator(msgToDst)
>>> > +          case EdgeDirection.Out => Iterator(msgToSrc)
>>> > +          case EdgeDirection.Both =>
>>> > +            throw new SparkException("collectLocalEdges does not support EdgeDirection.Both. Use" +
>>>
>>> collectLocalEdges -> collectEdges
>>>
>>> —
>>> Reply to this email directly or view it on GitHub<https://github.com/apache/incubator-spark/pull/457/files#r9092644>
>>> .
>>>
>>
>>
>