Interface Message
-
- All Known Subinterfaces:
RequestMessage,ResponseMessage
- All Known Implementing Classes:
AbstractMessage,AckMessage,DataMessage,FailMessage,FinishMessage,PingMessage,PongMessage,StartMessage
public interface Message
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NetworkBufferbody()An optional body for the message.NetworkBufferencode(io.netty.buffer.ByteBuf buf)Serializes this object by writing into the given ByteBuf.booleanhasBody()Whether to include the body of the message in the same frame as the message.intpartition()The partition idvoidrelease()Release the messageintsequenceNumber()The message sequence numberMessageTypetype()Used to identify this message type.
-
-
-
Method Detail
-
encode
NetworkBuffer encode(io.netty.buffer.ByteBuf buf)
Serializes this object by writing into the given ByteBuf.- Parameters:
buf-ByteBufthe header buffer, if use zero-copy. Otherwise it will contain header and body.- Returns:
NetworkBufferbody buffer, if use zero-copy
-
type
MessageType type()
Used to identify this message type.
-
hasBody
boolean hasBody()
Whether to include the body of the message in the same frame as the message.
-
body
NetworkBuffer body()
An optional body for the message.
-
sequenceNumber
int sequenceNumber()
The message sequence number
-
partition
int partition()
The partition id
-
release
void release()
Release the message
-
-