Package org.apache.pulsar.broker.service
Class EntryAndMetadata
java.lang.Object
org.apache.pulsar.broker.service.EntryAndMetadata
- All Implemented Interfaces:
Entry
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntryAndMetadatastatic EntryAndMetadataintGet cached sticky key hash or return STICKY_KEY_HASH_NOT_SET if it's not cached.byte[]getData()byte[]io.netty.buffer.ByteBuflonglongintintgetOrUpdateCachedStickyKeyHash(ToIntFunction<byte[]> makeStickyKeyHash) Get cached sticky key hash or calculate it based on the sticky key if it's not cached.byte[]booleanrelease()toString()unwrap()
-
Method Details
-
create
public static EntryAndMetadata create(Entry entry, org.apache.pulsar.common.api.proto.MessageMetadata metadata) -
create
-
getStickyKey
public byte[] getStickyKey() -
toString
-
getData
public byte[] getData() -
getDataAndRelease
public byte[] getDataAndRelease()- Specified by:
getDataAndReleasein interfaceEntry
-
getLength
public int getLength() -
getDataBuffer
public io.netty.buffer.ByteBuf getDataBuffer()- Specified by:
getDataBufferin interfaceEntry
-
getPosition
- Specified by:
getPositionin interfaceEntry
-
getLedgerId
public long getLedgerId()- Specified by:
getLedgerIdin interfaceEntry
-
getEntryId
public long getEntryId()- Specified by:
getEntryIdin interfaceEntry
-
release
public boolean release() -
getOrUpdateCachedStickyKeyHash
Get cached sticky key hash or calculate it based on the sticky key if it's not cached.- Parameters:
makeStickyKeyHash- function to calculate the sticky key hash- Returns:
- the sticky key hash
-
getCachedStickyKeyHash
public int getCachedStickyKeyHash()Get cached sticky key hash or return STICKY_KEY_HASH_NOT_SET if it's not cached.- Returns:
- the cached sticky key hash or STICKY_KEY_HASH_NOT_SET if it's not cached
-
unwrap
-