...
Protocol Terms
Any binary protocol will require following things
Version: This indicates the API version.
Request Type: This indicates API needs to invoke.
Correlation Id: This helps to relate request-response.
Object Type: What is the type of serialized object.
Response Type: It indicates whether resposne a response is partial or complete.
Error HandlingErrorCodes: It indicates the problem with API invocation.
Streaming support: To support the large request, response or continuous response.
Request Format: Api request and response.
Byte Order(Big Endian)
Message: Bytes which contains defined format.
Request: It indicates client's message
Response: It indicates server's message.Message: Bytes which contains defined format.
Connect
The new protocol will be integrated with current Geode server. The new client driver can connect with Geode server by sending byte “110”.
...
ValueObject --> Serializedbytes |
---|
Serializedbytes --> SerializedBytesHeader PartialSerializedBytes [SerializedBytesHeader PartialSerializedBytes] |
SerializedBytesHeader --> Size isPartialBytes |
Size --> int (Number of serialized bytes) |
isPartialBytes --> boolean |
ProtocolTypes
Format contains following fixed and variable types. They need to serialize in Big Indian byte order as showed in example.
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) |
APIS
PutRequestResponse
PutRequest --> RegionName KeyObject CallbackArg ValueObject |
---|
RegionName --> String |
KeyObject --> Serialized bytes of Geode key object type |
CallbackArg –-> Serialized bytes of Geode object type |
...