giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eli Reisman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GIRAPH-277) Text Vertex Input/Output Format base classes overhaul
Date Thu, 02 Aug 2012 22:53:04 GMT

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

Eli Reisman commented on GIRAPH-277:
------------------------------------

That was a lot of work, good job. This does need to be made easier, I agree. As far as the
preprocessing, it seems a bit over engineered as it just pushes the parsing work to another
thing the user has to implement, and they still have to place those values, so the net difficulty
does not really change for the IO format author. Adding more generics to this already loaded-up
area of the code does not seem to welcome in the new users either.

The new thinking on IO formats as it was explained to me is that developers should be providing
lots of IO formats, and that users should simply specify an appropriate one at the command
line with -if -of. The benchmark code is the "old way", the examples/ code is more representative
of what I was told we want now, which is you specify IO at the command line, write your vertex
class, and you're done. So if the IO code seems a bit cryptic the way it is (I agree!) its
also not meant to be user-facing anymore, at least not for new users. This also means a really
useful upgrade (some are in the works now) would be to add support for more IO formats (Avro
etc.) and more strongly typed subclasses for the ones we have, thereby presenting the user
with lots of reasons not to write their own IO formats at all. This "new thinking" has also
not been properly documented on the site/wiki.

That said, great work and as long as the record reader plumbing coming out of Hadoop is properly
tested and still happy in these IO formats (have you run jobs with this patch and real chunk
of sample data or just unit tests on mvn?) then this looks great. I'd be happier without the
custom exception and preprocessing stuff, but if others find this useful then good enough
for me.

                
> Text Vertex Input/Output Format base classes overhaul
> -----------------------------------------------------
>
>                 Key: GIRAPH-277
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-277
>             Project: Giraph
>          Issue Type: Improvement
>          Components: examples, lib
>            Reporter: Jaeho Shin
>         Attachments: GIRAPH-277.patch
>
>
> The current way of implementing {{VertexInputFormat}} and {{VertexReader}} had bad smell.
 It required users to understand how these two classes are glued together, and forced similar
codes to be duplicated in every new input format.  (Similarly for the VertexOutputFormat and
VertexWriter.)  Anyone who wants to create a new format should create an underlying record
reader or writer at the right moment and delegate some calls to it, which seemed unnecessary
detail being exposed.  Besides, type parameters had to appear all over every new format code,
which was extremely annoying for both reading existing code and writing a new one.  I was
very frustrated writing my first format code especially when I compared it to writing a new
vertex code.  I thought writing a new input/output format should be as simple as vertex.
> So, I have refactored {{TextVertexInputFormat}} and {{OutputFormat}} into new forms that
have no difference in their interfaces, but remove a lot of burden for subclassing.  Instead
of providing static VertexReader base classes, I made it a non-static inner-class of its format
class, which helps eliminate the repeated code for gluing these two, already tightly coupled
classes.  This has additional advantage of eliminating all the Generics type variables on
the VertexReader side, which makes overall code much more concise.  I added several useful
TextVertexReader base classes that can save efforts for implementing line-oriented formats.
> Please comment if you see my proposed change have any impact on other aspects.  I'm unsure
of how these additional layers of abstraction could affect performance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message