kv_get_version()

#include <kvstore.h>

const kv_version_t *
kv_get_version(const kv_value_t *value) 

Creates a version structure, which refers to a specific version of a key-value pair. Note that the kv_version_t structure returned by this function is owned by the kv_value_t structure from which is was obtained. As such, you should not explicitly release the version structure returned by this function; it will be automatically released when the value structure is released.

When a key-value pair is initially inserted in the KV Store, and each time it is updated, it is assigned a unique version token. The version is associated with the version portion of the key-value pair. The version is important for two reasons:

Be aware that the system may infrequently assign a new version to a key-value pair; for example, when migrating data for better resource usage. Therefore, when using kv_put_with_options() or kv_delete_with_options(), do not assume that the version will remain constant until it is changed by the application.

Parameters

value

The value parameter is the value structure from which you want to extract version information.

See Also

Key/Value Pair Management Functions