A constructor to create a Message
A constructor to create a Message
The payload of the message
The key of the message (null, if none)
The compression codec used on the contents of the message (if any)
The offset into the payload array used to extract payload
The size of the payload to use
The attributes stored with this message
Retrieve the previously computed CRC for this message
The compression codec used with this message
Compute the checksum of the message from the message contents
Throw an InvalidMessageException if isValid is false for this message
Does the message have a key?
Is the payload of this message null
Returns true if the crc stored with the message matches the crc computed off the message contents
A ByteBuffer containing the message key
The length of the key in bytes
The magic version of this message
A ByteBuffer containing the content of the message
The length of the message value in bytes
The complete serialized size of this message in bytes (including crc, header attributes, etc)
A message. The format of an N byte message is the following:
1. 4 byte CRC32 of the message 2. 1 byte "magic" identifier to allow format changes, value is 0 currently 3. 1 byte "attributes" identifier to allow annotations on the message independent of the version (e.g. compression enabled, type of codec used) 4. 4 byte key length, containing length K 5. K byte key 6. 4 byte payload length, containing length V 7. V byte payload
Default constructor wraps an existing ByteBuffer with the Message object with no change to the contents.