kv_multi_get_iterator_keys()

#include <kvstore.h>

kv_error_tkv_multi_get_iterator_keys(kv_store_t *store,
                           const kv_key_t *parent_key,
                           kv_iterator_t **return_iterator,
                           const kv_key_range_t *sub_range,kv_depth_enumdepth,kv_direction_enum direction,
                           int batch_size,
                           kv_consistency_t *consistency,
                           kv_timeout_t timeout_ms) 

Returns an iterator that permits an ordered traversal of the descendant keys associated with the parent_key. It is useful when the expected result set is too large to fit in memory. Note that the result is not transactional and the operation effectively provides read-committed isolation. The implementation batches the fetching of key/value pairs in the iterator, to minimize the number of network round trips, while not monopolizing the available bandwidth.

This function requires the parent_key to not be NULL, and to have a complete major key path. If you want to obtain an iterator based on a NULL key, or on a key with a partial major key path, use kv_store_iterator_keys() instead.

Parameters

  • store

    The store parameter is the handle to the store for which you want an iterator.

  • parent_key

    The parent_key parameter is the parent key whose "child" keys 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().

  • sub_range

    The sub_range parameter 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.

  • direction

    The direction parameter specifies the order in which keys are returned by the iterator. Only kv_direction_enum.KV_DIRECTION_FORWARD and kv_direction_enum.KV_DIRECTION_REVERSE are supported by this function.

  • batch_size

    The batch_size parameter specifies the suggested number of keys to fetch during each network round trip. If only the first or last key is desired, passing a value of one (1) is recommended. If zero, an internally determined default is used.

  • 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(), or kv_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().