...
Geode supports only few object types as the region Key. The region key will be marked as Key in the request format. the client needs to serialize key as described here.
ResponseType
ReponseType will indicate that The Response Type indicates whether the response is partial or complete. A client can process a partial response. Response The response with the FullResponse type id will indicate indicates the completion of that request. And the response with PartialResponse type id indicates the response is partial. The response format will contain the 2-bytes(int16) for response type. It will be marked as ResponseTypeId in the response format.
ResponseType | ResponseTypeId |
---|---|
FullResponse | 1 |
PartialResponse | 2 |
Error Codes
The Error codes indicate the issue with the invocation of API at the server. We have following defined the error code for various issues at the server here. The response format will contain the 2-bytes(int16) for error codes. It will be marked as ErrorCode in the response format.
...
Message(Framing)
A message is a series of bytes which contains the request or response. If the message is large, then we will have provision to divide the message into small messages. In that case client/server needs to collect all messages to parse the request/response. The message will be sent in following way. A client can send the multiple messages on the connection and the server will respond to those messages in same order.
Message => MessageHeader (Request | Response) |
---|
MessageHeader => defined below |
Request => defined below |
Response => defined below |
...
MessageHeader
The Message header is a fixed size header which contains the size of a message, boolean flag to indicates whether a message is partial, and correlation id for that request message. The correlation id is used for the dual purpose here.
...
Request => RequestHeader [MetaData] RequestAPI |
---|
RequestHeader => defined below |
MetaData => optional |
RequestAPI => (PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest) |
...
RequestHeader => ApiId apiVersion hasMetaData | Description |
---|---|
ApiId => fixedSize = 2 bytes, type = int16 | |
apiVersion => fixedSize = 1 byte, type = int8 | |
hasMetaData => fixedSize = 1 byte, type = boolean | if there is any meta data associated with this request |
...
Response Format
The response would contain the fixed size response header, optional metadata and return values.
...
Response => ResponseHeader [MetaData] APIResponse |
---|
ResponseHeader => defined below |
MetaData => Optional |
APIResponse => (PutResponse | GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse) |
...
ResponseHeader
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 CorrelationId | Description |
---|---|
ResponseTypeId => fixedSize = 2 bytes, type = int16 | |
ErrorCode => fixedSize = 2 bytes, type = int16 | When there is error response will have message(String) for it |
hasMetaData => fixedSize = 1 byte, type = boolean | if there is any meta data associated with this request |
CorrelationId => fixedSize = 4 bytes, type = int32 |
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.
...