Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Message => MessageHeader (Request | Response)
MessageHeadervariable size, type = MessageHeader
Requestvariable size, type = Request
Responsevariable size, type = Response

Anchor
MessageHeader
MessageHeader

...

Request => RequestHeader [MetaData] RequestAPI
RequestHeadervariable size, type = RequestHeader
MetaDataoptional, variable size, type = MetaData

RequestAPI

variable size, type = RequestTypes (PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest)

Anchor
RequestHeader
RequestHeader

RequestHeader

The request header contains the ApiId, ApiVersion, and hasMetaData flag to indicate whether the request contains some metadata.

...

Response => ResponseHeader [MetaData] APIResponse
ResponseHeadervariable size, type = ResponseHeader
MetaDataoptional, variable size, type = MetaData
APIResponsevariable size, type = ResponseTypes (PutResponse | GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse | ErrorResponse)

Anchor
ResponseHeader
ResponseHeader

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 | ErrorCodeDescription
ResponseTypeIdfixedSize = 2 bytes, type = int16 
ErrorCodefixedSize = 2 bytes, type = int16When there is error response will have error message(String) for it

Anchor
ErrorResponse
ErrorResponse

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
errorMessagevariable size, type = String

Anchor
Value
Value

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
ValueHeadervariable size, type = ValueHeader 
valuevariable size, type = bytesSerialized Value Object which Geode can understand

Anchor
ValueHeader
ValueHeader

ValueHeader

The value header contains the value bytes size, and a flag indicates whether it contains all the value bytes. 

ValueHeader => Size hasPartialBytesDescription
SizefixedSize = 4 bytes, type = int32Number of serialized bytes
hasPartialBytesfixedSize = 1 byte, type = booleanWhether this contains partial bytes of value

...

Anchor
MetaData
MetaData

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 KeyMetaData KeyIdMetaData TypeDescription
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 KeyMetaData KeyIdMetaData ValueDescription
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.

...