yr.kv_get_with_param#
- yr.kv_get_with_param(keys: List[str], get_params: GetParams, timeout: int = 300) List[bytes | memoryview][source]#
Provides the kv_get_with_param interface, which supports offset reading of data.
- Parameters:
keys (List[str]) β A list of keys specifying the data to be retrieved.
get_params (GetParams) β A set of attributes configured for retrieving the value, including parameters such as offset and size.
timeout (int) β The timeout in seconds. Defaults to
300. A value of-1indicates permanent blocking wait. The parameter must be greater than or equal to-1.
- Returns:
Returns one or a list of retrieved data items. Data type is Union[bytes, List[bytes]].
- Raises:
ValueError β If the get_params list of GetParam type is an empty list.
ValueError β If the number of items in the get_params list does not match the number of items in the keys list.
RuntimeError β If kv_get_with_param() is called without initialization, an exception will be thrown.
RuntimeError β If data retrieval from the data system fails.
Example
>>> get_param = yr.GetParam() >>> get_param.offset = 0 >>> get_param.size = 0 >>> params = yr.GetParams() >>> params.get_params = [get_param] >>> v1 = yr.kv_get_with_param(["kv-key"], params, 10)