Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 94C0817C4D for ; Tue, 6 Jan 2015 22:26:23 +0000 (UTC) Received: (qmail 67888 invoked by uid 500); 6 Jan 2015 22:26:24 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 67808 invoked by uid 500); 6 Jan 2015 22:26:24 -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 67798 invoked by uid 99); 6 Jan 2015 22:26:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 22:26:24 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mmg997@gmail.com designates 209.85.217.181 as permitted sender) Received: from [209.85.217.181] (HELO mail-lb0-f181.google.com) (209.85.217.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2015 22:26:20 +0000 Received: by mail-lb0-f181.google.com with SMTP id l4so143704lbv.12 for ; Tue, 06 Jan 2015 14:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CBnMvrcc/CN9+njPjEumkhSw9icPiOVX4LP6V+XKCDQ=; b=ffSqPLGPAbgnKVG5YMRIPSStD/obEPVSzEw6lTNBXyQWc22ySphnmwM0a8X//I/ua1 79F1VyuyJ4l0EorB29si02vQnzevLXqGCZvdNx4PO19YLYaDBQQ6l53rPD7s8wP906ne imtHOLOi4jK7Q4zce3LJHDdouIVy00SRm3Iq3UqAOpSzbrWV7kWeRpKK54WCl/T5NX+8 T+lZAcClfFHG1kJM1ituk0h8fRoEoLHJRdhO7w2HdshELL9TjPBWJD/uUzYceh7BVnuU XfOiXHDz9OqMMoCfY8qxVhMK9uZ2gwrsvPrkB4NmF+DhgDljOJ0vePTWumT3n+eCKOAg Y2Bg== X-Received: by 10.112.188.201 with SMTP id gc9mr66928417lbc.6.1420583113888; Tue, 06 Jan 2015 14:25:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.127.216 with HTTP; Tue, 6 Jan 2015 14:24:33 -0800 (PST) In-Reply-To: References: From: Maulik Gandhi Date: Tue, 6 Jan 2015 16:24:33 -0600 Message-ID: Subject: Re: Feature: Clear all fields / Reset all fields to default value on Record template To: user Content-Type: multipart/alternative; boundary=001a11c37366e098b1050c0347dc X-Virus-Checked: Checked by ClamAV on apache.org --001a11c37366e098b1050c0347dc Content-Type: text/plain; charset=UTF-8 Sorry if I forgot to mention, I am working with Builder way of creating a Record. Thus taking example of clearing all fields on User example. User.Builder userBuilder = User.newBuilder(); // Step-1: Logic: set fields on userBuilder, potentially emit User object by building it userBuilder.build() // Step-2: Clear the contents on userBuilder, by calling userBuilder.clearAll() (new feature) // Step-3: Go back to Step-1 *Avro Getting Started:* http://avro.apache.org/docs/1.7.7/gettingstartedjava.html#Creating+Users Thanks, - Maulik On Tue, Jan 6, 2015 at 3:33 PM, Maulik Gandhi wrote: > Hello Avro Users, > > Questions: > > 1. I was wondering if adding a functionality of clearing all fields on > Record, makes sense or not? > 2. I was wondering if adding a functionality of reseting all fields to > default value (the default value would be what has been defined in AVDL) on > Record, makes sense or not? > > I did look up through old mail archive list and JIRA queue, but could not > find anything similar, please point me to any documentation or links if I > missed them. > > In order to achieve what I am asking here, my best guess is modifying > existing Record template. Please correct me if I am going on wrong path. > > *Record.vm*: > https://github.com/apache/avro/blob/branch-1.7/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm > > Thanks for your help and awesome work!! > > Thanks, > - Maulik > --001a11c37366e098b1050c0347dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry if I forgot to mention, I am working with Builder wa= y of creating a Record.=C2=A0 Thus taking example of clearing all fields on= User example.

User.Builder userBuilder =3D User.newBuil= der();

// Step-1: Logic: set fields on userBuilder= , potentially emit User object by building it userBuilder.build()
// Step-2: Clear the contents on userBuilder, by calling userBuilder.clear= All() (new feature)
// Step-3: Go back to Step-1

On Tue, Jan 6, 2015 at 3:33 PM, Maulik = Gandhi <mmg997@gmail.com> wrote:
Hello Avro Users,

Questions:=
  1. I was wondering if adding a function= ality of clearing all fields on Record, makes sense or not?
  2. I was wondering if adding a functionality of reseting= all fields to default value (the default value would be what has been defi= ned in AVDL) on Record, makes sense or not?
I did look up throu= gh old mail archive list and JIRA queue, but could not find anything simila= r, please point me to any documentation or links if I missed them.
=
In order to achieve what I am asking here, my best guess is mo= difying existing Record template.=C2=A0 Please correct me if I am going on = wrong path.


Thanks for your help and awesome work= !!

Thanks,
- Maulik

--001a11c37366e098b1050c0347dc--