3 Data Operation Functions

This chapter describes the functions used to perform data read and writes on the store. Functions are described that allow single records to be read or written at a time, and for many records to be read and written in a single operation. Functions that return iterators are also described. These allow you to walk over some or all of the records contained in the store.

This chapter also describes functions used to perform multiple write operations that are organized in a single sequence of operations. That is, you can in one atomic unit perform several put operations that create new records, then put operations that update those records, and/or delete those records. These sequences are performed under a single transaction that effectively offers serializable isolation.

Data Operations Functions

Data Operations Functions Description
kv_delete()

Delete the key/value pair associated with the key

kv_delete_with_options()

Delete the key/value pair using options

kv_get()

Get the value associated with the key

kv_get_with_options()

Get the value that matches the options

kv_put()

Put a key/value pair, inserting or overwriting as appropriate

kv_put_with_options()

Put the key/value pair using options

Multiple-Key Operations Functions

Multiple-Key Operations Functions Description
kv_init_key_range()

Create and initialize a key range for use in multiple-key operations

kv_init_key_range_prefix()

Create and initialize a key range using prefix information

kv_iterator_next()

Return the next key/value pair from a store iterator

kv_iterator_next_key()

Return the next key from a store iterator

kv_iterator_size()

Return the number of elements in the store iterator

kv_multi_delete()

Delete all descendant key/value pairs associated with the parent key

kv_multi_get()

Return all descendant key/value pairs associated with the parent key

kv_multi_get_iterator()

Returns an iterator that provides traversal of descendant key/value pairs

kv_multi_get_iterator_keys()

Returns an iterator that provides traversal of descendant keys

kv_multi_get_keys()

Return the descendant keys associated with the parent key

kv_parallel_scan_iterator_next()

Return the next key/value pair from a parallel scan iterator

kv_parallel_scan_iterator_next_key()

Return the next key from a parallel scan iterator

kv_parallel_store_iterator()

Return a parallel scan store iterator

kv_parallel_store_iterator_keys()

Return an parallel scan iterator providing traversal of store keys

kv_release_iterator()

Release the store iterator

kv_release_parallel_scan_iterator()

Release the parallel scan iterator

kv_store_iterator()

Return an iterator that provides traversal of all store key/value pairs

kv_store_iterator_keys()

Return an iterator that provides traversal of all store keys

Multi-Step Operations Functions

Multi-Step Operations Functions Description
kv_create_delete_op()

Create a delete operation to be used with an operation sequence

kv_create_delete_with_options_op()

Create a delete operation, with parameters, to be used with an operation sequence

kv_create_operations()

Creates and initializes a structure used to contain a sequence of store operations

kv_create_put_op()

Create a put operation to be used with an operation sequence

kv_create_put_with_options_op()

Create a put operation, with parameters, to be used with an operation sequence

kv_execute()

Execute the operation

kv_operation_get_abort_on_failure()

Returns whether the entire operation aborts in the event of an execution failure

kv_operation_get_key()

Returns the Key associated with the operation

kv_operation_get_type()

Returns the operation type

kv_operation_results_size()

Returns the size of the operation's result set

kv_operations_set_copy()

Configures a list of operations to copy user-supplied structures and buffers

kv_operations_size()

Returns the number of operations in the operation structure

kv_release_operation_results()

Release the results obtained by executing an operation

kv_release_operations()

Release the operation structure

kv_result_get_previous_value()

For a put or delete operation, returns the previous value associated with the key

kv_result_get_previous_version()

For a put or delete operation, returns the version or the previous value associated with the Key

kv_result_get_success()

Returns whether the operation was successful

kv_result_get_version()

For a put operation, returns the Version of the new key/value pair

Large Object Operations Functions

Large Object Operations Functions Description
kv_lob_delete()

Delete the LOB

kv_lob_get_for_read()

Open a LOB handle for read operations

kv_lob_get_for_write()

Open a LOB handle for write operations

kv_lob_get_version()

Returns the Version of the LOB key/value pair

kv_lob_put_from_file()

Put a LOB key/value pair, inserting or overwriting as appropriate

kv_lob_read()

Read a LOB from the store

kv_lob_release_handle()

Release the LOB handle