kv_create_config()

#include <kvstore.h>

kv_error_t 
kv_create_config(kv_config_t **config,
                 const char *store_name,
                 const char *host,
                 int port) 

Creates a configuration structure to be used with kv_open_store(). You release the resources used by this structure using kv_release_config(), but only if your application encounters an error when kv_open_store()is called or when this function returns an error.

Note that you must identify at least one helper host when you call this function, using the host and port parameters. The helper host is used by the application to locate other nodes in the store. Additional helper hosts can be identified using kv_config_add_host_port().

This function defines default client behavior. All of the defaults that you can configure using this function can be overridden on a per-operation basis using the appropriate parameters to this API's put/get/delete functions.

You can define default store behavior only before opening the store handle; changing these configuration options after open time has no effect on store behavior.

Parameters

  • config

    The config parameter references memory into which a pointer to the allocated configuration structure is copied.

  • store_name

    The store_name parameter is the name of the KV Store. The store name is used to guard against accidental use of the wrong host or port. The store name must consist entirely of upper or lowercase, letters and digits.

  • host

    The host parameter is the network name of a node belonging to the store. The node must be currently active because it is used by the application as a helper host to locate other nodes in the store.

  • port

    The port parameter is the helper host's port number.