...
Message => MessageHeader (Request | Response) | |
---|---|
MessageHeader | variable size, type = MessageHeader |
Request | variable size, type = Request |
Response | variable size, type = Response |
Anchor | ||||
---|---|---|---|---|
|
...
Request => RequestHeader [MetaData] RequestAPI | |
---|---|
RequestHeader | variable size, type = RequestHeader |
MetaData | optional, variable size, type = MetaData |
RequestAPI | variable size, type = RequestTypes (PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest) |
Anchor | ||||
---|---|---|---|---|
|
RequestHeader
The request header contains the ApiId, ApiVersion, and hasMetaData flag to indicate whether the request contains some metadata.
...
Response => ResponseHeader [MetaData] APIResponse | |
---|---|
ResponseHeader | variable size, type = ResponseHeader |
MetaData | optional, variable size, type = MetaData |
APIResponse | variable size, type = ResponseTypes (PutResponse | GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse | ErrorResponse) |
Anchor | ||||
---|---|---|---|---|
|
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 | Description | |
---|---|---|
ResponseTypeId | fixedSize = 2 bytes, type = int16 | |
ErrorCode | fixedSize = 2 bytes, type = int16 | When there is error response will have error message(String) for it |
Anchor | ||||
---|---|---|---|---|
|
ErrorResponse
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 => errorMessage | |
---|---|
errorMessage | variable size, type = String |
Anchor | ||||
---|---|---|---|---|
|
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 big serialized object in more than one chunk.
Value => {ValueHeader value} | Description | |
---|---|---|
ValueHeader | variable size, type = ValueHeader | |
value | variable size, type = bytes | Serialized Value Object which Geode can understand |
Anchor | ||||
---|---|---|---|---|
|
ValueHeader
The value header contains the value bytes size, and a flag indicates whether it contains all the value bytes.
ValueHeader => Size hasPartialBytes | Description | |
---|---|---|
Size | fixedSize = 4 bytes, type = int32 | Number of serialized bytes |
hasPartialBytes | fixedSize = 1 byte, type = boolean | Whether this contains partial bytes of value |
...
Anchor | ||||
---|---|---|---|---|
|
MetaData
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.
...
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 Type | Description |
---|---|---|---|
JSON_KEY | 1 fixedSize = 2 bytes, type = int16 | true fixedSize = 1 byte, 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 fixedSize = 2 bytes, type = int16 | true fixedSize = 1 byte, 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 fixedSize = 2 bytes, type = int16 | EventId { uniqueId: type = String ThreadId:type=int64 SequenceId: type=int64 } | 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 | Description |
---|---|---|---|
UPDATE_PR_META_DATA | 1 fixedSize = 2 bytes, type = int16 | true fixedSize = 1 byte, type = boolean | [optional]The server accepted and forwarded the request to the appropriate node holding the affected cache entry. A smart client should refresh its partitioned region location metadata for higher performance. |
...