Return-Path: Delivered-To: apmail-avro-user-archive@www.apache.org Received: (qmail 62628 invoked from network); 9 Aug 2010 21:10:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Aug 2010 21:10:52 -0000 Received: (qmail 43453 invoked by uid 500); 9 Aug 2010 21:10:52 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 43380 invoked by uid 500); 9 Aug 2010 21:10:52 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 43372 invoked by uid 99); 9 Aug 2010 21:10:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 21:10:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [64.78.17.16] (HELO EXHUB018-1.exch018.msoutlookonline.net) (64.78.17.16) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 21:10:44 +0000 Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-1.exch018.msoutlookonline.net ([64.78.17.16]) with mapi; Mon, 9 Aug 2010 14:10:23 -0700 From: Scott Carey To: "user@avro.apache.org" Date: Mon, 9 Aug 2010 14:10:57 -0700 Subject: Re: How to clear data from GenericRecord Thread-Topic: How to clear data from GenericRecord Thread-Index: Acs4B0fXM2IZmWJ4QyyxqOhfJ4Wbtg== Message-ID: <4B0CB0DE-2690-4466-8171-CCB45FCAD80D@richrelevance.com> References: <4C606003.9080100@darose.net> <4C606BD0.6060502@darose.net> In-Reply-To: <4C606BD0.6060502@darose.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Generally they can be re-used without clearing -- the re-use overwrites the= fields.=20 On Aug 9, 2010, at 1:57 PM, David Rosenstrauch wrote: > I suppose that would work. (I'll try it.) >=20 > But I was thinking more along the lines of "rec.clear()". >=20 > DR >=20 > On 08/09/2010 04:54 PM, Yang wrote: >> like this?? >>=20 >> foreach fieldKey >> rec.set(fieldKey, null); >>=20 >> On Mon, Aug 9, 2010 at 1:07 PM, David Rosenstrauch w= rote: >>> There doesn't seem to be any method call available in the API for >>> GenericRecord to completely erase all of its data so that it can be reu= sed. >>>=20 >>> I'm planning to use an Avro GenericRecord (GenericData.Record) inside a >>> Hadoop Reducer, and it would be much better from a memory usage perspec= tive >>> if I could just clear the record's contents at the beginning of every >>> reduce() call, rather than having to instantiate a new one for each cal= l. >>>=20 >>> Any way to make this happen? (And if no, anyone think this is somethin= g >>> important enough that I should file a bug report on this?) >>>=20 >>> Thanks, >>>=20 >>> DR