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 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 |
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 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 - producerCopyright © 2017–2020 Apache Software Foundation. All rights reserved.