Return-Path: X-Original-To: apmail-incubator-giraph-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-giraph-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3EEDD74C8 for ; Wed, 21 Dec 2011 07:48:56 +0000 (UTC) Received: (qmail 58691 invoked by uid 500); 21 Dec 2011 07:48:54 -0000 Delivered-To: apmail-incubator-giraph-dev-archive@incubator.apache.org Received: (qmail 58605 invoked by uid 500); 21 Dec 2011 07:48:53 -0000 Mailing-List: contact giraph-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: giraph-dev@incubator.apache.org Delivered-To: mailing list giraph-dev@incubator.apache.org Received: (qmail 58588 invoked by uid 99); 21 Dec 2011 07:48:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2011 07:48:53 +0000 X-ASF-Spam-Status: No, hits=-2002.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2011 07:48:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 44CD911FEEB for ; Wed, 21 Dec 2011 07:48:31 +0000 (UTC) Date: Wed, 21 Dec 2011 07:48:31 +0000 (UTC) From: "Avery Ching (Assigned) (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: <1487854148.34547.1324453711283.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1284112134.34287.1324446810675.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (GIRAPH-113) Change cast to Vertex used in prepareSuperstep() to BasicVertex 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-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Avery Ching reassigned GIRAPH-113: ---------------------------------- Assignee: Yuanyuan Tian (was: Avery Ching) > Change cast to Vertex used in prepareSuperstep() to BasicVertex > --------------------------------------------------------------- > > Key: GIRAPH-113 > URL: https://issues.apache.org/jira/browse/GIRAPH-113 > Project: Giraph > Issue Type: Bug > Reporter: Yuanyuan Tian > Assignee: Yuanyuan Tian > Priority: Minor > Attachments: GIRAPH-113.patch > > > Hi, > I decided to use LongDoubleFloatDoubleVertex in a graph algorithm because it uses more compact and efficient mahout collections. However I run into an error when running the algorithm: > java.lang.ClassCastException: org.apache.giraph.graph.LongDoubleFloatDoubleVertex cannot be cast to org.apache.giraph.graph.Vertex > at org.apache.giraph.comm.BasicRPCCommunications.prepareSuperstep(BasicRPCCommunications.java:1016) > at org.apache.giraph.graph.BspServiceWorker.startSuperstep(BspServiceWorker.java:843) > at org.apache.giraph.graph.GraphMapper.map(GraphMapper.java:569) > at org.apache.giraph.graph.GraphMapper.run(GraphMapper.java:728) > ... 7 more > Basically, the problem is that in BasicRPCCommunications.prepareSuperStep(), the LongDoubleFloatDoubleVertex are cast to Vertex in the following code fragment. But LongDoubleFloatDoubleVertex inherits from BasicVertex instead of Vertex. > if (vertex != null) { > ((MutableVertex) vertex).setVertexId(vertexIndex); > partition.putVertex((Vertex) vertex); > } else if (originalVertex != null) { > partition.removeVertex(originalVertex.getVertexId()); > } > I did a simple change: cast LongDoubleFloatDoubleVertex to BasicVertex. The problem went away, and the algorithm finished without any error. But I am not sure this change has any implication to other parts of the code. So, I hope to get some comments from the Giraph developers. > if (vertex != null) { > ((MutableVertex) vertex).setVertexId(vertexIndex); > partition.putVertex((BasicVertex) vertex); > } else if (originalVertex != null) { > partition.removeVertex(originalVertex.getVertexId()); > } -- 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