Class EntryAndMetadata

java.lang.Object
org.apache.pulsar.broker.service.EntryAndMetadata
All Implemented Interfaces:
Entry

public class EntryAndMetadata extends Object implements Entry
  • Method Details

    • create

      public static EntryAndMetadata create(Entry entry, org.apache.pulsar.common.api.proto.MessageMetadata metadata)
    • create

      public static EntryAndMetadata create(Entry entry)
    • getStickyKey

      public byte[] getStickyKey()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getData

      public byte[] getData()
      Specified by:
      getData in interface Entry
    • getDataAndRelease

      public byte[] getDataAndRelease()
      Specified by:
      getDataAndRelease in interface Entry
    • getLength

      public int getLength()
      Specified by:
      getLength in interface Entry
    • getDataBuffer

      public io.netty.buffer.ByteBuf getDataBuffer()
      Specified by:
      getDataBuffer in interface Entry
    • getPosition

      public Position getPosition()
      Specified by:
      getPosition in interface Entry
    • getLedgerId

      public long getLedgerId()
      Specified by:
      getLedgerId in interface Entry
    • getEntryId

      public long getEntryId()
      Specified by:
      getEntryId in interface Entry
    • release

      public boolean release()
      Specified by:
      release in interface Entry
    • getOrUpdateCachedStickyKeyHash

      public int getOrUpdateCachedStickyKeyHash(ToIntFunction<byte[]> makeStickyKeyHash)
      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

      public Entry unwrap()