Package io.camunda.zeebe.journal.file
Record Class UninitializedSegment
java.lang.Object
java.lang.Record
io.camunda.zeebe.journal.file.UninitializedSegment
public record UninitializedSegment(SegmentFile file, long segmentId, int maxSegmentSize, MappedByteBuffer buffer, io.camunda.zeebe.journal.file.JournalIndex journalIndex)
extends Record
Holds a normal segment file that hasn't been written to and that has no
SegmentDescriptor.-
Constructor Summary
ConstructorsConstructorDescriptionUninitializedSegment(SegmentFile file, long segmentId, int maxSegmentSize, MappedByteBuffer buffer, io.camunda.zeebe.journal.file.JournalIndex journalIndex) Creates an instance of aUninitializedSegmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbuffer()Returns the value of thebufferrecord component.final booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.final inthashCode()Returns a hash code value for this object.io.camunda.zeebe.journal.file.SegmentinitializeForUse(long index, long lastWrittenAsqn, io.camunda.zeebe.journal.file.JournalMetrics metrics) Creates a proper, initialized segment by writing aSegmentDescriptorwith the given index.io.camunda.zeebe.journal.file.JournalIndexReturns the value of thejournalIndexrecord component.intReturns the value of themaxSegmentSizerecord component.longReturns the value of thesegmentIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UninitializedSegment
public UninitializedSegment(SegmentFile file, long segmentId, int maxSegmentSize, MappedByteBuffer buffer, io.camunda.zeebe.journal.file.JournalIndex journalIndex) Creates an instance of aUninitializedSegmentrecord class.- Parameters:
file- the value for thefilerecord componentsegmentId- the value for thesegmentIdrecord componentmaxSegmentSize- the value for themaxSegmentSizerecord componentbuffer- the value for thebufferrecord componentjournalIndex- the value for thejournalIndexrecord component
-
-
Method Details
-
initializeForUse
public io.camunda.zeebe.journal.file.Segment initializeForUse(long index, long lastWrittenAsqn, io.camunda.zeebe.journal.file.JournalMetrics metrics) Creates a proper, initialized segment by writing aSegmentDescriptorwith the given index. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-
segmentId
public long segmentId()Returns the value of thesegmentIdrecord component.- Returns:
- the value of the
segmentIdrecord component
-
maxSegmentSize
public int maxSegmentSize()Returns the value of themaxSegmentSizerecord component.- Returns:
- the value of the
maxSegmentSizerecord component
-
buffer
Returns the value of thebufferrecord component.- Returns:
- the value of the
bufferrecord component
-
journalIndex
public io.camunda.zeebe.journal.file.JournalIndex journalIndex()Returns the value of thejournalIndexrecord component.- Returns:
- the value of the
journalIndexrecord component
-