avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Feature: Clear all fields / Reset all fields to default value on Record template
Date Wed, 07 Jan 2015 20:06:49 GMT
On Tue, Jan 6, 2015 at 1:33 PM, Maulik Gandhi <mmg997@gmail.com> wrote:
> I was wondering if adding a functionality of clearing all fields on Record,
> makes sense or not?
> 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?

These both seem reasonable to me.

The simplest thing to do is to clear the fieldSetFlags.  This could be
done with a method on RecordBuilderBase, something like (untested):

public void reset() {
  Arrays.fill(fieldSetFlags(), false);
}

The builder uses default values for fields that have not been set.

Doug

Mime
View raw message