Class LoggedEventImpl
java.lang.Object
io.camunda.zeebe.logstreams.impl.log.LoggedEventImpl
- All Implemented Interfaces:
LoggedEvent,BufferWriter
Represents the implementation of the logged event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.agrona.DirectBufferintintlonggetKey()intorg.agrona.DirectBuffershortintlonglonglongorg.agrona.DirectBufferintintbooleanvoidreadMetadata(BufferReader reader) Wraps the given buffer to read the event's metadatavoidreadValue(BufferReader reader) Wraps the given buffer to read the event's value.toString()voidwrap(org.agrona.DirectBuffer buffer, int offset) voidwrite(org.agrona.MutableDirectBuffer destination, int offset)
-
Constructor Details
-
LoggedEventImpl
public LoggedEventImpl()
-
-
Method Details
-
wrap
public void wrap(org.agrona.DirectBuffer buffer, int offset) -
getBuffer
public org.agrona.DirectBuffer getBuffer() -
getFragmentLength
public int getFragmentLength() -
getFragmentOffset
public int getFragmentOffset() -
isProcessed
public boolean isProcessed()- Specified by:
isProcessedin interfaceLoggedEvent- Returns:
- returns true if record is already processed
-
getPosition
public long getPosition()- Specified by:
getPositionin interfaceLoggedEvent- Returns:
- the event's position in the log.
-
getSourceEventPosition
public long getSourceEventPosition()- Specified by:
getSourceEventPositionin interfaceLoggedEvent- 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:
getKeyin interfaceLoggedEvent- Returns:
- the key of the event
-
getTimestamp
public long getTimestamp()- Specified by:
getTimestampin interfaceLoggedEvent- Returns:
- the timestamp of the event, the ActorClock current time when the event was written
-
getMetadata
public org.agrona.DirectBuffer getMetadata()- Specified by:
getMetadatain interfaceLoggedEvent- Returns:
- a buffer containing the event's metadata at offset
LoggedEvent.getMetadataOffset()and with lengthLoggedEvent.getMetadataLength().
-
getMetadataOffset
public int getMetadataOffset()- Specified by:
getMetadataOffsetin interfaceLoggedEvent- Returns:
- the offset of the event's metadata
-
getMetadataLength
public short getMetadataLength()- Specified by:
getMetadataLengthin interfaceLoggedEvent- Returns:
- the length of the event's metadata
-
readMetadata
Description copied from interface:LoggedEventWraps the given buffer to read the event's metadata- Specified by:
readMetadatain interfaceLoggedEvent- Parameters:
reader- the reader to read into
-
getValueBuffer
public org.agrona.DirectBuffer getValueBuffer()- Specified by:
getValueBufferin interfaceLoggedEvent- Returns:
- a buffer containing the value of the event at offset
LoggedEvent.getValueOffset()()} and with lengthLoggedEvent.getValueLength()()}.
-
getValueOffset
public int getValueOffset()- Specified by:
getValueOffsetin interfaceLoggedEvent- Returns:
- the buffer offset where the event's value can read from
-
getValueLength
public int getValueLength()- Specified by:
getValueLengthin interfaceLoggedEvent- Returns:
- the length of the event's value
-
readValue
Description copied from interface:LoggedEventWraps the given buffer to read the event's value.- Specified by:
readValuein interfaceLoggedEvent- Parameters:
reader- the buffer to read from
-
toString
-
getLength
public int getLength()- Specified by:
getLengthin interfaceBufferWriter
-
write
public void write(org.agrona.MutableDirectBuffer destination, int offset) - Specified by:
writein interfaceBufferWriter
-