C API  19.3.0
Oracle NoSQL Database C Client
Store Configuration

Functions

kv_error_t kv_create_config (const char *store_name, const char *host, int port, kv_config_t **configp)
 Creates store configuration to be used with kv_open_store(). More...
 
kv_error_t kv_config_add_host_port (kv_config_t *config, const char *host, int port)
 Adds an additional host and port pair to the store's configuration. Use of additional host:port pairs for store connections is highly recommended in case one host is temporarily unavailable. More...
 
kv_error_t kv_config_set_consistency (kv_config_t *config, kv_consistency_t *consistency)
 Identifies the default consistency policy to be used by the store handle. More...
 
kv_error_t kv_config_set_durability (kv_config_t *config, kv_durability_t durability)
 Identifies the default durability policy to be used by the store handle. More...
 
kv_error_t kv_config_set_request_timeout (kv_config_t *config, kv_timeout_t timeout)
 Configures default request timeout value that are used for when this client performs store data access. More...
 
kv_error_t kv_config_set_iterator_max_results (kv_config_t *config, kv_long_t max_results_num)
 Sets the number of results returned by tableIterator or indexIterator in a single call to the server. This would be the default value for the iteration call configuration. More...
 
kv_error_t kv_config_set_auth_user (kv_config_t *config, const char *user_name)
 Sets the username for authentication to the store. More...
 
kv_error_t kv_config_add_read_zone (kv_config_t *config, const char *read_zone)
 Adds a zone in which nodes must be located if they are to be used for read operations. More...
 
const char * kv_config_get_store_name (const kv_config_t *config)
 Returns the store name from the handle. More...
 
kv_consistency_tkv_config_get_consistency (const kv_config_t *config)
 Returns the consistency policy from the handle. More...
 
kv_durability_t kv_config_get_durability (const kv_config_t *config)
 Returns the durability policy from the handle. More...
 
kv_timeout_t kv_config_get_request_timeout (const kv_config_t *config)
 Returns the request timeout value from the handle. More...
 
kv_long_t kv_config_get_iterator_max_results (const kv_config_t *config)
 Returns the default number of results returned by tableIterator or indexIterator in a single server call. More...
 
kv_int_t kv_config_helper_hosts_size (const kv_config_t *config)
 Returns the number of helper hosts defined in the handle. More...
 
const char * kv_config_get_helper_host (const kv_config_t *config, kv_int_t index)
 Gets a specific helper host and port string where the format is "host:port". More...
 
const char * kv_config_get_auth_user (const kv_config_t *config)
 Gets the username for authentication to the store. More...
 
kv_int_t kv_config_read_zones_size (const kv_config_t *config)
 Gets the number of read zones defined in the handle. More...
 
const char * kv_config_get_read_zone (const kv_config_t *config, kv_int_t index)
 Gets a specific read zone name from the handle. More...
 
void kv_release_config (kv_config_t **configp)
 Releases the resources used by the configuration strucutre. More...
 

Detailed Description

Function Documentation

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

Adds an additional host and port pair to the store's configuration. Use of additional host:port pairs for store connections is highly recommended in case one host is temporarily unavailable.

Parameters
[in]configThe config handle.
[in]hostThe network name of a node belonging to the store, it is copied and stored in the config handle.
[in]portThe port number used by the named host for store connections.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_config_add_read_zone ( kv_config_t config,
const char *  read_zone 
)

Adds a zone in which nodes must be located if they are to be used for read operations.

Parameters
[in]configThe config handle.
[in]read_zoneThe name of the zone used to service read requests, it is copied and stored in the configuration handle.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
const char* kv_config_get_auth_user ( const kv_config_t config)

Gets the username for authentication to the store.

Parameters
[in]configThe config handle.
Returns
the user name or NULL if not set.
kv_consistency_t* kv_config_get_consistency ( const kv_config_t config)

Returns the consistency policy from the handle.

Parameters
[in]configThe config handle.
Returns
the consistency policy, or NULL if not set.
kv_durability_t kv_config_get_durability ( const kv_config_t config)

Returns the durability policy from the handle.

