Uploaded image for project: 'Giraph (Retired)'
  1. Giraph (Retired)
  2. GIRAPH-277

Text Vertex Input/Output Format base classes overhaul

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • examples, lib
    • None

    Description

      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.

      Attachments

        1. GIRAPH-277.patch
          103 kB
          Jaeho Shin
        2. GIRAPH-277-2.patch
          94 kB
          Jaeho Shin
        3. GIRAPH-277-3.patch
          104 kB
          Nitay Joffe
        4. GIRAPH-227-4.patch
          104 kB
          Nitay Joffe
        5. GIRAPH-277-5.patch
          104 kB
          Nitay Joffe

        Activity

          People

            nitay Nitay Joffe
            netj Jaeho Shin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: