Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> DataFileWriter thread safty


+
David Ginzburg 2013-10-09, 11:16
Copy link to this message
-
Re: DataFileWriter thread safty
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 ?
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB