Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-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 4C58A7C1C for ; Tue, 29 Nov 2011 15:54:03 +0000 (UTC) Received: (qmail 58729 invoked by uid 500); 29 Nov 2011 15:54:03 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 58623 invoked by uid 500); 29 Nov 2011 15:54:03 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 58615 invoked by uid 99); 29 Nov 2011 15:54:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2011 15:54:03 +0000 X-ASF-Spam-Status: No, hits=-2001.2 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; Tue, 29 Nov 2011 15:54:02 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ACF16A6B62 for ; Tue, 29 Nov 2011 15:53:41 +0000 (UTC) Date: Tue, 29 Nov 2011 15:53:41 +0000 (UTC) From: "Vyacheslav Zholudev (Commented) (JIRA)" To: dev@avro.apache.org Message-ID: <1165488256.22135.1322582021709.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <530781826.21522.1322561620019.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AVRO-964) Provide clone() method for generated avro-specific objects 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/AVRO-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159322#comment-13159322 ] Vyacheslav Zholudev commented on AVRO-964: ------------------------------------------ Oops, equals(), toString() and hashCode() using SpecificData, but you were referring to GenericData and I made some test also with GenericData. > Provide clone() method for generated avro-specific objects > ---------------------------------------------------------- > > Key: AVRO-964 > URL: https://issues.apache.org/jira/browse/AVRO-964 > Project: Avro > Issue Type: Improvement > Components: java > Affects Versions: 1.7.0 > Reporter: Vyacheslav Zholudev > > It would be great to provide a generated clone() method for avro-specific objects like it is done for equals(), toString() and hashCode() methods. > Due to object re-usage in Hadoop, it is often necessary to clone objects because they have to be processed all together after e.g. Reducer input has been read. > Currently I see two ad-hoc options to deal with it: > 1) Create potentially lots of tedious code to clone objects manually. This method is error-prone, since it's easy to forget cloning of some fields after schema evolution > 2) Use DatumWriter and DatumReader to serialize/deserialize objects. This method works extremely slow (in my experiments 30-40 times slower than method #1. > So neither of methods is sufficiently good, on the other hand adding a generated clone() method should be not that complicated. -- 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