Data TypesΒΆ
Apache Ignite uses a sophisticated system of serializable data types to store and retrieve user data, as well as to manage the configuration of its caches through the Ignite binary protocol.
The complexity of data types varies from simple integer or character types to arrays, maps, collections and structures.
Each data type is defined by its code. Type code is byte-sized. Thus, every data object can be represented as a payload of fixed or variable size, logically divided into one or more fields, prepended by the type_code field.
Most of Ignite data types can be represented by some of the standard Python data type or class. Some of them, however, are conceptually alien, overly complex, or ambiguous to Python dynamic type system.
The following table summarizes the notion of Apache Ignite data types, as well as their representation and handling in Python. For the nice description, as well as gory implementation details, you may follow the link to the parser/constructor class definition. Note that parser/constructor classes are not instantiatable. The class here is used mostly as a sort of tupperware for organizing methods together.
Note: you are not obliged to actually use those parser/constructor classes. Pythonic types will suffice to interact with Apache Ignite binary API. However, in some rare cases of type ambiguity, as well as for the needs of interoperability, you may have to sneak one or the other class, along with your data, in to some API function as a type conversion hint.
type_code |
Apache Ignite docs reference |
Python type or class |
Parser/constructor class |
---|---|---|---|
Primitive data types |
|||
0x01 |
int |
||
0x02 |
int |
||
0x03 |
int |
||
0x04 |
int |
||
0x05 |
float |
||
0x06 |
float |
||
0x07 |
str |
||
0x08 |
bool |
||
0x65 |
NoneType |
||
Standard objects |
|||
0x09 |
Str |
||
0x0a |
uuid.UUID |
||
0x21 |
tuple |
||
0x0b |
datetime.datetime |
||
0x24 |
datetime.timedelta |
||
0x1e |
decimal.Decimal |
||
0x1c |
tuple |
||
0x67 |
tuple |
||
Arrays of primitives |
|||
0x0c |
iterable/bytearray |
||
0x0d |
iterable/list |
||
0x0e |
iterable/list |
||
0x0f |
iterable/list |
||
0x10 |
iterable/list |
||
0x11 |
iterable/list |
||
0x12 |
iterable/list |
||
0x13 |
iterable/list |
||
Arrays of standard objects |
|||
0x14 |
iterable/list |
||
0x15 |
iterable/list |
||
0x22 |
iterable/list |
||
0x16 |
iterable/list |
||
0x23 |
iterable/list |
||
0x1f |
iterable/list |
||
Object collections, special types, and complex object |
|||
0x17 |
tuple[int, iterable/list] |
||
0x18 |
tuple[int, iterable/list] |
||
0x19 |
tuple[int, dict/OrderedDict] |
||
0x1d |
iterable/list |
||
0x67 |
object |
||
0x1b |
tuple[int, bytes] |