Record Class TwoPhaseCommands.CoordPrepare
java.lang.Object
java.lang.Record
com.loomcache.server.transaction.twopc.TwoPhaseCommands.CoordPrepare
- Record Components:
txId- transaction id (non-null)participantGroupIds- sorted, de-duplicated participant group IDsoperationPayload- serialized ReplicatedTransactionCommand so a new coord can re-derive per-group slices without needing the client to re-send the TX body
- All Implemented Interfaces:
TwoPhaseCommands
- Enclosing interface:
TwoPhaseCommands
public static record TwoPhaseCommands.CoordPrepare(@NonNull UUID txId, int @NonNull [] participantGroupIds, byte @NonNull [] operationPayload)
extends Record
implements TwoPhaseCommands
Durable coordinator PREPARE record, replicated through raft-0's own log.
Captures enough state that a new raft-0 leader (after mid-TX churn) can
reconstruct the in-flight TX roster and either (a) re-scatter PREPARE_GROUP
to participants, OR (b) default to ABORT when it cannot determine whether
votes completed under the old coord.
-
Nested Class Summary
Nested classes/interfaces inherited from interface TwoPhaseCommands
TwoPhaseCommands.CoordDecide, TwoPhaseCommands.CoordPrepare, TwoPhaseCommands.DecideAck, TwoPhaseCommands.DecideGroup, TwoPhaseCommands.DecideQuery, TwoPhaseCommands.Decision, TwoPhaseCommands.FrameWriter, TwoPhaseCommands.Kind, TwoPhaseCommands.PrepareAck, TwoPhaseCommands.PrepareGroup, TwoPhaseCommands.Vote -
Field Summary
Fields inherited from interface TwoPhaseCommands
MAX_OPERATION_PAYLOAD_BYTES, MAX_PARTICIPANT_GROUP_COUNT, MAX_REASON_UTF_BYTES -
Constructor Summary
ConstructorsConstructorDescriptionCoordPrepare(@NonNull UUID txId, int @NonNull [] participantGroupIds, byte @NonNull [] operationPayload) Creates an instance of aCoordPreparerecord class. -
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.byte @NonNull []Returns the value of theoperationPayloadrecord component.int @NonNull []Returns the value of theparticipantGroupIdsrecord component.byte @NonNull []final StringtoString()Returns a string representation of this record class.@NonNull UUIDtxId()Returns the value of thetxIdrecord component.
-
Constructor Details
-
CoordPrepare
public CoordPrepare(@NonNull UUID txId, int @NonNull [] participantGroupIds, byte @NonNull [] operationPayload) Creates an instance of aCoordPreparerecord class.- Parameters:
txId- the value for thetxIdrecord componentparticipantGroupIds- the value for theparticipantGroupIdsrecord componentoperationPayload- the value for theoperationPayloadrecord component
-
-
Method Details
-
participantGroupIds
public int @NonNull [] participantGroupIds()Returns the value of theparticipantGroupIdsrecord component.- Returns:
- the value of the
participantGroupIdsrecord component
-
operationPayload
public byte @NonNull [] operationPayload()Returns the value of theoperationPayloadrecord component.- Returns:
- the value of the
operationPayloadrecord component
-
serialize
public byte @NonNull [] serialize() -
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. All components in this record class are compared withObjects::equals(Object,Object). -
txId
-