Versions Compared

Key

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

...

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

APIS

PutRequest

PutRequest => RegionName Key CallbackArg Value
RegionName => (variable size, type = String)
Key => bytes
CallbackArg =>  bytes 
Value => defined above

PutResponse

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

GetRequest

GetRequest => RegionName Key CallbackArg
RegionName => (variable size, type = String)
Key => bytes
CallbackArg => bytes

GetResponse

GetResponse => Result
Result => bytes

GetAllRequest

GetAllRequest => RegionName NumberOfKeys Key {Key} CallbackArg
RegionName => (variable size, type = String)
NumberOfKeys => fixedSize = 4 bytes, type = int32
Key => bytes
CallbackArg => bytes

GetAllResponse

GetAllResponse => NumberOfKeyValuePair Key value {Key value}
NumberOfKeyValuePair => fixedSize = 4 bytes, type = int32
Key => bytes
value => bytes

PutAllRequest

PutAllRequest => RegionName NumberOfKeys Key Value{Key Value} CallbackArg
RegionName => (variable size, type = String)
NumberOfKeys => fixedSize = 4 bytes, type = int32
Key => bytes
Value => defined above
CallbackArg => bytes

PutAllResponse

...

TODO: we still need to add some stuff around API's


Metadata

The purpose of a 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.

...

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

Examples

PutRequest

string regionName = "ExampleRegion"

...

MessageHeader

 

RequestHeader

PutRequest

Size PartialMessage CorrelationIdRequestType apiVersion hasMetaDataRegionName Key CallbackArg Value ( ValueHeader value )

Size = Size of Request (65)

0x00 0x00 0x00 0x42

RequestType (PutRequestType = 3)

0x00 0x03

RegionName(type:String, value:"ExampleRegion" )

 len = 0x00 0x0d

Utf Encoding = 0x45 0x78 0x61 0x6d 0x70 0x6c 0x65 0x52 0x65 0x67 0x69 0x6f 0x6e 

Size = (number of serialized bytes = 35)

 0x00 0x00 0x00 0x23

PartialMessage = (type = Boolean, value = false)

0x00

apiVersion (1)

0x01

Key (Serialzied using geode types, value = 101)

 Geode Int type = 0x39

Value = 0x00 0x00 0x00 0x65 

isPartialBytes = (It contains all serialized bytes, type = boolean)

0x00

CorrelationId = 1

0x00 0x00 0x00 0x01 

hasMetaData (false)

0x00

CallbackArg (Serialzied using geode types, value = null)

Value = 0x29 

value (Serialized as Geode String type, value = "New Geode Client Server Protocol")

Geode String type = 0x57

Serialized Encoded length = 0x00 0x20

Encoded String = 0x4e 0x65 0x77 0x20 0x47 0x65 0x6f 0x64 0x65 0x20 0x43 0x6c 0x69 0x65 0x6e 0x74

0x20 0x53 0x65 0x72 0x76 0x65 0x72 0x20 0x50 0x72 0x6f 0x74 0x6f 0x63 0x6f 0x6c

 

PutResponse

MessageHeader

ResponseHeaderPutResponse
Size PartialMessage CorrelationIdResponseTypeId hasMetaDataSuccess

Size = Size of Request (4)

0x00 0x00 0x00 0x04

ResponseTypeId (FullResponse, type=int16, value =1)

0x00 0x01

Success(type=boolean, value = true)

0x01

PartialMessage = (type = Boolean, value = false)

0x00

hasMetaData (false)

0x00

 

CorrelationId = 1

0x00 0x00 0x00 0x01 

  

...