avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: DataFileWriter thread safty
Date Wed, 09 Oct 2013 23:52:01 GMT
DataFileWriter#append() is not synchronized.  If you have multiple
threads appending to the same file then you must synchronize.  For
example:

  synchronized (writer) { writer.append(value); }

Doug

On Wed, Oct 9, 2013 at 4:16 AM, David Ginzburg <davidg@inner-active.com> wrote:
> Hi,
> I am writing a kafka consumer that persists messages into avro record files.
> The consumer is a threaded application, but it is unclear to me if
> DataFileWriter is thread safe, or I need to add some synchronization
> code when appending messages ?

Mime
View raw message