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 IDs
operationPayload - 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.
  • Constructor Details

    • CoordPrepare

      public CoordPrepare(@NonNull UUID txId, int @NonNull [] participantGroupIds, byte @NonNull [] operationPayload)
      Creates an instance of a CoordPrepare record class.
      Parameters:
      txId - the value for the txId record component
      participantGroupIds - the value for the participantGroupIds record component
      operationPayload - the value for the operationPayload record component
  • Method Details

    • participantGroupIds

      public int @NonNull [] participantGroupIds()
      Returns the value of the participantGroupIds record component.
      Returns:
      the value of the participantGroupIds record component
    • operationPayload

      public byte @NonNull [] operationPayload()
      Returns the value of the operationPayload record component.
      Returns:
      the value of the operationPayload record component
    • serialize

      public byte @NonNull [] serialize()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • txId

      public @NonNull UUID txId()
      Returns the value of the txId record component.
      Returns:
      the value of the txId record component