...
Protocol Terms
Any binary protocol will require following things:
Version: This indicates the API version.
Correlation Id: This helps to relate request-response.
Object Type: What is the type of serialized object.
Response Type: It indicates whether a response is partial or complete.
ErrorCodes: It indicates the problem with API invocation.
Chunk Response: Send large response in multiple chunks.
Continuous Response: Client can register(Observer pattern) for events and then server notify the client if those events occur.
Request: It indicates client's message
Response: It indicates server's message.
Request Format: Format of request api and its parameters, which client wants to invoke.
Response Format: Format for api return value, which client invoked.
Message: Set of bytes which contain the Message Header and Request/Response.
Serialized Byte Order(: Big Endian)
Connect
The new protocol will be integrated with current Geode server. The new client driver can connect with Geode server by sending a protocol byte. Geode will support two protocol.
- byte - 110 : Message will contain the whole request or response.
- byte - 111 : Request or Response can be divided into multiple messages, if those are large.
...
- If the message is large then client or server can divide the message into the set of small messages. Then they need to collect all the small message and parse the whole request or response.
API Type
Following table contains the request api type and its corresponding Api id. The ApiId would recognize the API, which client want wants to invoke on the server. The request format will contain the 1-byte(int8) for Api id. It will be marked as ApiId in the request format.
RequestType | ApiId |
---|---|
AuthenticationRequestType | 1 |
PutRequestType | 2 |
GetRequestType | 3 |
PutAllRequestType | 4 |
GetAllRequestType | 5 |
ClientConfigRequestType | 6 |
ServerConfigRequestType | 7 |
CreateRequestType | 8 |
InvalidateRequestType | 9 |
DestroyRequestType | 10 |
KeySetRequestType | 11 |
ValuesRequestType | 12 |
EntrySetRequestType | 13 |
ContainsValueForKeyRequestType | 14 |
ContainsKeyRequestType | 15 |
ContainsValueRequestType | 16 |
RemoveAllRequestType | 17 |
SizeRequestType | 18 |
PutIfAbsentRequestType | 19 |
RemoveIfValueIsSameRequestType | 20 |
ReplaceIfValueIsSameRequestType | 21 |
ReplaceIfValueExistType | 22 |
FunctionRequestType | 23 |
...