Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 222

...

Schema can be evolved by adding a new version with the respective changes. A new type can also be supported by adding with the respective type and its version. 

Code Block
titleSchema

{
  "apiKey": 0,
  "type": "data",
  "name": "RLSMCopyStartedStateRemoteLogSegmentMetadataRecord",
  "validVersions": "0",
  "flexibleVersions": "none",
  "fields": [
    {
      "name": "RemoteLogSegmentId",
      "type": "RemoteLogSegmentIdEntry",
      "versions": "0+",
      "about": "The transactional id corresponding to the transaction.",
      "fields": [
        {
          "name": "topic",
          "type": "string",
          "versions": "0+",
          "about": "Topic name"
        },
        {
          "name": "partition",
          "type": "int32",
          "versions": "0+",
          "about": "Partition number"
        },
        {
          "name": "id",
          "type": "uuid",
          "versions": "0+",
          "about": "unique identifier"
        }
      ]
    },
    {
      "name": "StartOffset",
      "type": "int64",
      "versions": "0+",
      "about": "Start offset  of the segment."
    },
    {
      "name": "endOffset",
      "type": "int64",
      "versions": "0+",
      "about": "End offset  of the segment."
    },
    {
      "name": "LeaderEpoch",
      "type": "int32",
      "versions": "0+",
      "about": "Leader epoch from which this segment instance is created or updated"
    },
    {
      "name": "MaxTimestamp",
      "type": "int64",
      "versions": "0+",
      "about": "Maximum timestamp with in this segment."
    },
    {
      "name": "EventTimestamp",
      "type": "int64",
      "versions": "0+",
      "about": "Event timestamp of this segment."
    },
    {
      "name": "SegmentLeaderEpochs",
      "type": "[]SegmentLeaderEpochEntry",
      "versions": "0+",
      "about": "Event timestamp of this segment.",
      "fields": [
        {
          "name": "LeaderEpoch",
          "type": "int32",
          "versions": "0+",
          "about": "Leader epoch"
        },
        {
          "name": "Offset",
          "type": "int64",
          "versions": "0+",
          "about": "Start offset for the leader epoch"
        }
      ]
    },
    {
      "name": "SegmentSizeInBytes",
      "type": "int64",
      "versions": "0+",
      "about": "Segment size in bytes"
    }
  ]
}


{
  "apiKey": 1,
  "type": "data",
  "name": "RLSMPostCopyStartState",
  "validVersions": "0",
  "flexibleVersions": "none",
  "fields": [
    {
      "name": "RemoteLogSegmentId",
      "type": "RemoteLogSegmentIdEntry",
      "versions": "0+",
      "about": "The transactional id corresponding to the transaction.",
      "fields": [
        {
          "name": "topic",
          "type": "string",
          "versions": "0+",
          "about": "Topic name"
        },
        {
          "name": "partition",
          "type": "int32",
          "versions": "0+",
          "about": "Partition number"
        },
        {
          "name": "id",
          "type": "uuid",
          "versions": "0+",
          "about": "unique identifier"
        }
      ]
    },
    {
      "name": "LeaderEpoch",
      "type": "int32",
      "versions": "0+",
      "about": "Leader epoch from which this segment instance is created or updated"
    },
    {
      "name": "EventTimestamp",
      "type": "int64",
      "versions": "0+",
      "about": "Event timestamp of this segment."
    },
    {
      "name": "State",
      "type": "int8",
      "versions": "0+",
      "about": "State of the segment"
    }
  ]
}


	/**
     * It indicates the state of the remote log segment. This will be based on the action executed on this segment by
     * remote log service implementation.
     *
     * todo: check whether the state validations to be checked or not, add next possible states for each state.
     */
    public enum State {

        /**
         * This state indicates that the segment copying to remote storage is started but not yet finished.
         */
        COPY_STARTED((byte) 0),

        /**
         * This state indicates that the segment copying to remote storage is finished.
         */
        COPY_FINISHED((byte) 1),

        /**
         * This segment is marked for delete. That means, it is eligible for deletion. This is used when a topic/partition
         * is deleted so that deletion agents can start deleting them as the leader/follower does not exist.
         */
        DELETE_MARKED((byte) 2),

        /**
         * This state indicates that the segment deletion is started but not yet finished.
         */
        DELETE_STARTED((byte) 3),

        /**
         * This state indicates that the segment is deleted successfully.
         */
        DELETE_FINISHED((byte) 4);
        ...
    }

...