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 A76D9DC05 for ; Tue, 10 Jul 2012 12:50:39 +0000 (UTC) Received: (qmail 20138 invoked by uid 500); 10 Jul 2012 12:50:39 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 19740 invoked by uid 500); 10 Jul 2012 12:50:37 -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 18947 invoked by uid 500); 10 Jul 2012 12:50:36 -0000 Delivered-To: apmail-incubator-giraph-dev@incubator.apache.org Received: (qmail 18935 invoked by uid 99); 10 Jul 2012 12:50:36 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 12:50:36 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 7F7B4141826 for ; Tue, 10 Jul 2012 12:50:35 +0000 (UTC) Date: Tue, 10 Jul 2012 12:50:34 +0000 (UTC) From: "Alessandro Presta (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: <1335791581.28012.1341924635525.JavaMail.jiratomcat@issues-vm> In-Reply-To: <619944679.24751.1341862415903.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (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.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Alessandro Presta updated GIRAPH-244: ------------------------------------- Attachment: GIRAPH-244.patch Forgot a default getEdgeValue in SimpleMutableVertex =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: 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