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 3E690F6EB for ; Wed, 27 Mar 2013 18:00:03 +0000 (UTC) Received: (qmail 8316 invoked by uid 500); 27 Mar 2013 18:00:03 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 8248 invoked by uid 500); 27 Mar 2013 18:00: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 8236 invoked by uid 99); 27 Mar 2013 18:00:03 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 18:00:03 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 6B6DD1C10E8; Wed, 27 Mar 2013 18:00:01 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5726800738314286782==" MIME-Version: 1.0 Subject: Re: Review Request: In memory testing framework added From: "Alessandro Presta" To: "giraph" , "Veselin Stoyanov" , "Alessandro Presta" Date: Wed, 27 Mar 2013 18:00:01 -0000 Message-ID: <20130327180001.12538.23760@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Alessandro Presta" X-ReviewGroup: giraph X-ReviewRequest-URL: https://reviews.apache.org/r/10052/ X-Sender: "Alessandro Presta" References: <20130326233048.12538.61635@reviews.apache.org> In-Reply-To: <20130326233048.12538.61635@reviews.apache.org> Reply-To: "Alessandro Presta" --===============5726800738314286782== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/10052/#review18427 ----------------------------------------------------------- Looking good. See inline comments. Further suggestions for eliminating the intermediate map storage: - the internal storage for TestGraph will be a Map - addVertex(I, V) will add a Vertex with the given id and value and no edge= s, using the GiraphClasses instance - addVertex(I, V, Iterable>) will add a Vertex with the given ed= ges - addEdge(I, I, E) will add an edge from the first vertex to the second ver= tex, with the given edge value; if the source vertex doesn't exist, it will= be created - TestGraph will implement Iterable instead of Iterable - an additional getVertex(I) method will be used for random access - the InMemoryVertexInputFormat will simply pass references to the already-= created vertices - no output format is needed; run() will return the same TestGraph instance giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java I would probably rename this class to InMemoryVertexInputFormat and cha= nge the comment to "An input format that reads the input graph in memory. U= sed for unit tests." or something like that. giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java Can you move this method down, close to setConf()? giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java Missing a newline. giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java Style: we prefer more explicit/verbose naming here. i -> id v -> value es -> edges giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java Extra newline. giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java is -> inputSplit c - > context giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java I would rename this to something like idIterator. giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.java c -> context giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexOutput.java InMemoryVertexOutputFormat? giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexOutput.java Extra newline. giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexOutput.java Can't you use the ImmutableOutputCommitter here? giraph-core/src/main/java/org/apache/giraph/utils/TestGraph.java Maps.newHashMap() is more compact. This applies to pretty much all collections here (Lists.newArrayList() = and so on). giraph-core/src/main/java/org/apache/giraph/utils/TestGraph.java neighbours -> edges giraph-core/src/main/java/org/apache/giraph/utils/TestGraph.java "Iterator over the edges for a given vertex id" - Alessandro Presta On March 26, 2013, 11:30 p.m., Veselin Stoyanov wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/10052/ > ----------------------------------------------------------- > = > (Updated March 26, 2013, 11:30 p.m.) > = > = > Review request for giraph. > = > = > Description > ------- > = > A framework for running small test graphs in memory. > = > = > Diffs > ----- > = > giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexInput.j= ava PRE-CREATION = > giraph-core/src/main/java/org/apache/giraph/utils/InMemoryVertexOutput.= java PRE-CREATION = > giraph-core/src/main/java/org/apache/giraph/utils/InternalVertexRunner.= java 7e0b955998a5f1890912819fa2ca74fbbf46fedd = > giraph-core/src/main/java/org/apache/giraph/utils/TestGraph.java PRE-CR= EATION = > giraph-examples/src/test/java/org/apache/giraph/examples/ConnectedCompo= nentsVertexTestInMemory.java PRE-CREATION = > = > Diff: https://reviews.apache.org/r/10052/diff/ > = > = > Testing > ------- > = > = > Thanks, > = > Veselin Stoyanov > = > --===============5726800738314286782==--