incubator-giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Avery Ching (JIRA)" <>
Subject [jira] [Commented] (GIRAPH-36) Ensure that subclassing BasicVertex is possible by user apps
Date Sat, 17 Sep 2011 23:12:09 GMT


Avery Ching commented on GIRAPH-36:

The reason for the current VertexReader API was to match the old Hadoop RecordReader API and
make it natural for folks to move to vertices instead of keys and values.  The old Hadoop
RecordReader API 


boolean next(K key, V value) throws IOException;

and the current VertexReader API is 

boolean next(MutableVertex<I, V, E, ?> vertex)
    throws IOException, InterruptedException;

That being said, the new Hadoop RecordReader API is different:


boolean nextKeyValue() throws IOException, InterruptedException;
KEYIN getCurrentKey() throws IOException, InterruptedException;
VALUEIN getCurrentValue() throws IOException, InterruptedException;

It's probably easier to follow that (especially regarding your points).  Given it's a user
facing API we should get a few more opinions on it though.  I imagine the change would be
something closer to:

boolean nextVertex() throws IOException, InterruptedException;
BasicVertex<I, V, E, M> getCurrentVertex() throws IOException, InterruptedException;

As far as the questions about BasicVertex and MutableVertex, the general idea would be that
BasicVertex would be a safer interface to use whenever possible.  However, the Vertex class
hierarchy has evolved and I wouldn't mind changing it since it's not really as useful as it
should be.  In general, we should only provide the interfaces necessary for each method to
ensure we (or the users) can't do something stupid.  So probably a(n) (nearly) immutable interface
for storage, one for the user to access their methods, etc...

> Ensure that subclassing BasicVertex is possible by user apps
> ------------------------------------------------------------
>                 Key: GIRAPH-36
>                 URL:
>             Project: Giraph
>          Issue Type: Improvement
>          Components: graph
>    Affects Versions: 0.70.0
>            Reporter: Jake Mannix
>            Assignee: Jake Mannix
>            Priority: Blocker
>             Fix For: 0.70.0
> Original assumptions in Giraph were that all users would subclass Vertex (which extended
MutableVertex extended BasicVertex).  Classes which wish to have application specific data
structures (ie. not a TreeMap<I, Edge<I,E>>) may need to extend either MutableVertex
or BasicVertex.  Unfortunately VertexRange extends ArrayList<Vertex>, and there are
other places where the assumption is that vertex classes are either Vertex, or at least MutableVertex.
> Let's make sure the internal APIs allow for BasicVertex to be the base class.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message