...
Geode supports only few object types as the region Key. The region key will be marked as KeyObject Key in the request format.
ObjectValueType
All the supported Geode types can be defined as the region value. In the request format, the region value will be marked as ValueObject. The ValueObject will contain the serialized bytes. We will have the ability to send those bytes in the chunk.
ResponseType
ReponseType will indicate that whether the response is partial or complete. A client can process a partial response. Response with FullResponse type id will indicate the completion of that request.
The response format will contain the 2-bytes(int16) for response type. It will be marked as FullResponse or PartialResponse in ResponseType in the response format.
ResponseType | ResponseTypeId |
---|---|
FullResponse | 1 |
PartialResponse | 2 |
...
Type | Number Of Bytes | Value | SerializedBytes |
---|---|---|---|
boolean | Fixed = 1 | true | 0x01 |
boolean | Fixed = 1 | false | 0x00 |
int8 | Fixed = 1 | 1 | 0x01 |
int16 | Fixed = 2 | 1 | 0x00 0x01 |
int32 | Fixed = 4 | 1 | 0x00 0x00 0x00 0x01 |
String(utf) | Variable
| "Geode" | 0x00 0x05 (length) 0x47 0x65 0x6f 0x64 0x65 (utf encoding) |
bytes | Variable: series of bytes which contains all the meta info to create java object. |
Message(Framing)
A message is series of bytes which contains request or response. If the message is large, then we will have provision to divide the message into small messages. The message will be sent in following way.
...
Response => ResponseHeader [MetaData] APIResponse |
---|
MetaData => Optional |
APIResponse => (PutResponse | GetResponse | PutAlLRequest | GetAllRequest) |
Response HeaderResponseHeader
The response header will have resposneType, which indicates its partial response, full response or error. A hasMetaData flag indicates whether the response contains some metadata.
ResponseHeader => (ResponseTypeId | ErrorCode) hasMetaData | Description |
---|---|
ResponseTypeId => fixedSize = 2 bytes, type = int16 | |
ErrorCode => fixedSize = 2 bytes, type = int16 | |
hasMetaData => fixedSize = 1 byte, type = boolean | if there is any meta data associated with this request |
ValueBytes
Value
The Value is serialized bytes for the Geode region value. It contains value header and series of bytes. Using value header, we can send a large number of bytes in more than one chunk.
Value ValueBytes => ValueHeader bytes value [ValueHeader bytesvalue] | Description |
---|---|
Valueheader ValueHeader => defined below | |
bytes value => series of bytes | Serialized bytes Value Object which Geode can understand |
...
ValueHeader
The value header contains the value bytes size and a flag indicates whether it contains all the value bytes.
...