Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove size data (leaving type data); remove request and response headers (IDL will determine switching)

...

Message definition grammar

In order to consistently define messages the Extended Backus–Naur form grammar will be used.

Usage
Notation
definition=
alteration|
optional[ ... ]
repetition{ ... }
Grouping( ... )

Generic Message definition

...

Message = MessageHeader (Request Response)Description
MessageHeadervariable size, type = MessageHeaderThe MessageHeader corresponding to this Message.
Requestvariable size, type =   RequestThis field will contain the Request component.
Responsevariable size, type = ResponseThis field will contain the Response component.

...

MessageHeader = Size CorrelationId isPartialMessage hasMetaDataDescription
SizefixedSize = 4 bytes, type = int32Size of request or response
CorrelationIdfixedSize = 4 bytes, type = int32The correlationID used to track a request/response
isPartialMessagefixedSize = 1 byte, type = booleanIs this a partial message?
hasMetaDatafixedSize = 1 byte, type = booleanDoes the message have meta data associated with it

...

The request would contain the fixed size request header, optional metadata and request API parameters. 

The RequestHeader corresponding to this Request
Request = RequestHeader [MetaData] RequestAPI
  Notes
Description
RequestHeadervariable size, type = RequestHeader
MetaDataoptional, variable size, type = MetaDataThis field is optional and will be populated if the MessageHeader.hasMeta is true

RequestAPI

variable size, type = variable

The Api specific Request message. Here are some examples of Request messages.

PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest

RequestHeader

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

RequestHeader = ApiId apiVersion

Description
ApiIdfixedSize = 2 bytes, type = int16The Api ID for the Request. Supported ID's are defined on the API's page
apiVersionfixedSize = 1 byte, type = int8The version of the API being used.

Response

The response would will contain the fixed size response header, optional metadata and return values.

  

Response = ResponseHeader [MetaData] APIResponseDescription
ResponseHeadervariable size, type = ResponseHeaderThe ResponseHeader corresponding to this Response
MetaDataoptional, variable size, type = MetaDataThis field is optional and will be populated if the MessageHeader.hasMeta is true
APIResponsevariable size, type = variable

The Api specific Reponse message. Here are some examples of Response messages

PutResponse GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse | ErrorResponse

...

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 = int16The ResponeTypeId corresponding to either a Full or Partial message
ErrorCodefixedSize = 2 bytes, type = int16The error code for the error that occurred. A list of error codes can be found on the page Error Codes

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 = errorMessageDescription
errorMessagevariable size, type = StringThe error message

...

Value = {ValueHeader value}Description
ValueHeadervariable size, type = ValueHeaderThe ValueHeader corresponding to this Value entry
valuevariable size, type = bytesSerialized Value Object which Geode can understand

...

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

...

MetaData = NumberOfMetadata { MetadataKeyId MetadataKeyValue} Description
NumberOfMetadatafixedSize = 2 bytes, type = int16The number of MetaDataKeyId : MetaDataKeyValue combinations
MetadataKeyIdfixedSize = 2 bytes, type = int16Supported MetaDataKeyId's can be found in the table "Supported MetaData - MetaData KeyId"
MetadataKeyValuevariable size, type = variableThe MetaData value for the KeyId. The supported dataType can be found in the table "Supported MetaData - MetaData Value Type"

...

Request MetaData Key
MetaData KeyId
MetaData Value example
MetaData Value Type
Description
JSON_KEY

1

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

 

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

 

EventId {

uniqueId: type = String

ThreadId:type=int64

SequenceId: type=int64

}

variable size, 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.

 

...

Response MetaData Key
MetaData KeyId
MetaData Value example
MetaData Value Type
Description
UPDATE_PR_META_DATA

1

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.