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

Maja Kabiljo commented on GIRAPH-613:
-------------------------------------

I'm sorry for the confusion. There was ByteArrayVertex (or some similar name) 
which was reusing objects by itself, so we could just extend that class and not 
worry about it. I agree that with VertexEdges patch we should have put 
something that has this functionality, but I wasn't the one reviewing that code 
;-) Anyway, even with that patch as it is, it is possible to reuse all objects, 
just not as easy as it was before (instead of just extending ByteArrayVertex we 
now have to implement readFields method). 

What I'm proposing is inside of ByteArrayPartition, wherever we call 
readFieldsFromByteArrayWithSize, to use another method, where we would replace
{code} writableObject.readFields(extendedDataInput); {code}
with something like
{code}
vertex.getId().readFields(extendedDataInput);
vertex.getValue().readFields(extendedDataInput);
((VertexEdges<I, E>) vertex.getEdges()).readFields(extendedDataInput);
if (extendedDataInput.readBoolean()) {
  vertex.wakeUp();
} else {
  vertex.voteToHalt();
}
{code}
And we'll have to create all those objects inside of 
ByteArrayPartition.initialize. I think this should work, I am not sure is there 
any test which uses ByteArrayPartition, if not you can just try it out on some 
of your applications by setting giraph.partitionClass.
                
> Remove Writable from the interfaces implemented by Vertex
> ---------------------------------------------------------
>
>                 Key: GIRAPH-613
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-613
>             Project: Giraph
>          Issue Type: Improvement
>            Reporter: Claudio Martella
>            Assignee: Claudio Martella
>            Priority: Minor
>         Attachments: GIRAPH-613.diff, NonWritable.diff
>
>
> Currently, Vertex implements Writable, meaning that we depend on the user 
> (except for the default implementation) on the way the graph is serialised 
> and deserialized. This means we cannot do certain optimisations, and the user 
> can actually add additional stuff to Vertex more than Value, Id, Edges and 
> halt state. By removing this possibility (or allowing them to extend a 
> default implementation) we take control of this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to