public abstract class AbstractBatchMessageContainer extends Object implements BatchMessageContainerBase
| Modifier and Type | Field and Description |
|---|---|
protected PulsarApi.CompressionType |
compressionType |
protected CompressionCodec |
compressor |
protected long |
currentBatchSizeBytes |
protected long |
currentTxnidLeastBits |
protected long |
currentTxnidMostBits |
protected static int |
INITIAL_BATCH_BUFFER_SIZE |
protected int |
maxBatchSize |
protected int |
maxBytesInBatch |
protected int |
maxNumMessagesInBatch |
protected int |
numMessagesInBatch |
protected ProducerImpl |
producer |
protected String |
producerName |
protected String |
topicName |
| Constructor and Description |
|---|
AbstractBatchMessageContainer() |
| Modifier and Type | Method and Description |
|---|---|
ProducerImpl.OpSendMsg |
createOpSendMsg()
Create OpSendMsg, producer use OpSendMsg to send to the broker.
|
List<ProducerImpl.OpSendMsg> |
createOpSendMsgs()
Create list of OpSendMsg, producer use OpSendMsg to send to the broker.
|
long |
getCurrentBatchSize() |
int |
getNumMessagesInBatch() |
boolean |
hasSameTxn(MessageImpl<?> msg)
Check whether the added message belong to the same txn with batch message container.
|
boolean |
haveEnoughSpace(MessageImpl<?> msg)
Check the batch message container have enough space for the message want to add.
|
protected boolean |
isBatchFull() |
void |
setProducer(ProducerImpl<?> producer)
Set producer of the message batch container.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, hasSameSchemaclear, discard, isEmpty, isMultiBatchesprotected PulsarApi.CompressionType compressionType
protected CompressionCodec compressor
protected String topicName
protected String producerName
protected ProducerImpl producer
protected int maxNumMessagesInBatch
protected int maxBytesInBatch
protected int numMessagesInBatch
protected long currentBatchSizeBytes
protected long currentTxnidMostBits
protected long currentTxnidLeastBits
protected static final int INITIAL_BATCH_BUFFER_SIZE
protected int maxBatchSize
public boolean haveEnoughSpace(MessageImpl<?> msg)
BatchMessageContainerBasehaveEnoughSpace in interface BatchMessageContainerBasemsg - the message want to addprotected boolean isBatchFull()
public int getNumMessagesInBatch()
getNumMessagesInBatch in interface BatchMessageContainerpublic long getCurrentBatchSize()
getCurrentBatchSize in interface BatchMessageContainerpublic List<ProducerImpl.OpSendMsg> createOpSendMsgs() throws IOException
BatchMessageContainerBasecreateOpSendMsgs in interface BatchMessageContainerBaseIOExceptionpublic ProducerImpl.OpSendMsg createOpSendMsg() throws IOException
BatchMessageContainerBasecreateOpSendMsg in interface BatchMessageContainerBaseIOExceptionpublic void setProducer(ProducerImpl<?> producer)
BatchMessageContainerBasesetProducer in interface BatchMessageContainerBaseproducer - producerpublic boolean hasSameTxn(MessageImpl<?> msg)
BatchMessageContainerBasehasSameTxn in interface BatchMessageContainerBasemsg - added messageCopyright © 2017–2020 Apache Software Foundation. All rights reserved.