Record Class LogAppendResult
java.lang.Object
java.lang.Record
org.j7m.middleware.api.durablelog.LogAppendResult
- Record Components:
stream- logical stream identifierfirstOffset- first offset assigned by the appendlastOffset- last offset assigned by the appendrecordCount- number of records appendedbytesWritten- encoded bytes writtenfsynced- whether the append forced storage sync
- All Implemented Interfaces:
Serializable
public record LogAppendResult(LogStreamId stream, LogOffset firstOffset, LogOffset lastOffset, int recordCount, long bytesWritten, boolean fsynced)
extends Record
implements Serializable
Immutable append result.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLogAppendResult(LogStreamId stream, LogOffset firstOffset, LogOffset lastOffset, int recordCount, long bytesWritten, boolean fsynced) Creates a validated append result. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebytesWrittenrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstOffsetrecord component.booleanfsynced()Returns the value of thefsyncedrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastOffsetrecord component.intReturns the value of therecordCountrecord component.stream()Returns the value of thestreamrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LogAppendResult
public LogAppendResult(LogStreamId stream, LogOffset firstOffset, LogOffset lastOffset, int recordCount, long bytesWritten, boolean fsynced) Creates a validated append result.
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
stream
-
firstOffset
Returns the value of thefirstOffsetrecord component.- Returns:
- the value of the
firstOffsetrecord component
-
lastOffset
Returns the value of thelastOffsetrecord component.- Returns:
- the value of the
lastOffsetrecord component
-
recordCount
public int recordCount()Returns the value of therecordCountrecord component.- Returns:
- the value of the
recordCountrecord component
-
bytesWritten
public long bytesWritten()Returns the value of thebytesWrittenrecord component.- Returns:
- the value of the
bytesWrittenrecord component
-
fsynced
-