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 Threaded View
Avro >> mail # user >> C API for writing datums


Copy link to this message
-
RE: C API for writing datums
Hi Saptarshi  -

Yes, you should use the "value" API calls described in section 4 (http://avro.apache.org/docs/current/api/c/index.html#_avro_values) of the website, and you should not use the API described in the Examples in the web site.  The examples have not been updated for the new API. However,

If you check out the code, and look in the "tests" directory there are several examples of how to use the value interface.

Specifically, performance.c compares the performance of the value API and the legacy datum API. The tests for the resolved_reader and resolved_writer also show how to use the new value API for schema resolution.

Other tests such as test_avro_984.c and test_avro_1034.c also show schema resolution using the value API, and test_avro_values.c shows how to create each type of avro value.

Cheers,
Vivek

-----Original Message-----
From: Saptarshi Guha [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2012 5:16 PM
To: avro
Subject: C API for writing datums

Hello,

On this website

http://avro.apache.org/docs/current/api/c/index.html#_examples

the example code contains "avro_record". Grepping the source tells me that avro_record is in legacy.h.

So is this example really legacy and I should use the API calls above(i.e. preceding this in the website)?
Regards
Saptarshi
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