pyignite.utils module

pyignite.utils.cache_id(cache: Union[str, int]) → int

Create a cache ID from cache name.

Parameters:cache – cache name or ID,
Returns:cache ID.
pyignite.utils.entity_id(cache: Union[str, int]) → int

Create a type ID from type name or field ID from field name.

Parameters:cache – entity name or ID,
Returns:entity ID.
pyignite.utils.hashcode(string: Union[str, bytes]) → int

Calculate hash code used for identifying objects in Ignite binary API.

Parameters:string – UTF-8-encoded string identifier of binary buffer,
Returns:hash code.
pyignite.utils.int_overflow(value: int) → int

Simulates 32bit integer overflow.

pyignite.utils.is_binary(value)

Check if a value is a pythonic representation of a Complex object.

pyignite.utils.is_hinted(value)

Check if a value is a tuple of data item and its type hint.

pyignite.utils.is_iterable(value)

Check if value is iterable.

pyignite.utils.is_wrapped(value: Any) → bool

Check if a value is of WrappedDataObject type.

pyignite.utils.schema_id(schema: Union[int, dict]) → int

Calculate Complex Object schema ID.

Parameters:schema – a dict of field names: field types,
Returns:schema ID.
pyignite.utils.status_to_exception(exc: Type[Exception])

Converts erroneous status code with error message to an exception of the given class.

Parameters:exc – the class of exception to raise,
Returns:decorator.
pyignite.utils.unwrap_binary(client: Client, wrapped: tuple)

Unwrap wrapped BinaryObject and convert it to Python data.

Parameters:
  • client – connection to Ignite cluster,
  • wrappedWrappedDataObject value,
Returns:

dict representing wrapped BinaryObject.