kv_multi_get()

#include <kvstore.h>

kv_error_tkv_multi_get(kv_store_t *store,
             const kv_key_t *parent_key,
             kv_iterator_t **return_iterator,
             const kv_key_range_t *sub_range,kv_depth_enum depth,
             kv_consistency_t *consistency,
             kv_timeout_t timeout_ms) 

Returns the descendant key/value pairs associated with the parent_key. The sub_range and the deptharguments can be used to further limit the key/value pairs that are retrieved. The key/value pairs are fetched within the scope of a single transaction that effectively provides serializable isolation.

This API should be used with caution because it could result in errors due to running out of memory, or excessive garbage collection activities in the underlying Java virtual machine, if the results cannot all be held in memory at one time. Consider using kv_multi_get_iterator() instead.

This function only allows fetching key/value pairs that are descendants of a parent_key that has a complete major path. To fetch the descendants of a parent_key with a partial major path, use kv_store_iterator() instead.

Parameters

  • store

    The store parameter is the handle to the store from which you want to retrieve key/value pairs.

  • parent_key

    The parent_key parameter is the parent key whose "child" records are to be retrieved. It must not be NULL. The major key path must be complete. The minor key path may be omitted or may be a partial path.

  • return_iterator

    The return_iterator parameter references memory into which is copied the results set. Release the resources used by this iterator using kv_release_iterator().

    The iterator returned here is transactional, which means the contents of the iterator will be static (isolated) until such a time as the iterator is released.

  • sub_range

    The sub_range parameter further restricts the range under the parent_key to the minor path components in this key range. It may be NULL.

    You construct a key range using kv_init_key_range().

  • depth

    The depth parameter specifies how deep the retrieval can go. You can allow only children to be retrieved, the parent and all the children, all descendants, and so forth. See kv_depth_enum for a description of all your depth options.

  • consistency

    The consistency parameter identifies the consistency policy to use for this read operation. Consistency policies are created using kv_create_simple_consistency()kv_create_time_consistency(), orkv_create_version_consistency().

  • timeout_ms

    The timeout_ms parameter provides an upper bound on the time interval for processing the operation. A best effort is made not to exceed the specified limit. If zero, the default request timeout is used. The default request timeout is set using kv_config_set_timeouts().