pygridgain.binary module

GenericObjectMeta is a metaclass used to create classes, which objects serve as a native Python values for GridGain Complex object data type. You can use this metaclass with your existing classes to save and restore their selected attributes and properties to/from GridGain caches. It is also used internally by pygridgain to create simple data classes “on the fly” when retrieving arbitrary Complex objects.

You can get the examples of using Complex objects in the Complex objects section of pygridgain documentation.

class pygridgain.binary.GenericObjectMeta(name: str, base_classes: tuple, namespace: dict, **kwargs)

Bases: pygridgain.binary.GenericObjectPropsMeta

Complex (or Binary) Object metaclass. It is aimed to help user create classes, which objects could serve as a pythonic representation of the BinaryObject GridGain data type.

__init__(name: str, base_classes: tuple, namespace: dict, type_name: Optional[str] = None, schema: Optional[collections.OrderedDict] = None, **kwargs)

Initializes binary object class.

Parameters
  • type_name – (optional) binary object name. Defaults to class name,

  • schema – (optional) a dict of field names: field types,

Raise

ParseError if one or more binary field types did not recognized.

version = None
class pygridgain.binary.GenericObjectProps(*args, **kwargs)

Bases: pygridgain.datatypes.base.GridGainDataTypeProps

This class is mixed both to metaclass and to resulting class to make class properties universally available. You should not subclass it directly.

property schema: collections.OrderedDict

Binary object schema.

property schema_id: int

Binary object schema ID.

class pygridgain.binary.GenericObjectPropsMeta

Bases: type, pygridgain.binary.GenericObjectProps