Versions Compared

Key

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

...

We may add additional protocol definitions here to indicate the use of an alternative serialization mechanism.  For instance bytes 112 & 113 might indicate the but require the server to use Protobuf for serialization of client/server messages.  How we handle other serialization libraries will be addressed when the pluggable-serialization architecture is roughed out.

Protocol FieldDefinitions

API Id

The ApiId recognizes the API, a client wants to invoke on the server. The request format will contain the 2-byte(int16) for API id. It will be marked as ApiId in the request format.

...

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. 

Additional Request and Response message definitions can be found in the API's section.

Message definition grammar

...

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.

Anchor
MessageHeader
MessageHeader

...

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

Request => RequestHeader [MetaData] RequestAPI Description
RequestHeadervariable size, type = RequestHeaderThe RequestHeader corresponding to this Request
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

RequestAPI

variable size, type = RequestTypes (

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

)

Anchor
RequestHeader
RequestHeader

...

RequestHeader => ApiId apiVersionDescription
ApiIdfixedSize = 2 bytes, type = int16 The Api ID for the Request. Supported ID's are defined on the API's page
apiVersionfixedSize = 1 byte, type = int8 The version of the API being used.

Anchor
Response
Response

Response

...

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

APIResponsevariable size, type = ResponseTypes (

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

)

Anchor
ResponseHeader
ResponseHeader

...

ResponseHeader => ResponseTypeId | ErrorCodeDescription
ResponseTypeIdfixedSize = 2 bytes, type = int16 The ResponeTypeId corresponding to either a Full or Partial message
ErrorCodefixedSize = 2 bytes, type = int16When there is error response will have error message(String) for it

...

ErrorResponse => errorMessageDescription
errorMessagevariable size, type = StringThe errorMessage

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 The ValueHeader corresponding to this Value entry
valuevariable size, type = bytesSerialized Value Object which Geode can understand

...

MetaData => NumberOfMetadata { MetadataKeyId MetadataKeyValue} Description
NumberOfMetadatafixedSize = 2 bytes, type = int16The number of MetaDataKeyId : MetaDataKeyValue combinations
MetadataKeyIdfixedSize = 2 bytes, type = int16 – as defined Supported MetaDataKeyId's can be found in the table "Supported MetaData - MetaData KeyId"
MetadataKeyValuevariable size, type = as defined variable size, type = variableThe 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.

...

Request MetaData KeyMetaData KeyIdMetaData Value exampleMetaData Value 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

}

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 KeyMetaData KeyIdMetaData Value exampleMetaData Value TypeDescription
UPDATE_PR_META_DATA

1fixedSize = 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.

...