incubator-giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jake Mannix (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GIRAPH-28) Introduce new primitive-specific MutableVertex subclasses
Date Tue, 13 Sep 2011 04:23:09 GMT

    [ https://issues.apache.org/jira/browse/GIRAPH-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103333#comment-13103333
] 

Jake Mannix commented on GIRAPH-28:
-----------------------------------

Ok, so I went ahead and made a 'straw-man' refactoring branch (on GitHub: https://github.com/jakemannix/giraph/tree/vertex_map_refactor
), removing the getDestEdgeMap() method, and having BasicVertex implement Iterable, as well
as the random-access read method getEdgeValue(targetVertexId).

I got it passing tests, but ran into a few things we may want to consider:

testing for existence of a target vertex is no longer possible: getEdgeValue(targetVertexId)
returns the *value* associated with the edge.  Edges are allowed to have null values and still
denote a connection between the source and target vertex, right?  Maybe we should just have
an Edge<I, E> getEdge(I targetVertexId) method instead?

Secondly, far less importantly, is we need to have getNumOutEdges(), because clients often
want to know the out-degree of the vertex, and they used to call getDestEdgeMap().size().

Thirdly: for the same reason that getEdgeValue() can return superfluous nulls, removeEdge(),
used as a boolean, can trick the caller into thinking there was no connection to the target
(because removeEdge() returned null), but really it's because I was trying to be clever and
return the *value* which could be null.  Having removeEdge() return the actual Edge fixes
this.

I'll open another ticket for this stuff, as patching this patch seems a bit silly.

> Introduce new primitive-specific MutableVertex subclasses
> ---------------------------------------------------------
>
>                 Key: GIRAPH-28
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-28
>             Project: Giraph
>          Issue Type: New Feature
>          Components: graph
>    Affects Versions: 0.70.0
>            Reporter: Jake Mannix
>            Assignee: Jake Mannix
>         Attachments: GIRAPH-28.diff, GIRAPH-28.diff
>
>
> As discussed on the list, MutableVertex<LongWritable,DoubleWritable,FloatWritable,DoubleWritable>
(for example) could be highly optimized in its memory footprint if the vertex and edge data
were held in a form which minimized Java object usage.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message