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 901B09A43 for ; Thu, 7 Jun 2012 16:13:41 +0000 (UTC) Received: (qmail 39895 invoked by uid 500); 7 Jun 2012 16:13:41 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 39819 invoked by uid 500); 7 Jun 2012 16:13:41 -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 39265 invoked by uid 500); 7 Jun 2012 16:13:40 -0000 Delivered-To: apmail-incubator-giraph-dev@incubator.apache.org Received: (qmail 39260 invoked by uid 99); 7 Jun 2012 16:13:40 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 16:13:40 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 81F33142860 for ; Thu, 7 Jun 2012 16:13:40 +0000 (UTC) Date: Thu, 7 Jun 2012 16:13:40 +0000 (UTC) From: "Claudio Martella (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: <57749383.48337.1339085620534.JavaMail.jiratomcat@issues-vm> In-Reply-To: <547455501.43735.1338992243592.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (GIRAPH-202) SimplePageRankVertex and divide by zero 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-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291100#comment-13291100 ] Claudio Martella commented on GIRAPH-202: ----------------------------------------- OH, please don't forget to get it to match the coding style. > SimplePageRankVertex and divide by zero > --------------------------------------- > > Key: GIRAPH-202 > URL: https://issues.apache.org/jira/browse/GIRAPH-202 > Project: Giraph > Issue Type: Bug > Reporter: Paolo Castagna > Priority: Trivial > > Current SimplePageRankVertex implementation might have a problem if there are vertexes with not edges. > This should fix it (if you think it's a problem): > {code:java} > if (getSuperstep() < MAX_SUPERSTEPS) { > long edges = getNumOutEdges(); > - sendMsgToAllEdges( > - new DoubleWritable(getVertexValue().get() / edges)); > + if ( edges > 0 ) { > + sendMsgToAllEdges( > + new DoubleWritable(getVertexValue().get() / edges)); > + } > } else { > voteToHalt(); > } > {code} -- 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