...
Type | Number Of Bytes | Value | SerializedBytes |
---|---|---|---|
boolean | Fixed = 1 | true | 0x01 |
boolean | Fixed = 1 | false | 0x00 |
int8 | Fixed = 1 | 1 | 0x01 |
int16 | Fixed = 2 | 1 | 0x00 0x01 |
int32 | Fixed = 4 | 1 | 0x00 0x00 0x00 0x01 |
int64 | Fixed = 8 | 1 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 |
String(utf) | Variable
| "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 => bytes | Serialized 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.
MetaData | NumberOfMetadata MatadataKeyId MetadataKeyValue { MatadataKeyId MetadataKeyValue} |
---|---|
NumberOfMetadata | fixedSize = 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 Key | MetaData KeyId | MetaData Value | Description |
---|---|---|---|
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 Key | MetaData KeyId | MetaData Value | Description |
---|---|---|---|
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"
...