Versions Compared

Key

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

...

TypeNumber Of BytesValueSerializedBytes
booleanFixed = 1true0x01 
booleanFixed = 1false0x00
int8Fixed = 110x01
int16Fixed = 210x00 0x01 
int32Fixed = 410x00 0x00 0x00 0x01 
int64Fixed = 810x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 
String(utf)

Variable

  • 2 byte(int16) for length of encoded String
  • Utf Encoding
"Geode"

0x00 0x05 (length)

0x47 0x65 0x6f 0x64 0x65 (utf encoding)

bytes

Variable: series of bytes which contains all the

meta info to create the java object.

  


Message(Framing) 

...

Response => ResponseHeader [MetaData] APIResponse
MetaData => Optional
APIResponse => (PutResponse | GetResponse | PutAlLRequest | GetAllRequest)

...

Value => ValueHeader value [{ValueHeader value]}Description
ValueHeader => defined below 
value => bytesSerialized Value Object which Geode can understand

...

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

...

PutAllResponse => Success
Success => fixedSize = 1 byte, type = boolean

...

Metadata

The purpose of metadata to pass defined key value pair with request and response. That will be optional for 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 following format.

 

MetaDataNumberOfMetadata MatadataKeyId MetadataKeyValue { MatadataKeyId MetadataKeyValue}
NumberOfMetadatafixedSize = 2 bytes, type = int16
MatadataKeyId fixedSize = 2 bytes, type = int16
MetadataKeyValue variable, Value as defined in table below

 

We would have following pre-defined key and value for metadata. Note this list will grow over time.

Request MetaData KeyMetaData KeyIdMetaData ValueDescription
JSON_KEY

1

fixedSize = 2 bytes, type = int16

true

fixedSize = 1 byte, type = boolean

Geode will expect key as JSON string(or bytes) and convert that into pdx key.

If the response will require key then it wil convert 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 convert that into pdx value.

If the response will require 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.

 

Response MetaData KeyMetaData KeyIdMetaData ValueDescription
UPDATE_PR_META_DATA

1

fixedSize = 2 bytes, type = int16

true

fixedSize = 1 byte, type = boolean

[optional]This would indicate in response that request was handled by remote peer. So client

should update PR meta data.

 

Examples

PutRequest

string regionName = "ExampleRegion"

...