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 EB8D0D36C for ; Wed, 25 Jul 2012 22:23:35 +0000 (UTC) Received: (qmail 22890 invoked by uid 500); 25 Jul 2012 22:23:35 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 22830 invoked by uid 500); 25 Jul 2012 22:23:35 -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 22465 invoked by uid 500); 25 Jul 2012 22:23:35 -0000 Delivered-To: apmail-incubator-giraph-dev@incubator.apache.org Received: (qmail 22460 invoked by uid 99); 25 Jul 2012 22:23:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2012 22:23:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 1BF76142823 for ; Wed, 25 Jul 2012 22:23:35 +0000 (UTC) Date: Wed, 25 Jul 2012 22:23:35 +0000 (UTC) From: "Alessandro Presta (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: <174008147.103441.1343255015116.JavaMail.jiratomcat@issues-vm> In-Reply-To: <619944679.24751.1341862415903.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (GIRAPH-244) Vertex API redesign MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GIRAPH-244?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1342= 2683#comment-13422683 ]=20 Alessandro Presta commented on GIRAPH-244: ------------------------------------------ Oh no, that was bad, sorry! It's the auto-import in IDEA, it doesn't unders= tand Munge comments... Thanks a lot for spotting this. I think it's better if we open a separate i= ssue. I'll do it now and assign to you :) =20 > Vertex API redesign > ------------------- > > Key: GIRAPH-244 > URL: https://issues.apache.org/jira/browse/GIRAPH-244 > Project: Giraph > Issue Type: Improvement > Reporter: Alessandro Presta > Assignee: Alessandro Presta > Attachments: 0001-GIRAPH-244-regression-for-non-secure-Hadoop.pat= ch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch,= GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GI= RAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAP= H-244.patch, GIRAPH-244.patch, GIRAPH-244.patch, GIRAPH-244.patch > > > This is an effort to rationalize the Giraph API. I've put together a few = issues that we've talked about lately. I'm focusing on making Giraph develo= pment even more intuitive and less error-prone, and fixing a few potential = sources of bugs. > I'm sorry this is a big patch, but most of those issues are intertwined a= nd I think this might be easier to review and integrate. > Here's an account of the changes: > Vertex API: > - Renamed BasicVertex to Vertex (as I understand, we used to have both an= d then Vertex was removed). > - Switched to Iterables instead of Iterators for both edges and messages.= This makes code more concise for both implementors (no need to call .itera= tor() on collections) and users (can use foreach syntax). See also GIRAPH-2= 21. > - Added SimpleVertex and SimpleMutableVertex classes, where there are no = edge values and the iterable to be implemented is getNeighbors(). We don=E2= =80=99t have multiple inheritance, so the only way I could think of was to = have SimpleVertex extend Vertex, SimpleMutableVertex extend MutableVertex, = and duplicate the code for the edges iterables. > Also, due to type erasure, one still has to deal with Edge objects in Sim= pleMutableVertex#initialize. Overall I think this is still an improvement o= ver the current situation. > - Added id and value field to the base Vertex class. All other classes we= re either writing the same boilerplate again and again, or using primitive = fields and then creating Writables on the fly (inefficient; there was even = a TODO about that). If there are any actually useful customizations here, I= =E2=80=99ve yet to see them. > Also removed redundant =E2=80=9CVertex=E2=80=9D from getters/setters (com= pare vertex.getId() with vertex.getVertexId()). > - Made halt a private field, and added a wakeUp() method to re-activate a= vertex. isHalted()/voteToHalt()/wakeUp() are just more semantically-charge= d getter/setters. > - Renamed number of vertices/edges in graph to getTotalNum*. The previous= naming (getNumEdges) was arguably confusing. If this one sucks too, please= suggest a better one. > - Default implementations of hasEdge(), getEdgeValue(), getNumEdges(), re= adFields(), write(), toString(): the implementor can still optimize when th= ere is a good opportunity. Currently we are duplicating a lot of code (see = GIRAPH-238) and potentially introducing bugs (see GIRAPH-239). > HashMapVertex: > - Switched representation from Map> to Map (GIRAPH-24= 2) > - Only override methods that can be optimized. > EdgeListVertex: > - Switched representation from two sorted lists to one list of Edge= (see GIRAPH-243). Mainly this makes iteration over edges (target id and va= lue) linear instead of O(n log n). Mutations are still slow and should gene= rally be discouraged. > - Only override methods that can be optimized. > Small nits: > - Our code conventions say we should try to avoid abbreviations, so I eli= minated a few (req -> request, msg -> message). > - Unilaterally refer to the endpoint of an edge as targetVertex (before w= e had a mix of destVertex and targetVertex). > - You will notice some rearranged imports. That=E2=80=99s just my IDE try= ing to be helpful (see GIRAPH-230). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira