Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro, mail # user - DataFileWriter thread safty


Copy link to this message
-
Re: DataFileWriter thread safty
Doug Cutting 2013-10-09, 23:52
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 <[EMAIL PROTECTED]> 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 ?