Class LoggedEventImpl

java.lang.Object
io.camunda.zeebe.logstreams.impl.log.LoggedEventImpl
All Implemented Interfaces:
LoggedEvent, ReadableFragment, BufferWriter

public final class LoggedEventImpl extends Object implements ReadableFragment, LoggedEvent
Represents the implementation of the logged event.
  • Constructor Details

    • LoggedEventImpl

      public LoggedEventImpl()
  • Method Details

    • wrap

      public void wrap(org.agrona.DirectBuffer buffer, int offset)
    • getStreamId

      public int getStreamId()
      Specified by:
      getStreamId in interface ReadableFragment
    • getType

      public int getType()
      Specified by:
      getType in interface ReadableFragment
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface ReadableFragment
    • getMessageOffset

      public int getMessageOffset()
      Specified by:
      getMessageOffset in interface ReadableFragment
    • getMessageLength

      public int getMessageLength()
      Specified by:
      getMessageLength in interface ReadableFragment
    • getBuffer

      public org.agrona.DirectBuffer getBuffer()
      Specified by:
      getBuffer in interface ReadableFragment
    • getFragmentLength

      public int getFragmentLength()
    • getFragmentOffset

      public int getFragmentOffset()
    • getPosition

      public long getPosition()
      Specified by:
      getPosition in interface LoggedEvent
      Returns:
      the event's position in the log.
    • getSourceEventPosition

      public long getSourceEventPosition()
      Specified by:
      getSourceEventPosition in interface LoggedEvent
      Returns:
      the position of the event which causes this event. Returns a negative value if no such an event exists.
    • getKey

      public long getKey()
      Specified by:
      getKey in interface LoggedEvent
      Returns:
      the key of the event
    • getTimestamp

      public long getTimestamp()
      Specified by:
      getTimestamp in interface LoggedEvent
      Returns:
      the timestamp of the event, the ActorClock current time when the event was written
    • getMetadata

      public org.agrona.DirectBuffer getMetadata()
      Specified by:
      getMetadata in interface LoggedEvent
      Returns:
      a buffer containing the event's metadata at offset LoggedEvent.getMetadataOffset() and with length LoggedEvent.getMetadataLength().
    • getMetadataOffset

      public int getMetadataOffset()
      Specified by:
      getMetadataOffset in interface LoggedEvent
      Returns:
      the offset of the event's metadata
    • getMetadataLength

      public short getMetadataLength()
      Specified by:
      getMetadataLength in interface LoggedEvent
      Returns:
      the length of the event's metadata
    • readMetadata

      public void readMetadata(BufferReader reader)
      Description copied from interface: LoggedEvent
      Wraps the given buffer to read the event's metadata
      Specified by:
      readMetadata in interface LoggedEvent
      Parameters:
      reader - the reader to read into
    • getValueBuffer

      public org.agrona.DirectBuffer getValueBuffer()
      Specified by:
      getValueBuffer in interface LoggedEvent
      Returns:
      a buffer containing the value of the event at offset LoggedEvent.getValueOffset() ()} and with length LoggedEvent.getValueLength() ()}.
    • getValueOffset

      public int getValueOffset()
      Specified by:
      getValueOffset in interface LoggedEvent
      Returns:
      the buffer offset where the event's value can read from
    • getValueLength

      public int getValueLength()
      Specified by:
      getValueLength in interface LoggedEvent
      Returns:
      the length of the event's value
    • readValue

      public void readValue(BufferReader reader)
      Description copied from interface: LoggedEvent
      Wraps the given buffer to read the event's value.
      Specified by:
      readValue in interface LoggedEvent
      Parameters:
      reader - the buffer to read from
    • toString

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

      public int getLength()
      Specified by:
      getLength in interface BufferWriter
    • write

      public void write(org.agrona.MutableDirectBuffer destination, int offset)
      Specified by:
      write in interface BufferWriter