Package org.apache.pulsar.client.api
Interface MessageIdAdv
- All Superinterfaces:
Comparable<MessageId>,MessageId,Serializable
The
MessageId interface provided for advanced users.
All built-in MessageId implementations should be able to be cast to MessageIdAdv.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault intThe default implementation ofComparable.compareTo(Object).default BitSetGet the BitSet that indicates which messages in the batch.default intGet the batch index.default intGet the batch size.longGet the entry ID.default MessageIdAdvGet the message ID of the first chunk if the current message ID represents the position of a chunked message.longGet the ledger ID.default intGet the partition index.Methods inherited from interface org.apache.pulsar.client.api.MessageId
toByteArray
-
Method Details
-
getLedgerId
long getLedgerId()Get the ledger ID.- Returns:
- the ledger ID
-
getEntryId
long getEntryId()Get the entry ID.- Returns:
- the entry ID
-
getPartitionIndex
default int getPartitionIndex()Get the partition index.- Returns:
- -1 if the message is from a non-partitioned topic, otherwise the non-negative partition index
-
getBatchIndex
default int getBatchIndex()Get the batch index.- Returns:
- -1 if the message is not in a batch
-
getBatchSize
default int getBatchSize()Get the batch size.- Returns:
- 0 if the message is not in a batch
-
getAckSet
Get the BitSet that indicates which messages in the batch.- Returns:
- null if the message is a non-batched message
-
getFirstChunkMessageId
Get the message ID of the first chunk if the current message ID represents the position of a chunked message.- Returns:
- null if the message is not a chunked message
-
compareTo
The default implementation ofComparable.compareTo(Object).- Specified by:
compareToin interfaceComparable<MessageId>
-