Record Class TwoPhaseCommands.PrepareAck
java.lang.Object
java.lang.Record
com.loomcache.server.transaction.twopc.TwoPhaseCommands.PrepareAck
- Record Components:
txId- transaction id (non-null)participantGroupId- the group that is votingvote- COMMIT or ABORT (non-null)reason- optional free-text reason (empty string when vote is COMMIT)
- All Implemented Interfaces:
TwoPhaseCommands
- Enclosing interface:
TwoPhaseCommands
public static record TwoPhaseCommands.PrepareAck(@NonNull UUID txId, int participantGroupId, @NonNull TwoPhaseCommands.Vote vote, @NonNull String reason)
extends Record
implements TwoPhaseCommands
Phase-1 vote from a participant group back to the coordinator.
-
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
ConstructorsConstructorDescriptionPrepareAck(@NonNull UUID txId, int participantGroupId, @NonNull TwoPhaseCommands.Vote vote, @NonNull String reason) Creates an instance of aPrepareAckrecord 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.intReturns the value of theparticipantGroupIdrecord component.@NonNull Stringreason()Returns the value of thereasonrecord component.byte @NonNull []final StringtoString()Returns a string representation of this record class.@NonNull UUIDtxId()Returns the value of thetxIdrecord component.@NonNull TwoPhaseCommands.Votevote()Returns the value of thevoterecord component.
-
Constructor Details
-
PrepareAck
public PrepareAck(@NonNull UUID txId, int participantGroupId, @NonNull TwoPhaseCommands.Vote vote, @NonNull String reason) Creates an instance of aPrepareAckrecord class.- Parameters:
txId- the value for thetxIdrecord componentparticipantGroupId- the value for theparticipantGroupIdrecord componentvote- the value for thevoterecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
txId
-
participantGroupId
public int participantGroupId()Returns the value of theparticipantGroupIdrecord component.- Returns:
- the value of the
participantGroupIdrecord component
-
vote
-
reason
-