Versions Compared

Key

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

...

Following table contains the request type and its corresponding Api id. RequestTypeId The ApiId would recognize the API, which client want to invoke on the server. The request format will contain the 2-bytes(int16) for request type Api id. It will be marked as requestTypeId ApiId in request format.

RequestTypeRequestTypeIdApiId
MetaDataConfigRequestType1
AuthenticationRequestType 2
PutRequestType 3
GetRequestType 4
PutAllRequestType 5
GetAllRequestType 6
FunctionRequestType 7
CreateRequestType 8
InvalidateRequestType 9
DestroyRequestType 10
KeySetRequestType 11
ValuesRequestType 12
EntrySetRequestType 13
ContainsValueForKeyRequestType 14
ContainsKeyRequestType 15
ContainsValueRequestType 16
RemoveAllRequestType 17
SizeRequestType 18
PutIfAbsentRequestType 19
RemoveIfValueIsSameRequestType 20
ReplaceIfValueIsSameRequestType 21
ReplaceIfValueExistType 22

...

API version will be associated with request api. The request fromat will contain 1-byte for version. It will be marked as apiVerision ApiVersion in request format. Its current value will be 1.

...

The purpose of correlation id to match the request and its corresponding response. The request format will contain the 4-bytes(int32) for correlation Id. It will be marked as correlationIdas CorrelationId in request format. 

Object Type

...

A message is series of bytes which contains request or response. If the message is large, then we will have provision to divide the message into small messages. The message will be sent in following way.

Message --=> MessageHeader (Request | Response)
MessageHeader --=> defined below
Request --=> defined below
Response --=> defined below

 

MessageHeader

...

  • If a message is sent in multiple sub-messages then it will be used for combining the whole message. 
  • The Client would use correlation id to match the response to its request as well.
)
MessageHeader --=> Size isPartialMessage CorrelationIdDescription
Size --=> fixedSize = 4 bytes, type = int32(Size of request or response
isPartialMessage --=> fixedSize = 1 byte, type = boolean 
CorrelationId --=> fixedSize = 4 bytes, type = int32 


Request Format

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

Request => RequestHeader [MetaData] RequestAPI
RequestHeader => defined below
MetaData => optional

RequestAPI => (PutRequest | GetRequest | PutAllRequest | GetAllRequest)

 

RequestHeader

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

)
RequestHeader => ApiId apiVersion hasMetaDataDescription
ApiId
Request --> RequestTypeId apiVersion hasMetaData [MetaData] RequestAPI
RequestTypeId --> fixedSize = 2 bytes, type = int16 
apiVersion --> fixedSize = 2 bytes, type = int16 
hasMetaData --> fixedSize = 1 byte, type = boolean (if there is any meta data associated with this requestMetaData --> optional

RequestAPI --> (PutRequest | GetRequest | PutAllRequest | GetAllRequest)

 

Response Format

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

  

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

 

Response Header

 The response The resposne header will have resposneType, which indicates its partial response, full response or error. A hasMetaData flag indicates whether the response contains some metadata.

  

APIResponse –> (PutResponse | GetResponse | PutAlLRequest | GetAllRequest)
Response --ResponseHeader => (ResponseTypeId | ErrorCode) hasMetaData [MetaData] APIResponseDescription
ResponseTypeId --> fixedSize = 2 bytes, type = int16 
ErrorCode --> fixedSize = 2 bytes, type = int16 
hasMetaData --> fixedSize = 1 byte, type = boolean(if there is any meta data associated with this request)
MetaData --> Optional

 

 

ValueObject

The purpose of ValueObject to divide the large serialized value into small value chunks. We will have SerializedBytesHeader with each partial serialized bytes. It would contain size of 

...