You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/01/20 09:12:32 UTC

[GitHub] [ignite-python-thin-client] ivandasch commented on a change in pull request #2: IGNITE-11303: Partition Awareness for Python Thin

ivandasch commented on a change in pull request #2:
URL: https://github.com/apache/ignite-python-thin-client/pull/2#discussion_r560798771



##########
File path: pyignite/api/key_value.py
##########
@@ -993,3 +1005,64 @@ def cache_get_size(
     if result.status == 0:
         result.value = result.value['count']
     return result
+
+
+def cache_local_peek(
+    conn: 'Connection', cache: Union[str, int],
+    key: Any, key_hint: 'IgniteDataType' = None, peek_modes: int = 0,
+    binary: bool = False, query_id: Optional[int] = None,
+) -> 'APIResult':
+    """
+    Peeks at in-memory cached value using default optional peek mode.
+
+    This method will not load value from any persistent store or from a remote
+    node.
+
+    :param conn: connection: connection to Ignite server,
+    :param cache: name or ID of the cache,
+    :param key: entry key,
+    :param key_hint: (optional) Ignite data type, for which the given key
+     should be converted,
+    :param peek_modes: (optional) limit count to near cache partition
+     (PeekModes.NEAR), primary cache (PeekModes.PRIMARY), or backup cache
+     (PeekModes.BACKUP). Defaults to all cache partitions (PeekModes.ALL),
+    :param binary: (optional) pass True to keep the value in binary form.
+     False by default,
+    :param query_id: (optional) a value generated by client and returned as-is
+     in response.query_id. When the parameter is omitted, a random value
+     is generated,
+    :return: API result data object. Contains zero status and a peeked value
+     (null if not found).
+    """
+    if not isinstance(peek_modes, (list, tuple)):
+        if peek_modes == 0:

Review comment:
       ```
   peek_modes = [peek_modes] if peek_modes else []
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org