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

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 

org.apache.hadoop.mapred.RecordReader

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:

org.apache.hadoop.mapreduce.RecordReader

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: https://issues.apache.org/jira/browse/GIRAPH-36
>             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: http://www.atlassian.com/software/jira

        

Reply via email to