C API  19.3.0
Oracle NoSQL Database C Client
kvstore.h
Go to the documentation of this file.
1 /*-
2  *
3  * This file is part of Oracle NoSQL Database
4  * Copyright (C) 2014, 2018 Oracle and/or its affiliates. All rights reserved.
5  *
6  * If you have received this file as part of Oracle NoSQL Database the
7  * following applies to the work as a whole:
8  *
9  * Oracle NoSQL Database server software is free software: you can
10  * redistribute it and/or modify it under the terms of the GNU Affero
11  * General Public License as published by the Free Software Foundation,
12  * version 3.
13  *
14  * Oracle NoSQL Database is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Affero General Public License for more details.
18  *
19  * If you have received this file as part of Oracle NoSQL Database Client or
20  * distributed separately the following applies:
21  *
22  * Oracle NoSQL Database client software is free software: you can
23  * redistribute it and/or modify it under the terms of the Apache License
24  * as published by the Apache Software Foundation, version 2.0.
25  *
26  * You should have received a copy of the GNU Affero General Public License
27  * and/or the Apache License in the LICENSE file along with Oracle NoSQL
28  * Database client or server distribution. If not, see
29  * <http://www.gnu.org/licenses/>
30  * or
31  * <http://www.apache.org/licenses/LICENSE-2.0>.
32  *
33  * An active Oracle commercial licensing agreement for this product supersedes
34  * these licenses and in such case the license notices, but not the copyright
35  * notice, may be removed by you in connection with your distribution that is
36  * in accordance with the commercial licensing terms.
37  *
38  * For more information please contact:
39  *
40  * berkeleydb-info_us@oracle.com
41  *
42  */
43 
49 #ifndef _KVSTORE_H_
50 #define _KVSTORE_H_
51 
52 #if defined(__cplusplus)
53 extern "C" {
54 #endif
55 
59 typedef enum {
79 
83 typedef enum {
92 
96 typedef enum {
97  KV_ACK_ALL = 1,
105 
111 #define KV_DURABILITY_COMMIT_NO_SYNC \
112  (KV_SYNC_NONE | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16))
113 
118 #define KV_DURABILITY_COMMIT_SYNC \
119  (KV_SYNC_FLUSH | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16))
120 
125 #define KV_DURABILITY_COMMIT_WRITE_NO_SYNC \
126  (KV_SYNC_WRITE_NO_SYNC | (KV_SYNC_NONE << 8) | (KV_ACK_MAJORITY << 16))
127 
134 typedef enum {
140 
144 typedef enum {
157 
165 typedef enum {
170 
174 typedef enum {
182 
189 typedef enum {
208  KV_EXECUTION = -24,
209  KV_FAULT = -25,
215  KV_PROXY = -30,
217  KV_TIMEOUT = -32,
221 } kv_error_t;
222 
226 typedef enum {
227  KV_FALSE = 0,
229 } kv_boolean_t;
230 
234 typedef enum {
235  HOURS = 0,
238 
240 typedef int kv_int_t;
242 typedef long long kv_long_t;
244 typedef float kv_float_t;
246 typedef double kv_double_t;
248 typedef long long kv_timeout_t;
250 typedef int kv_durability_t;
251 
253 typedef struct store_impl kv_store_t;
254 
256 typedef struct config_impl kv_config_t;
257 
259 typedef struct proxy_config_impl kv_proxy_config_t;
260 
262 typedef struct consistency_impl kv_consistency_t;
263 
265 typedef struct iterator_impl kv_iterator_t;
266 
268 typedef struct field_range_impl kv_field_range_t;
269 
271 typedef struct result_impl kv_result_t;
272 
274 typedef struct statement_result_impl kv_statement_result_t;
275 
277 typedef struct future_impl kv_future_t;
278 
286 typedef struct {
287  const unsigned char *future_bytes;
289  kv_int_t size;
291 
293 typedef struct operations_impl kv_operations_t;
294 
296 typedef struct operation_results_impl kv_operation_results_t;
297 
299 typedef struct field_impl kv_field_t;
300 
302 typedef struct read_options_impl kv_read_options_t;
303 
305 typedef struct write_options_impl kv_write_options_t;
306 
308 typedef struct version_impl kv_version_t;
309 
311 typedef struct row_impl kv_row_t;
312 
314 typedef struct arraylist_impl kv_array_t;
315 
317 typedef struct hashmap_impl kv_map_t;
318 
320 typedef struct hashmap_impl kv_record_t;
321 
323 typedef void (*kv_output_func)(const char *);
324 
329 #define KV_ANONYMOUS "[]"
330 
352 void kv_driver_version(kv_int_t *major, kv_int_t *minor, kv_int_t *patch);
353 
359 const char *kv_driver_package_version();
360 
372 kv_error_t kv_proxy_version(kv_store_t *store, const char **versionp);
373 
398  const char *host,
399  int port,
400  const kv_config_t *config);
401 
427  const char *host, int port,
428  const kv_config_t *config,
429  const kv_proxy_config_t *proxy_config);
430 
436 void kv_close_store(kv_store_t **storep);
437 
438 
448 
486 kv_error_t kv_create_config(const char *store_name,
487  const char *host,
488  int port,
489  kv_config_t **configp);
504  const char *host,
505  int port);
521  kv_consistency_t *consistency);
533  kv_durability_t durability);
534 
546  kv_timeout_t timeout);
547 
561  kv_long_t max_results_num);
571 kv_error_t kv_config_set_auth_user(kv_config_t *config, const char *user_name);
572 
585  const char *read_zone);
586 
594 const char * kv_config_get_store_name(const kv_config_t *config);
595 
604 
613 kv_durability_t kv_config_get_durability(const kv_config_t *config);
614 
622 kv_timeout_t kv_config_get_request_timeout(const kv_config_t *config);
623 
633 kv_long_t kv_config_get_iterator_max_results(const kv_config_t *config);
634 
642 kv_int_t kv_config_helper_hosts_size(const kv_config_t *config);
643 
652 const char * kv_config_get_helper_host(const kv_config_t *config,
653  kv_int_t index);
660 const char *kv_config_get_auth_user(const kv_config_t *config);
661 
668 kv_int_t kv_config_read_zones_size(const kv_config_t *config);
669 
678 const char *
679 kv_config_get_read_zone(const kv_config_t *config, kv_int_t index);
680 
681 
687 void kv_release_config(kv_config_t **configp);
688 
715 kv_error_t kv_create_proxy_config(const char *kvproxy_path_to_jar,
716  const char *kvclient_path_to_jar,
717  kv_proxy_config_t **configp);
718 
731  kv_long_t max_results_num);
732 
746  kv_int_t max_concurrent_requests);
747 
761  kv_int_t max_results_batches);
762 
777  kv_timeout_t timeout_ms);
778 
795  kv_int_t max_opened_iterators);
808  kv_int_t num_threads);
809 
827  kv_int_t max_active_requests,
828  kv_int_t request_threshold_percent,
829  kv_int_t node_limit_percent);
830 
845  kv_timeout_t read_timeout,
846  kv_timeout_t request_timeout,
847  kv_timeout_t socket_open_timeout);
848 
862  const char *security_property_file);
863 
873 kv_long_t
875 
884  const kv_proxy_config_t *config);
885 
896  const kv_proxy_config_t *config);
897 
905 kv_timeout_t
907  const kv_proxy_config_t *config);
908 
918 kv_int_t
920 
929 kv_int_t kv_proxy_config_get_num_threads(const kv_proxy_config_t *config);
930 
931 
941  kv_int_t *max_active_requests,
942  kv_int_t *request_threshold_percent,
943  kv_int_t *node_limit_percent);
944 
956  kv_timeout_t *read_timeout,
957  kv_timeout_t *request_timeout,
958  kv_timeout_t *socket_open_timeout);
959 
967 const char *kv_proxy_config_get_sec_prop_file(const kv_proxy_config_t *config);
968 
1012  const char *table_name,
1013  const kv_row_t *row,
1014  kv_version_t **new_version);
1015 
1036  const char *table_name,
1037  const kv_row_t *row,
1038  const kv_write_options_t *options,
1039  kv_return_row_version_enum choice,
1040  kv_result_t **resultp);
1041 
1062  const char *table_name,
1063  const kv_row_t *row,
1064  kv_version_t **new_version);
1065 
1086 kv_error_t
1088  const char *table_name,
1089  const kv_row_t *row,
1090  const kv_write_options_t *options,
1091  kv_return_row_version_enum choice,
1092  kv_result_t **resultp);
1093 
1113  const char *table_name,
1114  const kv_row_t *row,
1115  kv_version_t **new_version);
1116 
1135 kv_error_t
1137  const char *table_name,
1138  const kv_row_t *row,
1139  const kv_write_options_t *options,
1140  kv_return_row_version_enum choice,
1141  kv_result_t **resultp);
1142 
1165  const char *table_name,
1166  const kv_row_t *row,
1167  const kv_version_t *if_version,
1168  kv_version_t **new_version);
1169 
1191 kv_error_t
1193  const char *table_name,
1194  const kv_row_t *row,
1195  const kv_version_t *if_version,
1196  const kv_write_options_t *options,
1197  kv_return_row_version_enum choice,
1198  kv_result_t **resultp);
1199 
1217  const char *table_name,
1218  const kv_row_t *key,
1219  kv_row_t **rowp);
1220 
1238  const char *table_name,
1239  const kv_row_t *key,
1240  const kv_read_options_t *options,
1241  kv_result_t **resultp);
1242 
1257 kv_int_t kv_table_delete(kv_store_t *store,
1258  const char * table_name,
1259  const kv_row_t *key);
1260 
1280 kv_int_t
1282  const char * table_name,
1283  const kv_row_t *key,
1284  const kv_write_options_t *options,
1285  kv_return_row_version_enum choice,
1286  kv_result_t **resultp);
1287 
1304 kv_int_t kv_table_delete_if_version(kv_store_t *store,
1305  const char * table_name,
1306  const kv_row_t *key,
1307  const kv_version_t *if_version);
1308 
1329 kv_int_t
1331  const char * table_name,
1332  const kv_row_t *key,
1333  const kv_version_t *if_version,
1334  const kv_write_options_t *options,
1335  kv_return_row_version_enum choice,
1336  kv_result_t **resultp);
1337 
1338 
1382  const char *table_name,
1383  const kv_row_t *key,
1384  kv_boolean_t keyonly,
1385  const kv_field_range_t *range,
1386  const char **included_tables,
1387  const kv_read_options_t *options,
1388  kv_iterator_t ** iteratorp);
1389 
1414 kv_int_t kv_table_multi_delete(kv_store_t *store,
1415  const char *table_name,
1416  const kv_row_t *key,
1417  const kv_field_range_t *range,
1418  const char **included_tables,
1419  const kv_write_options_t *options);
1420 
1463  const char *table_name,
1464  const kv_row_t *key,
1465  kv_boolean_t keyonly,
1466  const kv_field_range_t *range,
1467  const char **included_tables,
1468  kv_direction_enum direction,
1469  const kv_read_options_t *options,
1470  kv_long_t max_results,
1471  kv_iterator_t ** iteratorp);
1472 
1514  const char *table_name,
1515  kv_row_t **keys,
1516  kv_boolean_t keyonly,
1517  const kv_field_range_t *range,
1518  const char **included_tables,
1519  kv_direction_enum direction,
1520  const kv_read_options_t *options,
1521  kv_long_t max_results,
1522  kv_iterator_t ** iteratorp);
1523 
1566  const char *table_name,
1567  const char *index_name,
1568  const kv_row_t *key,
1569  kv_boolean_t keyonly,
1570  const kv_field_range_t *range,
1571  const char **included_tables,
1572  kv_direction_enum direction,
1573  const kv_read_options_t *options,
1574  kv_long_t batch_size,
1575  kv_iterator_t ** iteratorp);
1576 
1587 
1599 
1611 kv_int_t kv_iterator_size(const kv_iterator_t *iterator);
1612 
1619 void kv_release_iterator(kv_iterator_t **iteratorp);
1620 
1638  const kv_operations_t *list,
1639  const kv_write_options_t *options,
1640  kv_operation_results_t **resultsp);
1678  const char *statement,
1679  kv_statement_result_t **resultp);
1747  const char *statement,
1748  kv_future_t **futurep);
1749 
1763  const kv_execution_id_t *id,
1764  kv_future_t **futurep);
1765 
1798 
1813 
1831 
1848  const char *table_name,
1849  const kv_row_t *row,
1850  kv_return_row_version_enum choice,
1851  kv_boolean_t abort_on_failure);
1852 
1870  const char *table_name,
1871  const kv_row_t *row,
1872  kv_return_row_version_enum choice,
1873  kv_boolean_t abort_on_failure);
1874 
1891  const char *table_name,
1892  const kv_row_t *row,
1893  kv_return_row_version_enum choice,
1894  kv_boolean_t abort_on_failure);
1912  const char *table_name,
1913  const kv_row_t *row,
1914  const kv_version_t *if_version,
1915  kv_return_row_version_enum choice,
1916  kv_boolean_t abort_on_failure);
1933  const char *table_name,
1934  const kv_row_t *key,
1935  kv_return_row_version_enum choice,
1936  kv_boolean_t abort_on_failure);
1937 
1954 kv_error_t
1956  const char *table_name,
1957  const kv_row_t *key,
1958  const kv_version_t *if_version,
1959  kv_return_row_version_enum choice,
1960  kv_boolean_t abort_on_failure);
1968 kv_int_t kv_operations_size(const kv_operations_t *operations);
1969 
1979 kv_operation_enum kv_operation_get_type(const kv_operations_t *operations,
1980  kv_int_t index);
1981 
1993 kv_boolean_t
1995  kv_int_t index);
1996 
2003 
2012 kv_int_t kv_operation_results_size(const kv_operation_results_t *results);
2013 
2023 kv_result_t *
2025  kv_int_t index);
2026 
2033 
2065 const char *kv_result_get_table_name(const kv_result_t *result);
2066 
2077 kv_row_t *kv_result_get_row(const kv_result_t *result);
2078 
2090 
2102 
2115 
2127 
2136 kv_boolean_t kv_result_get_success(const kv_result_t *result);
2137 
2146 kv_long_t kv_result_get_expiration(const kv_result_t *result);
2147 
2153 void kv_release_result(kv_result_t ** resultp);
2154 
2163 
2169 void kv_release_version(kv_version_t **versionp);
2195 kv_durability_t kv_create_durability(kv_sync_policy_enum master,
2196  kv_sync_policy_enum replica,
2197  kv_ack_policy_enum ack);
2198 
2207 kv_sync_policy_enum kv_get_durability_master_sync(kv_durability_t durability);
2208 
2217 kv_sync_policy_enum kv_get_durability_replica_sync(kv_durability_t durability);
2218 
2227 kv_ack_policy_enum kv_get_durability_replica_ack(kv_durability_t durability);
2250 kv_error_t kv_create_simple_consistency(kv_consistency_enum type,
2251  kv_consistency_t **consistencyp);
2252 
2268 kv_error_t kv_create_time_consistency(kv_timeout_t time_lag,
2269  kv_timeout_t timeout_ms,
2270  kv_consistency_t **consistencyp);
2271 
2288  kv_timeout_t timeout_ms,
2289  kv_consistency_t **consistencyp);
2290 
2291 
2299 kv_consistency_enum
2300 kv_get_consistency_type(const kv_consistency_t *consistency);
2301 
2307 void kv_release_consistency(kv_consistency_t **consistencyp);
2343 kv_error_t kv_create_field_range(const char *field_name,
2344  const char *start,
2345  kv_boolean_t start_inclusive,
2346  const char *end,
2347  kv_boolean_t end_inclusive,
2348  kv_field_range_t **rangep);
2349 
2382  kv_long_t timeout_ms,
2383  kv_read_options_t **optionsp);
2411 kv_error_t kv_create_write_options(kv_durability_t durability,
2412  kv_long_t timeout_ms,
2413  kv_write_options_t **optionsp);
2414 
2440 
2452  const char *name,
2453  kv_int_t value);
2454 
2466  const char *name,
2467  kv_long_t value);
2468 
2480  const char *name,
2481  kv_float_t value);
2482 
2494  const char *name,
2495  kv_double_t value);
2507  const char *name,
2508  kv_boolean_t value);
2522  const char *name,
2523  const char *value);
2541  const char *name,
2542  const unsigned char *bytes,
2543  kv_int_t size);
2544 
2562  const char *name,
2563  const unsigned char *bytes,
2564  kv_int_t size);
2573 kv_array_t *kv_row_put_array(kv_row_t *row, const char *name);
2574 
2586  const char *name,
2587  kv_int_t size);
2588 
2597 kv_map_t *kv_row_put_map(kv_row_t *row, const char *name);
2598 
2607 kv_record_t *kv_row_put_record(kv_row_t *row, const char *name);
2608 
2618 kv_error_t kv_row_put_null(kv_row_t *row, const char *name);
2619 
2632 kv_field_t ** kv_row_get_fields(const kv_row_t *row, kv_int_t *num);
2633 
2646 kv_field_t *kv_row_get_field(const kv_row_t *row, const char *name);
2647 
2655 const char *kv_field_get_name(const kv_field_t *field);
2656 
2664 kv_field_type_enum kv_field_get_type(const kv_field_t *field);
2665 
2673 kv_boolean_t kv_field_is_null(const kv_field_t *field);
2674 
2687 kv_error_t kv_field_as_int(const kv_field_t *field, kv_int_t *value);
2688 
2701 kv_error_t kv_field_as_long(const kv_field_t *field, kv_long_t *value);
2702 
2715 kv_error_t kv_field_as_float(const kv_field_t *field, kv_float_t *value);
2716 
2729 kv_error_t kv_field_as_double(const kv_field_t *field, kv_double_t *value);
2730 
2743 kv_error_t kv_field_as_boolean(const kv_field_t *field, kv_boolean_t *value);
2744 
2758 kv_error_t kv_field_as_string(const kv_field_t *field, const char **value);
2759 
2772  unsigned char **bytes,
2773  kv_int_t *size);
2774 
2785  kv_array_t **value);
2786 
2797  kv_map_t **value);
2798 
2809  kv_record_t **value);
2810 
2825  const char *name,
2826  kv_int_t *value);
2827 
2842  const char *name,
2843  kv_long_t *value);
2844 
2859  const char *name,
2860  kv_float_t *value);
2861 
2876  const char *name,
2877  kv_double_t *value);
2878 
2893  const char *name,
2894  kv_boolean_t *value);
2895 
2910  const char *name,
2911  const char **value);
2912 
2926  const char *name,
2927  const unsigned char **bytes,
2928  kv_int_t *size);
2929 
2941  const char *name,
2942  kv_array_t **value);
2943 
2955  const char *name,
2956  kv_map_t **value);
2957 
2969  const char *name,
2970  kv_record_t **value);
2971 
2984 kv_error_t kv_row_set_ttl_of_hours(kv_row_t *row, kv_long_t hours);
2985 
2998 kv_error_t kv_row_set_ttl_of_days(kv_row_t *row, kv_long_t days);
2999 
3013 kv_error_t kv_row_set_use_table_ttl(kv_row_t *row, kv_boolean_t flag);
3014 
3024 kv_long_t kv_row_get_ttl_value(const kv_row_t *row);
3025 
3035 kv_ttl_timeunit_enum kv_row_get_ttl_timeunit(const kv_row_t * row);
3036 
3048 kv_boolean_t kv_row_get_use_table_ttl(const kv_row_t *row);
3049 
3057 kv_error_t kv_copy_row(const kv_row_t *from, kv_row_t **to);
3058 
3064 void kv_release_row(kv_row_t **rowp);
3081 kv_error_t kv_array_append_int(kv_array_t *array, kv_int_t value);
3082 
3092 kv_error_t kv_array_append_long(kv_array_t *array, kv_long_t value);
3093 
3103 kv_error_t kv_array_append_float(kv_array_t *array, kv_float_t value);
3104 
3114 kv_error_t kv_array_append_double(kv_array_t *array, kv_double_t value);
3115 
3125 kv_error_t kv_array_append_boolean(kv_array_t *array, kv_boolean_t value);
3126 
3138 kv_error_t kv_array_append_string(kv_array_t *array, const char *value);
3139 
3156  const unsigned char *bytes,
3157  kv_int_t size);
3158 
3175  const unsigned char *bytes,
3176  kv_int_t size);
3177 
3186 
3195 
3204 
3215 kv_error_t kv_array_add_int(kv_array_t *array, kv_int_t index, kv_int_t value);
3216 
3228  kv_int_t index,
3229  kv_long_t value);
3230 
3242  kv_int_t index,
3243  kv_float_t value);
3255  kv_int_t index,
3256  kv_double_t value);
3257 
3269  kv_int_t index,
3270  kv_boolean_t value);
3284  kv_int_t index,
3285  const char *value);
3303  kv_int_t index,
3304  const unsigned char *bytes,
3305  kv_int_t size);
3306 
3324  kv_int_t index,
3325  const unsigned char *bytes,
3326  kv_int_t size);
3327 
3337 kv_array_t *kv_array_add_array(kv_array_t *array, kv_int_t index);
3338 
3351  kv_int_t index,
3352  kv_int_t size);
3353 
3363 kv_map_t *kv_array_add_map(kv_array_t *array, kv_int_t index);
3364 
3374 kv_record_t *kv_array_add_record(kv_array_t *array, kv_int_t index);
3375 
3383 kv_int_t kv_array_get_size(const kv_array_t *array);
3384 
3399  kv_int_t index,
3400  kv_int_t *value);
3415  kv_int_t index,
3416  kv_long_t *value);
3417 
3432  kv_int_t index,
3433  kv_float_t *value);
3448  kv_int_t index,
3449  kv_double_t *value);
3464  kv_int_t index,
3465  kv_boolean_t *value);
3478  kv_int_t index,
3479  const unsigned char **bytes,
3480  kv_int_t *size);
3495  kv_int_t index,
3496  const char **value);
3497 
3509  kv_int_t index,
3510  kv_array_t **value);
3522  kv_int_t index,
3523  kv_map_t **value);
3524 
3536  kv_int_t index,
3537  kv_record_t **value);
3538 
3550  kv_int_t index,
3551  kv_field_t **fieldp);
3569 kv_error_t kv_map_put_int(kv_map_t *map, const char *name, kv_int_t value);
3570 
3581 kv_error_t kv_map_put_long(kv_map_t *map, const char *name, kv_long_t value);
3582 
3593 kv_error_t kv_map_put_float(kv_map_t *map, const char *name, kv_float_t value);
3594 
3606  const char *name,
3607  kv_double_t value);
3608 
3620  const char *name,
3621  kv_boolean_t value);
3622 
3636  const char *name,
3637  const char *value);
3638 
3656  const char *name,
3657  const unsigned char *bytes,
3658  kv_int_t size);
3659 
3677  const char *name,
3678  const unsigned char *bytes,
3679  kv_int_t size);
3680 
3689 kv_array_t *kv_map_put_array(kv_map_t *map, const char *name);
3690 
3702  const char *name,
3703  kv_int_t size);
3704 
3713 kv_map_t *kv_map_put_map(kv_map_t *map, const char *name);
3714 
3723 kv_record_t *kv_map_put_record(kv_map_t *map, const char *name);
3724 
3737 kv_error_t kv_map_put_null(kv_map_t *map, const char *name);
3738 
3752 const char ** kv_map_get_keys(kv_map_t *map, kv_int_t *num);
3753 
3768  const char *name,
3769  kv_int_t *value);
3770 
3785  const char *name,
3786  kv_long_t *value);
3801  const char *name,
3802  kv_float_t *value);
3803 
3818  const char *name,
3819  kv_double_t *value);
3820 
3835  const char *name,
3836  kv_boolean_t *value);
3851  const char *name,
3852  const char **value);
3865  const char *name,
3866  const unsigned char **bytes,
3867  kv_int_t *size);
3879  const char *name,
3880  kv_array_t **value);
3892  const char *name,
3893  kv_map_t **value);
3905  const char *name,
3906  kv_record_t **value);
3907 
3916 kv_field_t * kv_map_get_field(const kv_map_t *map, const char *name);
3917 
3936  const char *name,
3937  kv_int_t value);
3938 
3950  const char *name,
3951  kv_long_t value);
3963  const char *name,
3964  kv_float_t value);
3965 
3977  const char *name,
3978  kv_double_t value);
3979 
3991  const char *name,
3992  kv_boolean_t value);
3993 
4007  const char *name,
4008  const char *value);
4026  const char *name,
4027  const unsigned char *bytes,
4028  kv_int_t size);
4029 
4048  const char *name,
4049  const unsigned char *bytes,
4050  kv_int_t size);
4051 
4061 kv_error_t kv_record_put_null(kv_record_t *record, const char *name);
4062 
4071 kv_array_t *kv_record_put_array(kv_record_t *record, const char *name);
4072 
4085  const char *name,
4086  kv_int_t size);
4087 
4098  const char *name);
4108  const char *name);
4109 
4124  const char *name,
4125  kv_int_t *value);
4126 
4141  const char *name,
4142  kv_long_t *value);
4143 
4158  const char *name,
4159  kv_float_t *value);
4160 
4175  const char *name,
4176  kv_double_t *value);
4177 
4192  const char *name,
4193  kv_boolean_t *value);
4194 
4209  const char *name,
4210  const char **value);
4211 
4224  const char *name,
4225  const unsigned char **bytes,
4226  kv_int_t *size);
4227 
4239  const char *name,
4240  kv_array_t **value);
4241 
4253  const char *name,
4254  kv_map_t **value);
4266  const char *name,
4267  kv_record_t **value);
4268 
4278  const char *name);
4279 
4292 kv_field_t ** kv_record_get_fields(kv_record_t *record, kv_int_t *num);
4293 
4322  const kv_statement_result_t **resultp);
4323 
4343  kv_timeout_t timeout_ms,
4344  const kv_statement_result_t **resultp);
4345 
4361 kv_boolean_t kv_future_cancel(kv_future_t *future,
4362  kv_boolean_t may_interrupt_if_running);
4363 
4375  kv_execution_id_t **idp);
4376 
4389 kv_boolean_t kv_future_is_cancelled(kv_future_t *future);
4390 
4404 kv_boolean_t kv_future_is_done(kv_future_t *future);
4405 
4422 
4441  const kv_statement_result_t ** resultp);
4442 
4443 
4451 const char *kv_future_get_statement(kv_future_t *future);
4452 
4458 void kv_release_future(kv_future_t **futurep);
4459 
4466 
4497 
4507 const char *
4509 
4523 const char *kv_statement_result_get_info(const kv_statement_result_t *result);
4524 
4533 const char *
4535 
4544 const char *
4546 
4555 kv_boolean_t
4557 
4567 kv_boolean_t
4569 
4578 kv_boolean_t kv_statement_result_is_done(const kv_statement_result_t *result);
4579 
4610 const char *kv_get_last_error(const kv_store_t *store);
4611 
4618 const char *kv_get_open_error();
4619 
4628 
4630 #if defined(__cplusplus)
4631 }
4632 #endif
4633 
4634 #endif /* _KVSTORE_H_ */
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...
Definition: kvstore.h:71
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&#39;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
Definition: kvstore.h:86
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&#39;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&#39;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.
Definition: kvstore.h:75
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.
Definition: kvstore.h:99
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
Definition: kvstore.h:60
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.
Definition: kvstore.h:88
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&#39;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.
Definition: kvstore.h:97
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
Definition: kvstore.h:68
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&#39;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
Definition: kvstore.h:84
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.
Definition: kvstore.h:64
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.