...
Every message will adhere to the following generic message definition. A Message will comprise of a MessageHeader and either a Request or Response component.
Message = MessageHeader (Request | Response) | Description | |
---|---|---|
MessageHeader | type = MessageHeader | The MessageHeader corresponding to this Message. |
Request | type = Request | This field will contain the Request component. |
Response | type = Response
| This field will contain the Response component. |
Anchor |
---|
...
- If a message is sent in multiple sub-messages, then it will be used for combining the whole message.
- It will be used for correlating the request to its response.
MessageHeader = Size CorrelationId isPartialMessage hasMetaData | Description | |
---|---|---|
Size | type = int32 | Size of request or response (not including this header) |
CorrelationId | type = int32 | The correlationID used to match a request to its corresponding response. This will be important if/when we allow for out-of-order messages in the future. |
isPartialMessage | type = boolean | Is this a partial message? The exact semantics of partial messages is to be determined. |
Anchor | |||
---|---|---|---|
|
The request contains optional metadata and the will contain an operation specific request structure itself.
Notes | Description | MetaData | optional, type = MetaData | This field is optional and will be populated if the MessageHeader.hasMeta is true
---|---|---|
RequestAPI | type = variable | The specific Request message. Here are some examples of Request messages. PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest |
Anchor | ||||
---|---|---|---|---|
|
The response contains optional metadata and the return valuethe response object corresponding to the request, or an error response object.
Response = [MetaData] APIResponse | Description | MetaData | optional, type = MetaData|
---|---|---|---|
This field is optional and will be populated if the MessageHeader.hasMeta is true | APIResponse | type = variable | The Api specific Reponse message. Here are some examples of Response messages PutResponse | GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse | ErrorResponse |
Anchor | ||||
---|---|---|---|---|
|
The server will raise the an error when it failed to execute API request from the client. The error code and message should help the client to diagnose the issueerror response wraps an error object detailing the failure.
ErrorResponse = errorMessageError | Description | |
---|---|---|
errorMessageerror | type = String Error | The error message |
Anchor |
---|
...
|
...
|
...
EncodedValue represents a serialized value in a format that Geode can understand. It is used for both keys and values in database requests.
Value = {ValueHeader value} | Description | |
---|---|---|
encodingType | type = int8 (encoding type) | The encoding type of the following bytes. |
value | type = bytes | Serialized Value Object which Geode can understand |
...
Error
The server will raise the error when it failed to execute API request from the client. The error code and message should help the client to diagnose the issue.
ErrorResponse = errorCode message | Description | |
---|---|---|
errorCode | type = int | Numeric code referencing the type of failure |
message | type = String | The error message |
Anchor | ||||
---|---|---|---|---|
|
Some data being sent between the client and server, for the most part these rely on protobuf for proper serialization, except for CustomEncodedValues
EncodedValue = (one of the below) | Description |
---|---|
intResult |
Currently supported types are:
Name | Description | |
---|---|---|
Int | 32-bit signed integer, big-endian encoded | |
LonglongResult | 64-bit signed integer, big-endian encoded | |
ShortshortResult | 16-bit signed integer, big-endian encoded | |
BytebyteResult | 8-bit signed integer, big-endian encoded | |
BooleanbooleanResult | True or False. | |
doubleResult | 64-bit floating point number. | |
StringfloatResult | UTF-8 encoded string. (whether it can contain nulls is TBD) | 32-bit floating point number. |
binaryResultBinary | A binary blob to be stored in the region. | |
JSON | UTF-8 encoded string, containing a JSON document that will be deserialized in the same way as the REST API. | |
Float | 32-bit floating point number. | |
Double | 64-bit floating point number. |
...
stringResult | Character string |
customEncodedValue | Data which doesn't use protobuf serialization |
Anchor | ||||
---|---|---|---|---|
|
EncodedValue represents a serialized value in a format that Geode can understand. It is used for both keys and values in database requests.
Value = {ValueHeader value} | Description | |
---|---|---|
encodingType | type = EncodingType | The encoding type of the following bytes. |
value | type = bytes | Serialized Value Object which Geode can understand |
Anchor | ||||
---|---|---|---|---|
|
Currently supported types are:
Name | Description |
---|---|
JSON | UTF-8 encoded string, containing a JSON document that will be deserialized in the same way as the REST API |
...
The purpose of a metadata to pass defined key value pair with request and response. That will be optional for a client. If there is any metadata associated with request or response, then need to set "hasMetadata" flag to "true" in request or response header. After that send metadata in the following format.
MetaData = NumberOfMetadata { MetadataKeyId MetadataKeyValue} | Description | |
---|---|---|
NumberOfMetadata | type = int16 | The number of MetaDataKeyId : MetaDataKeyValue combinations |
MetadataKeyId | type = int16 | Supported MetaDataKeyId's can be found in the table "Supported MetaData - MetaData KeyId" |
MetadataKeyValue | type = variable | The MetaData value for the KeyId. The supported dataType can be found in the table "Supported MetaData - MetaData Value Type" |
Supported MetaData
We would have following pre-defined key and value for a metadata. Note this list will grow over time.
MetaData for Requests
Request MetaData Key | MetaData KeyId | MetaData Value example | MetaData Value Type | Description |
---|---|---|---|---|
JSON_KEY | 1 | true | type = boolean | Geode will expect key as JSON string(or bytes) and it will convert that string into PDX key. If the response requires a key, then it will convert the PDX key to JSON string(or bytes) back. |
JSON_VALUE | 2
| true | type = boolean | Geode will expect Value as JSON string(or bytes) and it will convert that string into PDX value. If the response requires a value, then it will convert PDX value to JSON string(or bytes) back. |
EVENT_ID | 3
| EventId { uniqueId: type = String ThreadId:type=int64 SequenceId: type=int64 } | type = bytes | The eventid is used to identify same region event in Geode. Geode keeps map of "uniqueId + threadId" Vs "SequenceId" to know whether region event has been already seen or not.
|
MetaData for Responses
Response MetaData Key | MetaData KeyId | MetaData Value example | MetaData Value Type | Description |
---|---|---|---|---|
UPDATE_PR_META_DATA | 1 | true | type = boolean | . |