52 #if defined(__cplusplus) 111 #define KV_DURABILITY_COMMIT_NO_SYNC \ 112 (KV_SYNC_NONE | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16)) 118 #define KV_DURABILITY_COMMIT_SYNC \ 119 (KV_SYNC_FLUSH | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16)) 125 #define KV_DURABILITY_COMMIT_WRITE_NO_SYNC \ 126 (KV_SYNC_WRITE_NO_SYNC | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16)) 329 #define KV_ANONYMOUS "[]" 427 const char *host,
int port,
533 kv_durability_t durability);
546 kv_timeout_t timeout);
561 kv_long_t max_results_num);
585 const char *read_zone);
716 const char *kvclient_path_to_jar,
731 kv_long_t max_results_num);
746 kv_int_t max_concurrent_requests);
761 kv_int_t max_results_batches);
777 kv_timeout_t timeout_ms);
795 kv_int_t max_opened_iterators);
808 kv_int_t num_threads);
827 kv_int_t max_active_requests,
828 kv_int_t request_threshold_percent,
829 kv_int_t node_limit_percent);
845 kv_timeout_t read_timeout,
846 kv_timeout_t request_timeout,
847 kv_timeout_t socket_open_timeout);
862 const char *security_property_file);
941 kv_int_t *max_active_requests,
942 kv_int_t *request_threshold_percent,
943 kv_int_t *node_limit_percent);
956 kv_timeout_t *read_timeout,
957 kv_timeout_t *request_timeout,
958 kv_timeout_t *socket_open_timeout);
1012 const char *table_name,
1036 const char *table_name,
1039 kv_return_row_version_enum choice,
1062 const char *table_name,
1088 const char *table_name,
1091 kv_return_row_version_enum choice,
1113 const char *table_name,
1137 const char *table_name,
1140 kv_return_row_version_enum choice,
1165 const char *table_name,
1193 const char *table_name,
1197 kv_return_row_version_enum choice,
1217 const char *table_name,
1238 const char *table_name,
1258 const char * table_name,
1282 const char * table_name,
1285 kv_return_row_version_enum choice,
1305 const char * table_name,
1331 const char * table_name,
1335 kv_return_row_version_enum choice,
1382 const char *table_name,
1384 kv_boolean_t keyonly,
1386 const char **included_tables,
1415 const char *table_name,
1418 const char **included_tables,
1463 const char *table_name,
1465 kv_boolean_t keyonly,
1467 const char **included_tables,
1468 kv_direction_enum direction,
1470 kv_long_t max_results,
1514 const char *table_name,
1516 kv_boolean_t keyonly,
1518 const char **included_tables,
1519 kv_direction_enum direction,
1521 kv_long_t max_results,
1566 const char *table_name,
1567 const char *index_name,
1569 kv_boolean_t keyonly,
1571 const char **included_tables,
1572 kv_direction_enum direction,
1574 kv_long_t batch_size,
1678 const char *statement,
1747 const char *statement,
1848 const char *table_name,
1850 kv_return_row_version_enum choice,
1851 kv_boolean_t abort_on_failure);
1870 const char *table_name,
1872 kv_return_row_version_enum choice,
1873 kv_boolean_t abort_on_failure);
1891 const char *table_name,
1893 kv_return_row_version_enum choice,
1894 kv_boolean_t abort_on_failure);
1912 const char *table_name,
1915 kv_return_row_version_enum choice,
1916 kv_boolean_t abort_on_failure);
1933 const char *table_name,
1935 kv_return_row_version_enum choice,
1936 kv_boolean_t abort_on_failure);
1956 const char *table_name,
1959 kv_return_row_version_enum choice,
1960 kv_boolean_t abort_on_failure);
2269 kv_timeout_t timeout_ms,
2288 kv_timeout_t timeout_ms,
2345 kv_boolean_t start_inclusive,
2347 kv_boolean_t end_inclusive,
2382 kv_long_t timeout_ms,
2412 kv_long_t timeout_ms,
2508 kv_boolean_t value);
2542 const unsigned char *bytes,
2563 const unsigned char *bytes,
2772 unsigned char **bytes,
2877 kv_double_t *value);
2894 kv_boolean_t *value);
2911 const char **value);
2927 const unsigned char **bytes,
3156 const unsigned char *bytes,
3175 const unsigned char *bytes,
3270 kv_boolean_t value);
3304 const unsigned char *bytes,
3325 const unsigned char *bytes,
3449 kv_double_t *value);
3465 kv_boolean_t *value);
3479 const unsigned char **bytes,
3496 const char **value);
3621 kv_boolean_t value);
3657 const unsigned char *bytes,
3678 const unsigned char *bytes,
3819 kv_double_t *value);
3836 kv_boolean_t *value);
3852 const char **value);
3866 const unsigned char **bytes,
3992 kv_boolean_t value);
4027 const unsigned char *bytes,
4049 const unsigned char *bytes,
4176 kv_double_t *value);
4193 kv_boolean_t *value);
4210 const char **value);
4225 const unsigned char **bytes,
4343 kv_timeout_t timeout_ms,
4362 kv_boolean_t may_interrupt_if_running);
4630 #if defined(__cplusplus) Definition: kvstore.h:175
kv_error_t kv_field_as_boolean(const kv_field_t *field, kv_boolean_t *value)
Returns a boolean value for the specified field value.
kv_error_t kv_array_get_float(const kv_array_t *array, kv_int_t index, kv_float_t *value)
Returns a float value from an array.
kv_error_t kv_map_get_string(const kv_map_t *map, const char *name, const char **value)
Returns a string for a named field in a map.
kv_error_t kv_map_get_record(const kv_map_t *map, const char *name, kv_record_t **value)
Returns a nested record for a named field in a map.
kv_row_t * kv_create_row()
Creates and initializes a row structure.
kv_error_t kv_row_get_bytes(const kv_row_t *row, const char *name, const unsigned char **bytes, kv_int_t *size)
Returns the byte value of the named field in a row.
Definition: kvstore.h:236
Definition: kvstore.h:218
kv_error_t kv_array_get_bytes(const kv_array_t *array, kv_int_t index, const unsigned char **bytes, kv_int_t *size)
Returns a byte array value from an array.
Definition: kvstore.h:148
Definition: kvstore.h:177
Definition: kvstore.h:154
kv_error_t kv_copy_row(const kv_row_t *from, kv_row_t **to)
Copies a row structure.
kv_array_t * kv_row_put_sized_array(kv_row_t *row, const char *name, kv_int_t size)
Creates an array with initial size for the named field.
kv_error_t kv_field_as_record(const kv_field_t *field, kv_record_t **value)
Returns a record value handle for the specified field value.
kv_array_t * kv_record_put_sized_array(kv_record_t *record, const char *name, kv_int_t size)
Creates a nested array with an initial size for the named field.
kv_error_t kv_row_put_double(kv_row_t *row, const char *name, kv_double_t value)
Sets a double value for the named field.
kv_error_t kv_row_set_ttl_of_hours(kv_row_t *row, kv_long_t hours)
Sets time to live (TTL) using a period of hours for the row. If not set, the table default value will...
Definition: kvstore.h:146
kv_error_t kv_row_set_ttl_of_days(kv_row_t *row, kv_long_t days)
Sets time to live (TTL) using a period of days for the row. If not set, the table default value will ...
kv_boolean_t kv_statement_result_is_successful(const kv_statement_result_t *result)
Identifies if the statement has finished and was successful.
kv_array_t * kv_map_put_sized_array(kv_map_t *map, const char *name, kv_int_t size)
Creates a nested array with initial size for the named field.
void kv_set_debug_output(kv_output_func func)
Definition: kvstore.h:206
kv_error_t kv_field_as_bytes(const kv_field_t *field, unsigned char **bytes, kv_int_t *size)
Returns a byte value for the specified field value.
Definition: kvstore.h:138
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.
kv_error_t kv_array_append_bytes_copy(kv_array_t *array, const unsigned char *bytes, kv_int_t size)
Appends a byte array value to an array.
kv_error_t kv_refresh_tables(kv_store_t *store)
Refreshes cached information about the tables. This method is required before using any tables that h...
kv_error_t kv_map_get_long(const kv_map_t *map, const char *name, kv_long_t *value)
Returns a long for a named field in a map.
kv_error_t kv_create_proxy_config(const char *kvproxy_path_to_jar, const char *kvclient_path_to_jar, kv_proxy_config_t **configp)
Creates a proxy configuration handle to be used with kv_open_store_with_proxy().
const char * kv_driver_package_version()
void kv_release_execution_id(kv_execution_id_t **idp)
Releases the resource used by execution id.
kv_error_t kv_field_as_long(const kv_field_t *field, kv_long_t *value)
Returns a long value for the specified field value.
kv_error_t kv_create_table_put_if_version_op(kv_operations_t *operations, const char *table_name, const kv_row_t *row, const kv_version_t *if_version, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a putIfVersion operation.
kv_sync_policy_enum kv_get_durability_replica_sync(kv_durability_t durability)
Returns the sync policy in use by the replicas for the given durability policy.
kv_array_t * kv_array_add_sized_array(kv_array_t *array, kv_int_t index, kv_int_t size)
Creates a nested array with initial size and inserts it at the specified position in an array...
struct future_impl kv_future_t
Definition: kvstore.h:277
kv_error_t kv_create_table_delete_op(kv_operations_t *operations, const char *table_name, const kv_row_t *key, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a delete operation.
Definition: kvstore.h:210
kv_error_t kv_record_get_float(const kv_record_t *record, const char *name, kv_float_t *value)
Returns a float for a named field in a record.
kv_error_t kv_open_store_with_proxy(kv_store_t **storep, const char *host, int port, const kv_config_t *config, const kv_proxy_config_t *proxy_config)
Opens a KV Store handle. This call will implicitly start a local proxy server using the specified hos...
kv_error_t kv_map_put_boolean(kv_map_t *map, const char *name, kv_boolean_t value)
Sets a boolean value for the named field.
kv_error_t kv_map_get_double(const kv_map_t *map, const char *name, kv_double_t *value)
Returns a double for a named field in a map.
kv_error_t kv_array_add_int(kv_array_t *array, kv_int_t index, kv_int_t value)
Inserts an int value at the specified position in an array.
kv_boolean_t
Definition: kvstore.h:226
void kv_release_field_range(kv_field_range_t **rangep)
Releases the resources used by the field range handle.
Definition: kvstore.h:155
kv_error_t kv_table_execute(kv_store_t *store, const char *statement, kv_future_t **futurep)
Asynchronously executes a table statement.
kv_durability_t kv_config_get_durability(const kv_config_t *config)
Returns the durability policy from the handle.
Definition: kvstore.h:150
Definition: kvstore.h:286
struct hashmap_impl kv_map_t
Definition: kvstore.h:317
kv_field_t ** kv_row_get_fields(const kv_row_t *row, kv_int_t *num)
Returns all field values of the given row handle.
kv_error_t kv_create_field_range(const char *field_name, const char *start, kv_boolean_t start_inclusive, const char *end, kv_boolean_t end_inclusive, kv_field_range_t **rangep)
Creates a range of values to be used in a table or index iteration or multiGet operation.
kv_error_t kv_proxy_config_set_iterator_max_results_batches(kv_proxy_config_t *config, kv_int_t max_results_batches)
Sets the maximum number of results batches that can be held in the proxy per iterator. Default value is 0 that will be set automatically based on the max-concurrent-requests.
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.
kv_error_t kv_field_as_float(const kv_field_t *field, kv_float_t *value)
Returns a float value for the specified field value.
kv_error_t kv_array_add_float(kv_array_t *array, kv_int_t index, kv_float_t value)
Inserts a float value at the specified position in an array.
kv_error_t kv_array_append_bytes(kv_array_t *array, const unsigned char *bytes, kv_int_t size)
Appends a byte array value to an array.
kv_error_t kv_get_future(kv_store_t *store, const kv_execution_id_t *id, kv_future_t **futurep)
Constructs a future handle using the execution id.
kv_error_t kv_record_get_boolean(const kv_record_t *record, const char *name, kv_boolean_t *value)
Returns a boolean for a named field in a record.
void kv_proxy_config_get_timeouts(const kv_proxy_config_t *config, kv_timeout_t *read_timeout, kv_timeout_t *request_timeout, kv_timeout_t *socket_open_timeout)
Returns various timeout values from the handle.
kv_error_t kv_proxy_config_set_max_open_iterators(kv_proxy_config_t *config, kv_int_t max_opened_iterators)
Sets the number for the maximum number of open iterators in a connection. Because the proxy maintains...
kv_long_t kv_row_get_ttl_value(const kv_row_t *row)
Gets the numeric duration associated with the row. -1 indicates that the row's TTL is not set...
kv_int_t kv_operations_size(const kv_operations_t *operations)
Returns the number of operation in the operations sequence.
void kv_release_row(kv_row_t **rowp)
Releases the resources used by the row structure.
kv_error_t kv_record_get_map(const kv_record_t *record, const char *name, kv_map_t **value)
Returns a nested map for a named field in a record.
kv_error_t kv_record_put_bytes_copy(kv_record_t *record, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
Definition: kvstore.h:147
Definition: kvstore.h:190
kv_error_t kv_row_set_use_table_ttl(kv_row_t *row, kv_boolean_t flag)
Sets whether to use table default TTL during update. If the flag is KV_TRUE and the operation updates...
kv_error_t kv_table_iterator(kv_store_t *store, const char *table_name, const kv_row_t *key, kv_boolean_t keyonly, const kv_field_range_t *range, const char **included_tables, kv_direction_enum direction, const kv_read_options_t *options, kv_long_t max_results, kv_iterator_t **iteratorp)
Returns an iterator over the rows associated with a primary key.
kv_error_t kv_row_get_int(const kv_row_t *row, const char *name, kv_int_t *value)
Returns an int value for the named field in a row.
kv_record_t * kv_record_put_record(kv_record_t *record, const char *name)
Creates a nested record structure for the given record value.
kv_int_t kv_config_read_zones_size(const kv_config_t *config)
Gets the number of read zones defined in the handle.
Definition: kvstore.h:178
Definition: kvstore.h:203
kv_error_t kv_table_get_with_options(kv_store_t *store, const char *table_name, const kv_row_t *key, const kv_read_options_t *options, kv_result_t **resultp)
Returns a row associated with the primary key from a table using options.
struct iterator_impl kv_iterator_t
Definition: kvstore.h:265
Definition: kvstore.h:145
kv_boolean_t kv_statement_result_is_cancelled(const kv_statement_result_t *result)
Identifies if the statement has been cancelled, this is the equivalent of kv_future_is_cancelled().
kv_error_t kv_table_put_if_present(kv_store_t *store, const char *table_name, const kv_row_t *row, kv_version_t **new_version)
Puts a row to a table but only if the row already exists.
kv_error_t kv_table_multi_get(kv_store_t *store, const char *table_name, const kv_row_t *key, kv_boolean_t keyonly, const kv_field_range_t *range, const char **included_tables, const kv_read_options_t *options, kv_iterator_t **iteratorp)
Returns the rows associated with a partial primary key. The range argument can be used to further lim...
struct hashmap_impl kv_record_t
Definition: kvstore.h:320
kv_error_t kv_array_add_string(kv_array_t *array, kv_int_t index, const char *value)
Inserts a string value at the specified position in an array.
void kv_release_proxy_config(kv_proxy_config_t **configp)
Releases the resources used by the proxy configuration handle.
struct field_impl kv_field_t
Definition: kvstore.h:299
kv_error_t kv_record_put_string(kv_record_t *record, const char *name, const char *value)
Sets a string value for the named field.
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".
kv_direction_enum
Definition: kvstore.h:165
Definition: kvstore.h:219
kv_boolean_t kv_future_is_done(kv_future_t *future)
Returns KV_TRUE if the operation has been terminated.
struct proxy_config_impl kv_proxy_config_t
Definition: kvstore.h:259
kv_boolean_t kv_operation_get_abort_on_failure(const kv_operations_t *operations, kv_int_t index)
Returns whether a failure for the identified operation causes the entire sequence of operations to fa...
kv_version_t * kv_result_get_version(const kv_result_t *result)
Returns the version from the result handle.
kv_timeout_t kv_config_get_request_timeout(const kv_config_t *config)
Returns the request timeout value from the handle.
kv_error_t kv_record_get_int(const kv_record_t *record, const char *name, kv_int_t *value)
Returns a int for a named field in a record.
kv_error_t kv_array_append_boolean(kv_array_t *array, kv_boolean_t value)
Appends a boolean value to an array.
kv_error_t kv_row_get_record(const kv_row_t *row, const char *name, kv_record_t **value)
Returns the record value handle for the named field in a row.
kv_int_t kv_statement_result_get_plan_id(const kv_statement_result_t *result)
Returns the administrative plan id for this operation if the operation was a create or remove table...
kv_error_t kv_record_put_bytes(kv_record_t *record, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
const char * kv_proxy_config_get_sec_prop_file(const kv_proxy_config_t *config)
Gets the security property file that located on the proxy server.
Definition: kvstore.h:151
kv_error_t kv_create_simple_consistency(kv_consistency_enum type, kv_consistency_t **consistencyp)
Creates a consistency guarantee used for read operations.
kv_field_type_enum
Definition: kvstore.h:144
Definition: kvstore.h:152
kv_array_t * kv_row_put_array(kv_row_t *row, const char *name)
Creates an array for the named field.
Definition: kvstore.h:215
kv_error_t kv_array_append_string(kv_array_t *array, const char *value)
Appends a string value to an array.
kv_error_t kv_future_get(kv_future_t *future, const kv_statement_result_t **resultp)
Block until the command represented by this future completes.
struct operations_impl kv_operations_t
Definition: kvstore.h:293
Definition: kvstore.h:192
kv_error_t kv_config_set_auth_user(kv_config_t *config, const char *user_name)
Sets the username for authentication to the store.
const char * kv_get_last_error(const kv_store_t *store)
Definition: kvstore.h:194
Definition: kvstore.h:209
Definition: kvstore.h:195
kv_error_t kv_array_get_string(const kv_array_t *array, kv_int_t index, const char **value)
Returns a string value from an array.
kv_row_t * kv_result_get_row(const kv_result_t *result)
Returns the row from the result handle.
kv_error_t kv_record_get_record(const kv_record_t *record, const char *name, kv_record_t **value)
Returns a nested record for a named field in a record.
kv_field_t * kv_map_get_field(const kv_map_t *map, const char *name)
Returns a field value for a named field in a map.
Definition: kvstore.h:153
kv_error_t kv_field_as_map(const kv_field_t *field, kv_map_t **value)
Returns a map value handle for the specified field value.
kv_error_t kv_proxy_config_set_iterator_max_concurrent_requests(kv_proxy_config_t *config, kv_int_t max_concurrent_requests)
Sets the maximum number of concurrent requests per iterator. Default value is the number of available...
kv_error_t kv_record_put_long(kv_record_t *record, const char *name, kv_long_t value)
Sets a long value for the named field.
kv_error_t kv_array_append_float(kv_array_t *array, kv_float_t value)
Appends a float value to an array.
Definition: kvstore.h:235
kv_record_t * kv_array_append_record(kv_array_t *array)
Creates a nested record structure and appends it an array.
kv_error_t kv_proxy_config_set_request_limits(kv_proxy_config_t *config, kv_int_t max_active_requests, kv_int_t request_threshold_percent, kv_int_t node_limit_percent)
Configures the maximum number of requests that this client can have active for a node in the KVStore...
int kv_int_t
Definition: kvstore.h:240
kv_error_t kv_create_write_options(kv_durability_t durability, kv_long_t timeout_ms, kv_write_options_t **optionsp)
Creates and initializes a write options structure to be used for write operations.
Definition: kvstore.h:179
Definition: kvstore.h:200
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.
kv_error_t kv_array_get_record(const kv_array_t *array, kv_int_t index, kv_record_t **value)
Returns a nested record value from an array.
const char * kv_statement_result_get_result(const kv_statement_result_t *result)
Returns a text result if the statement result is text and the operation was successful, otherwise returns NULL.
kv_error_t kv_create_table_put_if_absent_op(kv_operations_t *operations, const char *table_name, const kv_row_t *row, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a putIfAbsent operation.
Definition: kvstore.h:213
const kv_result_t * kv_iterator_get_result(kv_iterator_t *iterator)
Returns the result at the iterator's current position.
kv_long_t kv_proxy_config_get_iterator_max_results(const kv_proxy_config_t *config)
Returns the number of results returned by tableIterator or indexIterator in a single server call...
kv_result_t * kv_table_operation_results_get(const kv_operation_results_t *results, kv_int_t index)
Returns the results of the specified operation.
Definition: kvstore.h:180
kv_error_t kv_map_get_int(const kv_map_t *map, const char *name, kv_int_t *value)
Returns an int for a named field in a map.
kv_int_t kv_proxy_config_get_iterator_max_concurrent_requests(const kv_proxy_config_t *config)
Returns the maximum number of concurrent requests per iterator.
kv_error_t kv_record_get_array(const kv_record_t *record, const char *name, kv_array_t **value)
Returns a nested array for a named field in a record.
void kv_release_future(kv_future_t **futurep)
Releases the resource used by future structure.
kv_error_t kv_table_get(kv_store_t *store, const char *table_name, const kv_row_t *key, kv_row_t **rowp)
Returns a row associated with the primary key from a table, it uses the store's default consistency p...
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 acces...
kv_boolean_t kv_row_get_use_table_ttl(const kv_row_t *row)
Gets whether to use table default TTL during update. Returns KV_TRUE if the absolute expiration time ...
struct operation_results_impl kv_operation_results_t
Definition: kvstore.h:296
kv_operation_enum
Definition: kvstore.h:174
kv_error_t kv_create_table_put_op(kv_operations_t *operations, const char *table_name, const kv_row_t *row, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a put operation.
kv_int_t kv_config_helper_hosts_size(const kv_config_t *config)
Returns the number of helper hosts defined in the handle.
Definition: kvstore.h:207
kv_error_t kv_create_table_delete_if_version_op(kv_operations_t *operations, const char *table_name, const kv_row_t *key, const kv_version_t *if_version, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a deleteIfVersion operation.
kv_error_t kv_table_put(kv_store_t *store, const char *table_name, const kv_row_t *row, kv_version_t **new_version)
Puts a row into a table, overwriting any existing row.
kv_error_t kv_map_put_long(kv_map_t *map, const char *name, kv_long_t value)
Sets a long value for the named field.
kv_error_t kv_array_add_bytes_copy(kv_array_t *array, kv_int_t index, const unsigned char *bytes, kv_int_t size)
Inserts a byte array at the specified position in an array.
kv_error_t kv_create_read_options(const kv_consistency_t *consistency, kv_long_t timeout_ms, kv_read_options_t **optionsp)
Creates and initializes a read options structure to be used for read operations.
kv_int_t kv_table_delete_if_version_with_options(kv_store_t *store, const char *table_name, const kv_row_t *key, const kv_version_t *if_version, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Deletes a row from a table but only if its version matches the one specified in if_version using opti...
Definition: kvstore.h:227
const char * kv_statement_result_get_error_message(const kv_statement_result_t *result)
Returns a description of the problem if the execution is failed.
kv_error_t kv_map_put_null(kv_map_t *map, const char *name)
Sets a NULL value for the named field.
kv_boolean_t kv_future_is_cancelled(kv_future_t *future)
Returns KV_TRUE if the operation was cancelled. The cancellation may still be in progress, and the operation may still be running.
kv_error_t kv_field_as_array(const kv_field_t *field, kv_array_t **value)
Returns an array value handle for the specified field value.
kv_error_t kv_future_get_execution_id(kv_future_t *future, kv_execution_id_t **idp)
Serializes the future handle.
long long kv_timeout_t
Definition: kvstore.h:248
kv_version_t * kv_result_get_prev_row_version(const kv_result_t *result)
Returns the version of previous row from the result handle.
kv_error_t kv_table_put_if_absent(kv_store_t *store, const char *table_name, const kv_row_t *row, kv_version_t **new_version)
Puts a row to a table but only if the row does not exist.
Definition: kvstore.h:205
long long kv_long_t
Definition: kvstore.h:242
kv_int_t kv_array_get_size(const kv_array_t *array)
Returns the number of element in an array value.
kv_error_t kv_table_put_with_options(kv_store_t *store, const char *table_name, const kv_row_t *row, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Puts a row to a table using options, overwriting any existing row.
kv_error_t kv_field_as_int(const kv_field_t *field, kv_int_t *value)
Returns an int value for the specified field value.
int kv_durability_t
Definition: kvstore.h:250
kv_sync_policy_enum kv_get_durability_master_sync(kv_durability_t durability)
Returns the sync policy in use by the Master for the given durability policy.
kv_sync_policy_enum
Definition: kvstore.h:83
kv_error_t kv_row_get_boolean(const kv_row_t *row, const char *name, kv_boolean_t *value)
Returns a boolean value for the named field in a row.
kv_error_t kv_map_get_float(const kv_map_t *map, const char *name, kv_float_t *value)
Returns a float for a named field in a map.
kv_row_t * kv_result_get_index_key(const kv_result_t *result)
Returns the index key from the result handle.
kv_record_t * kv_array_add_record(kv_array_t *array, kv_int_t index)
Creates a nested record and inserts it at the specified position in an array.
kv_long_t kv_result_get_expiration(const kv_result_t *result)
Returns the expiration time of current row from the result handle.
kv_int_t kv_iterator_size(const kv_iterator_t *iterator)
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 c...
kv_error_t kv_array_get_map(const kv_array_t *array, kv_int_t index, kv_map_t **value)
Returns a nested map value from an array.
const char * kv_statement_result_get_info(const kv_statement_result_t *result)
Returns detailed information about the execution of the statement in human readable form...
kv_error_t kv_array_append_int(kv_array_t *array, kv_int_t value)
Appends an int value to an array.
kv_error_t kv_copy_version(const kv_version_t *from, kv_version_t **to)
Copies a version structure.
Definition: kvstore.h:208
Definition: kvstore.h:137
const char * kv_statement_result_get_info_as_json(const kv_statement_result_t *result)
Returns detailed information about the execution of the statement in JSON format. ...
void kv_proxy_config_get_request_limits(const kv_proxy_config_t *config, kv_int_t *max_active_requests, kv_int_t *request_threshold_percent, kv_int_t *node_limit_percent)
Returns various request limits from the handle.
kv_error_t kv_field_as_string(const kv_field_t *field, const char **value)
Returns a string value for the specified field value.
kv_error_t kv_shutdown_proxy(kv_store_t *store)
Shutdown the proxy.
Definition: kvstore.h:168
kv_error_t kv_map_put_int(kv_map_t *map, const char *name, kv_int_t value)
Sets an int value for the named field.
void kv_close_store(kv_store_t **storep)
Closes the store, releases all resources used by the handle.
kv_error_t kv_map_put_bytes_copy(kv_map_t *map, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
kv_error_t kv_array_append_long(kv_array_t *array, kv_long_t value)
Appends a long value to an array.
double kv_double_t
Definition: kvstore.h:246
kv_int_t kv_table_delete_if_version(kv_store_t *store, const char *table_name, const kv_row_t *key, const kv_version_t *if_version)
Deletes a row from a table but only if its version matches the one specified in if_version.
void kv_release_read_options(kv_read_options_t **optionsp)
Releases the resources use by the read options structure;.
kv_error_t kv_table_put_if_version_with_options(kv_store_t *store, const char *table_name, const kv_row_t *row, const kv_version_t *if_version, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Puts a row to a table but only if the version of the existing row matches the if_version argument usi...
void kv_release_config(kv_config_t **configp)
Releases the resources used by the configuration strucutre.
Definition: kvstore.h:198
kv_error_t kv_map_put_double(kv_map_t *map, const char *name, kv_double_t value)
Sets a double value for the named field.
kv_error_t kv_create_table_put_if_present_op(kv_operations_t *operations, const char *table_name, const kv_row_t *row, kv_return_row_version_enum choice, kv_boolean_t abort_on_failure)
Creates a putIfPresent operation.
kv_error_t kv_index_iterator(kv_store_t *store, const char *table_name, const char *index_name, const kv_row_t *key, kv_boolean_t keyonly, const kv_field_range_t *range, const char **included_tables, kv_direction_enum direction, const kv_read_options_t *options, kv_long_t batch_size, kv_iterator_t **iteratorp)
Returns an iterator over the rows associated with an index key.
Definition: kvstore.h:193
kv_error_t kv_proxy_config_set_num_threads(kv_proxy_config_t *config, kv_int_t num_threads)
Sets the number of threads to use for request handling in the proxy server. The deault value is 20...
Definition: kvstore.h:217
kv_field_t * kv_record_get_field(const kv_record_t *record, const char *name)
Returns a field handle from a record by name.
void kv_release_write_options(kv_write_options_t **optionsp)
Releases the resources use by the write options structure.
const char * kv_config_get_store_name(const kv_config_t *config)
Returns the store name from the handle.
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.
Definition: kvstore.h:220
kv_error_t kv_table_put_if_version(kv_store_t *store, const char *table_name, const kv_row_t *row, const kv_version_t *if_version, kv_version_t **new_version)
Puts a row to a table but only if the version of the existing row matches the if_version argument...
kv_error_t kv_row_put_boolean(kv_row_t *row, const char *name, kv_boolean_t value)
Sets a boolean value for the named field.
kv_error_t kv_proxy_version(kv_store_t *store, const char **versionp)
kv_error_t kv_table_execute_operations(kv_store_t *store, const kv_operations_t *list, const kv_write_options_t *options, kv_operation_results_t **resultsp)
Executes a sequence of operations in a single transaction.
void kv_release_consistency(kv_consistency_t **consistencyp)
Releases the resource used by consistency structure.
kv_error_t kv_map_get_bytes(const kv_map_t *map, const char *name, const unsigned char **bytes, kv_int_t *size)
Returns a bytes value for a named field in a map.
kv_error_t kv_map_get_boolean(const kv_map_t *map, const char *name, kv_boolean_t *value)
Returns a boolean for a named field in a map.
Definition: kvstore.h:135
const char ** kv_map_get_keys(kv_map_t *map, kv_int_t *num)
Returns all keys in the map.
kv_boolean_t kv_future_cancel(kv_future_t *future, kv_boolean_t may_interrupt_if_running)
Attempts to cancel execution of this statement.
kv_int_t kv_table_multi_delete(kv_store_t *store, const char *table_name, const kv_row_t *key, const kv_field_range_t *range, const char **included_tables, const kv_write_options_t *options)
Deletes multiple rows from a table in an atomic operation.
kv_timeout_t kv_proxy_config_get_iterator_expiration_timeout(const kv_proxy_config_t *config)
Returns the expiration timeout for an iterator in milliseconds.
struct consistency_impl kv_consistency_t
Definition: kvstore.h:262
kv_error_t kv_table_iterator_multi(kv_store_t *store, const char *table_name, kv_row_t **keys, kv_boolean_t keyonly, const kv_field_range_t *range, const char **included_tables, kv_direction_enum direction, const kv_read_options_t *options, kv_long_t max_results, kv_iterator_t **iteratorp)
Returns an iterator over the rows represented by primary keys.
kv_consistency_enum kv_get_consistency_type(const kv_consistency_t *consistency)
Identifies the consistency policy type used by the provided policy.
kv_error_t kv_create_time_consistency(kv_timeout_t time_lag, kv_timeout_t timeout_ms, kv_consistency_t **consistencyp)
Creates a consistency policy which describes the amount of time the replica is allowed to lag the mas...
kv_error_t kv_row_get_double(const kv_row_t *row, const char *name, kv_double_t *value)
Returns a double value for the named field in a row.
kv_error_t kv_array_get_boolean(const kv_array_t *array, kv_int_t index, kv_boolean_t *value)
Returns a boolean value from an array.
kv_error_t kv_record_get_double(const kv_record_t *record, const char *name, kv_double_t *value)
Returns a double for a named field in a record.
kv_error_t kv_row_get_long(const kv_row_t *row, const char *name, kv_long_t *value)
Returns a long value for the named field in a row.
Definition: kvstore.h:196
kv_error_t kv_table_put_if_absent_with_options(kv_store_t *store, const char *table_name, const kv_row_t *row, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Puts a row to a table but only if the row does not exist using options.
kv_error_t kv_operations_set_copy(kv_operations_t *operations)
Configures a list of operations to copy user-supplied structures and buffers.
kv_ttl_timeunit_enum
Definition: kvstore.h:234
struct store_impl kv_store_t
Definition: kvstore.h:253
kv_error_t kv_record_get_long(const kv_record_t *record, const char *name, kv_long_t *value)
Returns a long for a named field in a record.
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...
kv_map_t * kv_array_add_map(kv_array_t *array, kv_int_t index)
Creates a nested map and inserts it at the specified position in an array.
kv_error_t kv_record_get_bytes(const kv_record_t *record, const char *name, const unsigned char **bytes, kv_int_t *size)
Returns a byte array value for a named field in a record.
kv_error_t kv_record_put_double(kv_record_t *record, const char *name, kv_double_t value)
Sets a double value for the named field.
kv_error_t kv_row_put_string(kv_row_t *row, const char *name, const char *value)
Sets a string value for the named field.
kv_int_t size
Definition: kvstore.h:289
void kv_release_operation_results(kv_operation_results_t **resultsp)
Releases the resources used by the operation results structure.
kv_map_t * kv_row_put_map(kv_row_t *row, const char *name)
Creates a map for the named field.
kv_error_t kv_array_get_long(const kv_array_t *array, kv_int_t index, kv_long_t *value)
Returns a long value from an array.
kv_int_t kv_table_delete(kv_store_t *store, const char *table_name, const kv_row_t *key)
Deletes a row associated with the primary key from a table.
kv_field_t ** kv_record_get_fields(kv_record_t *record, kv_int_t *num)
Returns all field values in a record.
kv_error_t kv_row_get_float(const kv_row_t *row, const char *name, kv_float_t *value)
Returns a float value for the named field in a row.
kv_array_t * kv_array_add_array(kv_array_t *array, kv_int_t index)
Creates a nested array and inserts it at the specified position in an array.
struct version_impl kv_version_t
Definition: kvstore.h:308
Definition: kvstore.h:216
kv_error_t kv_row_get_array(const kv_row_t *row, const char *name, kv_array_t **value)
Returns the array value handle for the named field in a row.
Definition: kvstore.h:212
Definition: kvstore.h:167
kv_error_t kv_proxy_config_set_iterator_max_results(kv_proxy_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...
const char * kv_future_get_statement(kv_future_t *future)
Returns the statement which has been executed.
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...
kv_consistency_t * kv_config_get_consistency(const kv_config_t *config)
Returns the consistency policy from the handle.
kv_int_t kv_table_delete_with_options(kv_store_t *store, const char *table_name, const kv_row_t *key, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Deletes a row associated with the primary key from a table using options.
const char * kv_result_get_table_name(const kv_result_t *result)
Returns the table name from the result handle.
kv_error_t kv_proxy_config_set_timeouts(kv_proxy_config_t *config, kv_timeout_t read_timeout, kv_timeout_t request_timeout, kv_timeout_t socket_open_timeout)
Configures default timeout values.
kv_record_t * kv_map_put_record(kv_map_t *map, const char *name)
Creates a nested record for the named field.
Definition: kvstore.h:202
kv_error_t kv_row_put_long(kv_row_t *row, const char *name, kv_long_t value)
Sets a long value for the named field.
void(* kv_output_func)(const char *)
Definition: kvstore.h:323
kv_boolean_t kv_field_is_null(const kv_field_t *field)
Returns whether or not a field value is a NULL value.
Definition: kvstore.h:204
Definition: kvstore.h:191
kv_int_t kv_proxy_config_get_iterator_max_results_batches(const kv_proxy_config_t *config)
Returns the maximum number of results batches that can be held in the proxy per iterator.
kv_ack_policy_enum
Definition: kvstore.h:96
kv_error_t kv_field_as_double(const kv_field_t *field, kv_double_t *value)
Returns a double value for the specified field value.
kv_error_t kv_proxy_config_set_iterator_expiration_timeout(kv_proxy_config_t *config, kv_timeout_t timeout_ms)
Sets the expiration timeout for an iterator in milliseconds. The proxy maintains iterator state when ...
kv_int_t kv_operation_results_size(const kv_operation_results_t *results)
Returns the number of results in the results of a group operation execution.
void kv_release_statement_result(kv_statement_result_t **resultp)
Releases the resource used by statement result structure.
Definition: kvstore.h:102
kv_boolean_t kv_result_get_success(const kv_result_t *result)
Identifies if the execution of an operation was successfully.
kv_error_t kv_record_put_null(kv_record_t *record, const char *name)
Sets a NULL value for the named field.
kv_error_t kv_array_add_boolean(kv_array_t *array, kv_int_t index, kv_boolean_t value)
Inserts a boolean value at the specified position in an array.
Definition: kvstore.h:136
kv_row_t * kv_result_get_prev_row(const kv_result_t *result)
Returns the previous row from the result handle.
kv_field_type_enum kv_field_get_type(const kv_field_t *field)
Returns the type of a field value.
kv_map_t * kv_array_append_map(kv_array_t *array)
Creates a nested map structure and appends it an array.
Definition: kvstore.h:214
kv_ack_policy_enum kv_get_durability_replica_ack(kv_durability_t durability)
Returns the acknowledgement policy in use for the given durability policy.
void kv_driver_version(kv_int_t *major, kv_int_t *minor, kv_int_t *patch)
struct row_impl kv_row_t
Definition: kvstore.h:311
kv_ttl_timeunit_enum kv_row_get_ttl_timeunit(const kv_row_t *row)
Gets the kv_ttl_timeunit_enum associated with the row. -1 indicates that the row's TTL is not set...
kv_array_t * kv_record_put_array(kv_record_t *record, const char *name)
Creates a nested array for the named field.
Definition: kvstore.h:199
Definition: kvstore.h:228
kv_error_t kv_map_get_map(const kv_map_t *map, const char *name, kv_map_t **value)
Returns a nested map for a named field in a map.
kv_error_t kv_map_get_array(const kv_map_t *map, const char *name, kv_array_t **value)
Returns a nested array for a named field in a map.
kv_return_row_version_enum
Definition: kvstore.h:134
kv_durability_t kv_create_durability(kv_sync_policy_enum master, kv_sync_policy_enum replica, kv_ack_policy_enum ack)
Creates a durability policy, which is then used for store write operations.
kv_error_t kv_row_put_null(kv_row_t *row, const char *name)
Sets a NULL value for the named field.
Definition: kvstore.h:166
struct config_impl kv_config_t
Definition: kvstore.h:256
kv_error_t kv_record_put_int(kv_record_t *record, const char *name, kv_int_t value)
Sets an int value for the named field.
kv_error_t kv_operations_set_donate(kv_operations_t *operations)
Configures the operation list so that keys, rows and versions passed to create operations are donated...
kv_error_t kv_future_update_status(kv_future_t *future, const kv_statement_result_t **resultp)
Returns information about the execution of the statement.
kv_error_t kv_table_put_if_present_with_options(kv_store_t *store, const char *table_name, const kv_row_t *row, const kv_write_options_t *options, kv_return_row_version_enum choice, kv_result_t **resultp)
Puts a row to a table but only if the row already exists.
kv_int_t kv_proxy_config_get_num_threads(const kv_proxy_config_t *config)
Returns the number of request handler threads configured for the proxy.
kv_error_t kv_map_put_string(kv_map_t *map, const char *name, const char *value)
Sets a string value for the named field.
Definition: kvstore.h:211
kv_operations_t * kv_create_operations()
Creates and initializes an operations structure to hold a sequence of update operations that execute ...
struct statement_result_impl kv_statement_result_t
Definition: kvstore.h:274
kv_error_t kv_row_get_map(const kv_row_t *row, const char *name, kv_map_t **value)
Returns the map value handle for the named field in a row.
Definition: kvstore.h:197
const char * kv_field_get_name(const kv_field_t *field)
Returns the name of a field value.
kv_error_t kv_array_append_double(kv_array_t *array, kv_double_t value)
Appends a double value to an array.
kv_error_t kv_array_add_bytes(kv_array_t *array, kv_int_t index, const unsigned char *bytes, kv_int_t size)
Inserts a byte array at the specified position in an array.
kv_error_t kv_record_put_float(kv_record_t *record, const char *name, kv_float_t value)
Sets a float value for the named field.
kv_error_t kv_table_execute_sync(kv_store_t *store, const char *statement, kv_statement_result_t **resultp)
Synchronously executes a table statement.
kv_error_t
Definition: kvstore.h:189
struct field_range_impl kv_field_range_t
Definition: kvstore.h:268
kv_error_t kv_create_version_consistency(const kv_version_t *version, kv_timeout_t timeout_ms, kv_consistency_t **consistencyp)
Creates a consistency policy which ensures that the environment on a replica node is at least as curr...
const unsigned char * future_bytes
Definition: kvstore.h:287
kv_array_t * kv_array_append_array(kv_array_t *array)
Creates a nested array structure and appends it an array.
kv_error_t kv_open_store(kv_store_t **storep, const char *host, int port, const kv_config_t *config)
Opens a KV Store handle. Call kv_close_store() to release the resources allocated for the kv_store_t ...
kv_error_t kv_row_put_bytes_copy(kv_row_t *row, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
kv_error_t kv_array_get_array(const kv_array_t *array, kv_int_t index, kv_array_t **value)
Returns a nested array value from an array.
Definition: kvstore.h:176
kv_map_t * kv_map_put_map(kv_map_t *map, const char *name)
Creates a nested map for the named field.
const kv_statement_result_t * kv_future_get_last_status(kv_future_t *future)
Returns information about the execution of the statement.
kv_record_t * kv_row_put_record(kv_row_t *row, const char *name)
Creates a record for the named field.
kv_error_t kv_row_get_string(const kv_row_t *row, const char *name, const char **value)
Returns a string value for the named field in a row.
kv_error_t kv_array_get_double(const kv_array_t *array, kv_int_t index, kv_double_t *value)
Returns a double value from an array.
float kv_float_t
Definition: kvstore.h:244
kv_error_t kv_row_put_bytes(kv_row_t *row, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
void kv_release_operations(kv_operations_t **listp)
Releases the resouce used by the operations structure.
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().
const char * kv_config_get_auth_user(const kv_config_t *config)
Gets the username for authentication to the store.
kv_operation_enum kv_operation_get_type(const kv_operations_t *operations, kv_int_t index)
Returns the type of specified table operation in the list.
kv_error_t kv_map_put_float(kv_map_t *map, const char *name, kv_float_t value)
Sets a float value for the named field.
struct result_impl kv_result_t
Definition: kvstore.h:271
Definition: kvstore.h:149
kv_error_t kv_array_add_long(kv_array_t *array, kv_int_t index, kv_long_t value)
Inserts a long value at the specified position in an array.
struct write_options_impl kv_write_options_t
Definition: kvstore.h:305
kv_boolean_t kv_statement_result_is_done(const kv_statement_result_t *result)
Identifies if the statement has finished, this is the equivalent of kv_future_is_done().
struct read_options_impl kv_read_options_t
Definition: kvstore.h:302
void kv_release_result(kv_result_t **resultp)
Releases the resources used by the result handle.
kv_error_t kv_row_put_int(kv_row_t *row, const char *name, kv_int_t value)
Sets an int value for the named field.
kv_error_t kv_proxy_config_set_sec_prop_file(kv_proxy_config_t *config, const char *security_property_file)
Sets the security property configuration file, the file is located on the proxy server.
struct arraylist_impl kv_array_t
Definition: kvstore.h:314
kv_field_t * kv_row_get_field(const kv_row_t *row, const char *name)
Returns the value of the named field in a row.
kv_error_t kv_iterator_next(kv_iterator_t *iterator)
Advances the iterator to the next result.
kv_consistency_enum
Definition: kvstore.h:59
void kv_release_iterator(kv_iterator_t **iteratorp)
Releases the resources used by the iterator handle.
kv_error_t kv_array_add_double(kv_array_t *array, kv_int_t index, kv_double_t value)
Inserts a double value at the specified position in an array.
kv_error_t kv_array_get_field(const kv_array_t *array, kv_int_t index, kv_field_t **fieldp)
Returns a field value from an array.
kv_int_t kv_proxy_config_get_max_open_iterators(const kv_proxy_config_t *config)
Returns the number for maximum number of active iterators on a connection.
kv_error_t kv_array_get_int(const kv_array_t *array, kv_int_t index, kv_int_t *value)
Returns an int value from an array.
const char * kv_get_open_error()
kv_map_t * kv_record_put_map(kv_record_t *record, const char *name)
Creates a nested map for the named field.
void kv_release_version(kv_version_t **versionp)
Releases the resources used by the version structure.
kv_error_t kv_map_put_bytes(kv_map_t *map, const char *name, const unsigned char *bytes, kv_int_t size)
Sets a byte array value for the named field.
kv_error_t kv_row_put_float(kv_row_t *row, const char *name, kv_float_t value)
Sets a float value for the named field.
kv_error_t kv_record_get_string(const kv_record_t *record, const char *name, const char **value)
Returns a string for a named field in a record.
kv_error_t kv_future_get_with_timeout(kv_future_t *future, kv_timeout_t timeout_ms, const kv_statement_result_t **resultp)
Block until the administrative operation has finished or the timeout period is exceeded.
kv_error_t kv_record_put_boolean(kv_record_t *record, const char *name, kv_boolean_t value)
Sets a boolean value for the named field.
kv_array_t * kv_map_put_array(kv_map_t *map, const char *name)
Creates a nested array for the named field.