An Embeddable Datastore Engine |
Tweet |
Follow @Vedis |
Vedis C/C++ API Reference - DBM Methods.
Configure the underlying Key/Value (KV) storage engine.
Description
This routine is used to configure the underlying KV storage engine (i.e. Hash, B+Tree, R+Tree, Mem) with various configuration commands.
The second argument to vedis_kv_config() is an integer configuration option that determines what property of the underlying KV engine is to be configured. Subsequent arguments vary depending on the configuration option in the second argument. Here is the list of allowed commands:
Commands
|
Expected Arguments
|
Description
|
VEDIS_KV_CONFIG_HASH_FUNC |
One Argument: unsigend int (*xHash)( const void *pKey, unsigned int nLen ) |
Specify a hash function to be used instead of the built-in hash function. This option accepts a single argument which is a pointer to the client hash function. Note that the built-in hash function (DJB) is recommended for most purposes. |
VEDIS_KV_CONFIG_CMP_FUNC | One Argument: int (*xCmp)( const void *pUserKey, const void *pRecordKey, unsigned int nLen ) |
Specify a comparison function to be used instead of the built-in comparison function. This option accepts a single argument which is a pointer to the client comparison function. Note that the built-in comparison function (Tuned memcmp() implementation) is recommended for most purposes. |
Parameters
pStore |
Vedis datastore handle. |
iOp
|
An integer configuration option that determines what property of the JX9 virtual machine is to be configured. |
Return value
VEDIS_UNKNOWN: Unknown configuration verb.
VEDIS_NOTIMPLEMENTED: The underlying KV storage engine does not implement the xConfig() method.
See also