Record Class CoordinationEntry
java.lang.Object
java.lang.Record
io.krabka.streams.coordination.CoordinationEntry
- Record Components:
offset- the offset of the record in the partition of its rolekey- the decoded record keyvalue- the decoded record value, and empty for a tombstone
public record CoordinationEntry(long offset, CoordinationKey key, Optional<CoordinationValue> value)
extends Record
One decoded record of
CoordinationCodec.TOPIC, with the offset it sits at.
CoordinationTransport.readRoleRecords(Role) returns these in offset order,
and RoleStateBuilder folds them. The offset is the join sequence of a
registration, because log compaction keeps the offset of every record it retains. The
succession rules rank candidates on that offset.
The value is empty for a tombstone. A tombstone of a registration key deregisters one member, and a tombstone of a lease key clears the lease of one role.
Example
for (CoordinationEntry entry : transport.readRoleRecords(role)) {
builder.apply(entry);
}
RoleState state = builder.build();
-
Constructor Summary
ConstructorsConstructorDescriptionCoordinationEntry(long offset, CoordinationKey key, Optional<CoordinationValue> value) Rejects a null key and a null value holder. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.longoffset()Returns the value of theoffsetrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
CoordinationEntry
Rejects a null key and a null value holder.- Parameters:
offset- the offset of the record in the partition of its rolekey- the decoded record keyvalue- the decoded record value, and empty for a tombstone
-
-
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. -
offset
-
key
-
value
-