...
Byte order is little-endian. Strings are UTF-8 with int prefix (no null terminator). All data types in this proposal are Java-like (byte = 8 bits, short = 2 bytes, int = 4 bytes, long = 8 bytes).
User data, such as cache keys and values, is represented in Ignite Binary Object format. Binary Object can be a primitive or a complex object.
Primitives
Primitives are represented as a type code + value:
byte | Type code |
... | Value |
Available primitives are listed below:
Name | Type Code | Size |
---|---|---|
byte | ||
All messages, request and response, including handshake, start with int
message length (excluding these first 4 bytes). E.g. empty message would be represented by 4 zero bytes.
...
Response | |
long | Request id (see above) |
... | Operation-specific data |
Available operations are listed below
...
Operation codes and request ids are omitted everywhere below for brevity.
OP_CACHE_GET = 1
Request | |||||
int cacheId; // | Cache ID: Java-style hash code of the cache name | ||||
byte | flags flags; // 0 = none, 1 = binary mode | ||||
BinaryObject key; | BinaryObject value; | ||||
key |
Let's see how request and response would look for a cache.get operation for integer key and value:
...