类 AbstractBatchMessageContainer
- java.lang.Object
-
- org.apache.pulsar.client.impl.AbstractBatchMessageContainer
-
- 所有已实现的接口:
org.apache.pulsar.client.api.BatchMessageContainer
,BatchMessageContainerBase
public abstract class AbstractBatchMessageContainer extends java.lang.Object implements BatchMessageContainerBase
Batch message container framework.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected org.apache.pulsar.common.api.proto.CompressionType
compressionType
protected org.apache.pulsar.common.compression.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 java.lang.String
producerName
protected java.lang.String
topicName
-
构造器概要
构造器 构造器 说明 AbstractBatchMessageContainer()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ProducerImpl.OpSendMsg
createOpSendMsg()
Create OpSendMsg, producer use OpSendMsg to send to the broker.java.util.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.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.apache.pulsar.client.impl.BatchMessageContainerBase
add, hasSameSchema
-
-
-
-
字段详细资料
-
compressionType
protected org.apache.pulsar.common.api.proto.CompressionType compressionType
-
compressor
protected org.apache.pulsar.common.compression.CompressionCodec compressor
-
topicName
protected java.lang.String topicName
-
producerName
protected java.lang.String producerName
-
producer
protected ProducerImpl producer
-
maxNumMessagesInBatch
protected int maxNumMessagesInBatch
-
maxBytesInBatch
protected int maxBytesInBatch
-
numMessagesInBatch
protected int numMessagesInBatch
-
currentBatchSizeBytes
protected long currentBatchSizeBytes
-
currentTxnidMostBits
protected long currentTxnidMostBits
-
currentTxnidLeastBits
protected long currentTxnidLeastBits
-
INITIAL_BATCH_BUFFER_SIZE
protected static final int INITIAL_BATCH_BUFFER_SIZE
- 另请参阅:
- 常量字段值
-
maxBatchSize
protected int maxBatchSize
-
-
方法详细资料
-
haveEnoughSpace
public boolean haveEnoughSpace(MessageImpl<?> msg)
从接口复制的说明:BatchMessageContainerBase
Check the batch message container have enough space for the message want to add.- 指定者:
haveEnoughSpace
在接口中BatchMessageContainerBase
- 参数:
msg
- the message want to add- 返回:
- return true if the container have enough space for the specific message, otherwise return false.
-
isBatchFull
protected boolean isBatchFull()
-
getNumMessagesInBatch
public int getNumMessagesInBatch()
- 指定者:
getNumMessagesInBatch
在接口中org.apache.pulsar.client.api.BatchMessageContainer
-
getCurrentBatchSize
public long getCurrentBatchSize()
- 指定者:
getCurrentBatchSize
在接口中org.apache.pulsar.client.api.BatchMessageContainer
-
createOpSendMsgs
public java.util.List<ProducerImpl.OpSendMsg> createOpSendMsgs() throws java.io.IOException
从接口复制的说明:BatchMessageContainerBase
Create list of OpSendMsg, producer use OpSendMsg to send to the broker.- 指定者:
createOpSendMsgs
在接口中BatchMessageContainerBase
- 返回:
- list of OpSendMsg
- 抛出:
java.io.IOException
-
createOpSendMsg
public ProducerImpl.OpSendMsg createOpSendMsg() throws java.io.IOException
从接口复制的说明:BatchMessageContainerBase
Create OpSendMsg, producer use OpSendMsg to send to the broker.- 指定者:
createOpSendMsg
在接口中BatchMessageContainerBase
- 返回:
- OpSendMsg
- 抛出:
java.io.IOException
-
setProducer
public void setProducer(ProducerImpl<?> producer)
从接口复制的说明:BatchMessageContainerBase
Set producer of the message batch container.- 指定者:
setProducer
在接口中BatchMessageContainerBase
- 参数:
producer
- producer
-
hasSameTxn
public boolean hasSameTxn(MessageImpl<?> msg)
从接口复制的说明:BatchMessageContainerBase
Check whether the added message belong to the same txn with batch message container.- 指定者:
hasSameTxn
在接口中BatchMessageContainerBase
- 参数:
msg
- added message- 返回:
- belong to the same txn or not
-
-