类 AbstractBatchMessageContainer
java.lang.Object
org.apache.pulsar.client.impl.AbstractBatchMessageContainer
- 所有已实现的接口:
BatchMessageContainer,BatchMessageContainerBase
public abstract class AbstractBatchMessageContainer
extends Object
implements BatchMessageContainerBase
Batch message container framework.
-
字段概要
字段修饰符和类型字段说明protected intprotected CompressionTypeprotected CompressionCodecprotected longprotected longprotected longprotected static final intprotected static final intprotected intprotected intprotected intprotected intprotected intprotected ProducerImplprotected String -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidCreate OpSendMsg, producer use OpSendMsg to send to the broker.Create list of OpSendMsg, producer use OpSendMsg to send to the broker.intlonglongGet the timestamp in nanoseconds when the 1st message is added into the batch container.protected intintintbooleanhasSameTxn(MessageImpl<?> msg) Check whether the added message belong to the same txn with batch message container.booleanhaveEnoughSpace(MessageImpl<?> msg) Check the batch message container have enough space for the message want to add.protected booleanvoidsetProducer(ProducerImpl<?> producer) Set producer of the message batch container.protected void从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.apache.pulsar.client.api.BatchMessageContainer
clear, discard, isEmpty, isMultiBatches从接口继承的方法 org.apache.pulsar.client.impl.BatchMessageContainerBase
add, hasSameSchema
-
字段详细资料
-
compressionType
-
compressor
-
topicName
-
producer
-
maxNumMessagesInBatch
protected int maxNumMessagesInBatch -
maxBytesInBatch
protected int maxBytesInBatch -
numMessagesInBatch
protected int numMessagesInBatch -
currentBatchSizeBytes
protected long currentBatchSizeBytes -
batchAllocatedSizeBytes
protected int batchAllocatedSizeBytes -
currentTxnidMostBits
protected long currentTxnidMostBits -
currentTxnidLeastBits
protected long currentTxnidLeastBits -
INITIAL_BATCH_BUFFER_SIZE
protected static final int INITIAL_BATCH_BUFFER_SIZE- 另请参阅:
-
INITIAL_MESSAGES_NUM
protected static final int INITIAL_MESSAGES_NUM- 另请参阅:
-
maxBatchSize
protected int maxBatchSize -
maxMessagesNum
protected int maxMessagesNum
-
-
构造器详细资料
-
AbstractBatchMessageContainer
public AbstractBatchMessageContainer()
-
-
方法详细资料
-
haveEnoughSpace
从接口复制的说明:BatchMessageContainerBaseCheck 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.
-
getMaxMessageSize
protected int getMaxMessageSize() -
isBatchFull
protected boolean isBatchFull() -
getNumMessagesInBatch
public int getNumMessagesInBatch()- 指定者:
getNumMessagesInBatch在接口中BatchMessageContainer
-
getMaxMessagesNum
public int getMaxMessagesNum() -
getCurrentBatchSize
public long getCurrentBatchSize()- 指定者:
getCurrentBatchSize在接口中BatchMessageContainer
-
getBatchAllocatedSizeBytes
public int getBatchAllocatedSizeBytes() -
createOpSendMsgs
从接口复制的说明:BatchMessageContainerBaseCreate list of OpSendMsg, producer use OpSendMsg to send to the broker.- 指定者:
createOpSendMsgs在接口中BatchMessageContainerBase- 返回:
- list of OpSendMsg
- 抛出:
IOException
-
createOpSendMsg
从接口复制的说明:BatchMessageContainerBaseCreate OpSendMsg, producer use OpSendMsg to send to the broker.- 指定者:
createOpSendMsg在接口中BatchMessageContainerBase- 返回:
- OpSendMsg
- 抛出:
IOException
-
setProducer
从接口复制的说明:BatchMessageContainerBaseSet producer of the message batch container.- 指定者:
setProducer在接口中BatchMessageContainerBase- 参数:
producer- producer
-
hasSameTxn
从接口复制的说明:BatchMessageContainerBaseCheck 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
-
getFirstAddedTimestamp
public long getFirstAddedTimestamp()从接口复制的说明:BatchMessageContainerBaseGet the timestamp in nanoseconds when the 1st message is added into the batch container.- 指定者:
getFirstAddedTimestamp在接口中BatchMessageContainerBase- 返回:
- the timestamp in nanoseconds or 0L if the batch container is empty
-
tryUpdateTimestamp
protected void tryUpdateTimestamp() -
clearTimestamp
protected void clearTimestamp()
-