Parameters
[in]configThe config handle.
Returns
the durability policy. Returns the default durability if it has not been explicitly set.
const char* kv_config_get_helper_host ( const kv_config_t config,
kv_int_t  index 
)

Gets a specific helper host and port string where the format is "host:port".

Parameters
[in]configThe config handle.
[in]indexThe index in helper host list.
Returns
the helper host string or NULL if the index is invalid.
kv_long_t kv_config_get_iterator_max_results ( const kv_config_t config)

Returns the default number of results returned by tableIterator or indexIterator in a single server call.

Parameters
[in]configThe config handle.
Returns
The default number of results returned by tableIterator or indexIterator in one single call or 0 if not set.
const char* kv_config_get_read_zone ( const kv_config_t config,
kv_int_t  index 
)

Gets a specific read zone name from the handle.

Parameters
[in]configThe config handle.
[in]indexThe index in the read zone list.
Returns
the read zone name or NULL if the index is invalid.
kv_timeout_t kv_config_get_request_timeout ( const kv_config_t config)

Returns the request timeout value from the handle.

Parameters
[in]configThe config handle.
Returns
The request timeout, or 0 if not set.
const char* kv_config_get_store_name ( const kv_config_t config)

Returns the store name from the handle.

Parameters
[in]configThe config handle.
Returns
the store name.
kv_int_t kv_config_helper_hosts_size ( const kv_config_t config)

Returns the number of helper hosts defined in the handle.

Parameters
[in]configThe config handle.
Returns
the number of helper hosts.
kv_int_t kv_config_read_zones_size ( const kv_config_t config)

Gets the number of read zones defined in the handle.

Parameters
[in]configThe config handle.
Returns
the number of read zones.
kv_error_t kv_config_set_auth_user ( kv_config_t config,
const char *  user_name 
)

Sets the username for authentication to the store.

Parameters
[in]configThe config handle.
[in]user_nameThe username for authentication.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_config_set_consistency ( kv_config_t config,
kv_consistency_t consistency 
)

Identifies the default consistency policy to be used by the store handle.

Parameters
[in]configThe config handle.
[in]consistencyThe consistency policy to be used as the default, it can be created using kv_create_simple_consistency(), kv_create_time_consistency() or kv_create_version_consistency(). It is owned by the config structure and released implicitly when it is released.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_config_set_durability ( kv_config_t config,
kv_durability_t  durability 
)

Identifies the default durability policy to be used by the store handle.

Parameters
[in]configThe config handle.
[in]durabilityThe durability policy to be used as the default.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_config_set_iterator_max_results ( kv_config_t config,
kv_long_t  max_results_num 
)

Sets the number of results returned by tableIterator or indexIterator in a single call to the server. This would be the default value for the iteration call configuration.

Parameters
[in]configThe configuration handle.
[in]max_results_numThe number of results returned by tableIterator or indexIterator in a single server call.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_config_set_request_timeout ( kv_config_t config,
kv_timeout_t  timeout 
)

Configures default request timeout value that are used for when this client performs store data access.

Parameters
[in]configThe config handle.
[in]timeoutThe default request timeout.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_create_config ( const char *  store_name,
const char *  host,
int  port,
kv_config_t **  configp 
)

Creates store configuration to be used with kv_open_store().

Note
User should release the config handle using kv_release_config(), but only if the application encounters an error when kv_open_store() is called.

Default defaults of each configuration parameter:

  • Consistency policy: KV_CONSISTENCY_NONE.
  • Durability policy: KV_DURABILITY_COMMIT_NO_SYNC.
  • Request timeout in milliseconds: 5,000.
  • Max number of iterator results in a single call: 100.
Parameters
[in]store_nameThe name of the KV Store, it is copied and stored in the config handle.
[in]hostThe network name of a node belonging to the store, it is copied and stored in the config handle.
[in]portThe port number used by the named host for store connections.
[out]configpThe output config handle.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
void kv_release_config ( kv_config_t **  configp)

Releases the resources used by the configuration strucutre.

Parameters
[in]configpThe pointer to the config handle to release.