-
方法概要
boolean
Add message to the batch message container.
Create OpSendMsg, producer use OpSendMsg to send to the broker.
Create list of OpSendMsg, producer use OpSendMsg to send to the broker.
long
Get the timestamp in nanoseconds when the 1st message is added into the batch container.
boolean
Check the batch message container has same schema with the message want to add.
boolean
Check whether the added message belong to the same txn with batch message container.
boolean
Check the batch message container have enough space for the message want to add.
void
Set producer of the message batch container.
-
方法详细资料
-
add
Add message to the batch message container.
- 参数:
msg - message will add to the batch message container
callback - message send callback
- 返回:
- true if the batch is full, otherwise false
-
haveEnoughSpace
Check the batch message container have enough space for the message want to add.
- 参数:
msg - the message want to add
- 返回:
- return true if the container have enough space for the specific message,
otherwise return false.
-
hasSameSchema
Check the batch message container has same schema with the message want to add.
- 参数:
msg - the message want to add
- 返回:
- return true if the container has same schema with the specific message,
otherwise return false.
-
setProducer
Set producer of the message batch container.
- 参数:
producer - producer
-
createOpSendMsgs
Create list of OpSendMsg, producer use OpSendMsg to send to the broker.
- 返回:
- list of OpSendMsg
- 抛出:
IOException
-
createOpSendMsg
Create OpSendMsg, producer use OpSendMsg to send to the broker.
- 返回:
- OpSendMsg
- 抛出:
IOException
-
hasSameTxn
Check whether the added message belong to the same txn with batch message container.
- 参数:
msg - added message
- 返回:
- belong to the same txn or not
-
getFirstAddedTimestamp
long getFirstAddedTimestamp()
Get the timestamp in nanoseconds when the 1st message is added into the batch container.
- 返回:
- the timestamp in nanoseconds or 0L if the batch container is empty