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 55A07D7EB for ; Wed, 22 Aug 2012 16:46:55 +0000 (UTC) Received: (qmail 12823 invoked by uid 500); 22 Aug 2012 16:46:55 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 12772 invoked by uid 500); 22 Aug 2012 16:46:55 -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 Delivered-To: moderator for dev@giraph.apache.org Received: (qmail 38764 invoked by uid 99); 22 Aug 2012 12:36:45 -0000 Content-Type: multipart/alternative; boundary="===============1050193215551512021==" MIME-Version: 1.0 Subject: Re: Review Request: Move part of the graph out-of-core when memory is low From: "Alessandro Presta" To: "Avery Ching" Cc: "Maja Kabiljo" , "Eli Reisman" , "giraph" , "Alessandro Presta" Date: Wed, 22 Aug 2012 12:36:44 -0000 Message-ID: <20120822123644.15256.12033@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/5987/ X-Sender: "Alessandro Presta" References: <20120822103429.15256.92727@reviews.apache.org> In-Reply-To: <20120822103429.15256.92727@reviews.apache.org> Reply-To: "Alessandro Presta" --===============1050193215551512021== 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/5987/ ----------------------------------------------------------- (Updated Aug. 22, 2012, 12:36 p.m.) Review request for giraph and Avery Ching. Changes ------- Iterate over messages by partition in prepareSuperstep(). Description ------- I gave this another shot. This time it plays nicely with input superstep: I= replaced both the temporary partitions and the worker partition map with a= common data structure, PartitionStore, held in ServerData. This is similar= to what we now have for messages. Partition is now thread-safe so that we can have concurrent calls to putVer= tex(). SimplePartitionStore is backed by a concurrent hash map (nothing new here, = except that we skip copying partitions to the worker). DiskBackedPartitionStore can hold up to a user-defined number of partitions= in memory, and spill the remaining ones to disk. Each partition is stored = in a separate file. Adding vertices to an out-of-core partition consists in appending them to t= he file, which makes processing vertex requests relatively fast. We use a ReadWriteLock for each partition: performing operations on a parti= tion held in memory only requires a read-lock (since Partition is thread-sa= fe), while creating a new partition, moving it in and out of core or append= ing vertices requires a write-lock (we can't have concurrent writes). Also note that this breaks Hadoop RPC: I preferred to keep it clean (this a= lso shows what code we get rid of) instead of working around it. I suppose = the Netty security patch will be completed soon. If not, I will restore RPC= compatibility. More here: https://issues.apache.org/jira/browse/GIRAPH-249?focusedCommentI= d=3D13435280&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:comment= -tabpanel#comment-13435280 This addresses bug GIRAPH-249. https://issues.apache.org/jira/browse/GIRAPH-249 Diffs (updated) ----- http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/bsp/CentralizedServiceWorker.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/BasicRPCCommunications.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/NettyWorkerClientServer.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/NettyWorkerServer.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/SendVertexRequest.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/ServerData.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/comm/WorkerServer.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/BspServiceWorker.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/GiraphJob.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/GraphMapper.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/DiskBackedPartitionStore.java PRE-CREATION = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/HashWorkerPartitioner.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/Partition.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/PartitionStore.java PRE-CREATION = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/SimplePartitionStore.java PRE-CREATION = http://svn.apache.org/repos/asf/giraph/trunk/src/main/java/org/apache/gir= aph/graph/partition/WorkerGraphPartitioner.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/test/java/org/apache/gir= aph/TestMutateGraphVertex.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/test/java/org/apache/gir= aph/comm/ConnectionTest.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/test/java/org/apache/gir= aph/comm/RequestFailureTest.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/test/java/org/apache/gir= aph/comm/RequestTest.java 1375843 = http://svn.apache.org/repos/asf/giraph/trunk/src/test/java/org/apache/gir= aph/graph/partition/TestPartitionStores.java PRE-CREATION = Diff: https://reviews.apache.org/r/5987/diff/ Testing ------- mvn verify and pseudo-distributed mode tests with both SimplePartitionStore= and DiskBackedPartitionStore Thanks, Alessandro Presta --===============1050193215551512021==--