[
https://issues.apache.org/jira/browse/GIRAPH-684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13678166#comment-13678166
]
Renato Javier MarroquĂn Mogrovejo commented on GIRAPH-684:
----------------------------------------------------------
I think it would be indeed much cleaner for the user, and I think option number
3 would be the most easy to do. I mean the native type serialization could be
done by Giraph transparently, but other more complex data could/should be done
by users as they know what they want.
Over in Gora we have such way of serialization/deserialization agains Avro data
types. The only problem are data stores which don't support Avro, and we get
headaches for them.
> Improve Writable API
> --------------------
>
> Key: GIRAPH-684
> URL: https://issues.apache.org/jira/browse/GIRAPH-684
> Project: Giraph
> Issue Type: Bug
> Reporter: Nitay Joffe
> Assignee: Nitay Joffe
>
> While working on GIRAPH-683 I realized something: The python code the user
> has to write is fairly cumbersome, because they cant just say setValue(4),
> they have to say setValue(IntWritable(4)). This is incredibly ugly in my
> opinion.
> The problem is that we have a tight coupling between user types and their
> serialization, so the "everything must be Writable" spreads throughout the
> codebase.
> I think we need to change e.g. Vertex<I extends WritableComparable, V extends
> Writable, E extends Writable> to just Vertex<I extends Comparable, V, E>.
> We keep a Map<Class, Serializer> that tells us how to serialize classes. This
> map can be initialized with things we know how to serialize, e.g. Long,
> Double, and String.
> So then the I,V,E,M parameters, in order to get serialized, would need to
> adhere to one of the following:
> 1) Be a type we know how to serialize, e.g. Long.
> 2) Be Writable. The key is we don't _require_ it on the generic parameter,
> but we check if it is and if so we use their code. This makes everything
> backwards compatible.
> 3) The user has registered his own serializer. This lets them serialize
> completely new types, for example a fastutil map, without having to subclass
> that type to make it Writable.
> With this improved API in place, all computation code (and user code in
> general) would be much cleaner and simpler. It will also make things like
> Jython much more intuitive.
--
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