kv_avro_raw_to_value()

#include <kvstore.h>

kv_error_t 
kv_avro_raw_to_value(kv_store_t *store,
                     const char *bytes,
                     uint64_t len,
                     const avro_schema_t schema,
                     kv_value_t **value);

Converts (serialize) a raw byte array to a kv_value_t. The schema argument is associated with the value, but no attempt is made to compare the schema to the contents of the array. If the schema does not exist in the store, an error is returned.

Parameters

store

The store parameter is a handle to the store where you want to write the value.

bytes

The bytes parameter is the raw byte array that you want to convert to an kv_value_t.

len

The len parameter is is the size of the byte array.

schema

The schema parameter is the Avro schema associated with the serialized value.

value

The value parameter references memory into which a pointer to the allocated kv_value_t structure is copied. When you are done with this structure, it is your responsibility to free it using kv_release_value().

See Also

Avro Management Functions