Return-Path: X-Original-To: apmail-giraph-dev-archive@www.apache.org Delivered-To: apmail-giraph-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0122D14F for ; Thu, 2 Aug 2012 23:44:04 +0000 (UTC) Received: (qmail 14174 invoked by uid 500); 2 Aug 2012 23:44:03 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 14007 invoked by uid 500); 2 Aug 2012 23:44:03 -0000 Mailing-List: contact dev-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@giraph.apache.org Delivered-To: mailing list dev@giraph.apache.org Received: (qmail 13536 invoked by uid 500); 2 Aug 2012 23:44:02 -0000 Delivered-To: apmail-incubator-giraph-dev@incubator.apache.org Received: (qmail 13527 invoked by uid 99); 2 Aug 2012 23:44:02 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2012 23:44:02 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 70D23142851 for ; Thu, 2 Aug 2012 23:44:02 +0000 (UTC) Date: Thu, 2 Aug 2012 23:44:02 +0000 (UTC) From: "Jaeho Shin (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: <839587770.8144.1343951042465.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1501030783.4081.1343888042557.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (GIRAPH-277) Text Vertex Input/Output Format base classes overhaul MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GIRAPH-277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427736#comment-13427736 ] Jaeho Shin commented on GIRAPH-277: ----------------------------------- Thanks Eli. It would be great to entirely eliminate the need of writing I/O code and let users pick from a large collection, but I think that is unlikely if complex data structure is used in the input graph. We can easily exhaust the possible combinations of int, double, Text I/O formats, but Map and List were the types of values and messages mostly in my cases. I admit some parts could look over engineered, and don't really reduce the net amount of code, but the big picture is clearly to make the blanks in the code obvious for users and only ask them to implement what they really need to. I didn't have chance to test these text formats on large scale, but I'm using identically structured format codes for reading and writing Hive tables of >100M rows, ~15GB without problem. The holes user needs to fill in this case are how to get vertex id, value and edge maps from a particular row in the table, instead of a single text line. About the checkstyle xml, I was reluctant to make the change because it might encourage us to abuse suppress comments, but thought it was also silly to blow up the xml itself. I'm in no way a checkstyle expert, and just found [good hints|http://stackoverflow.com/a/4023351/390044] from the web :) > 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