// Part of KIP-595 to replace Kafka's dependence on Zookeeper with a
// Kafka-only raft protocol,
// BeginQuorumEpochRequest is sent by a leader (once it has enough votes)
// to all voters in the election.
//
// Since this is relatively Kafka internal, most fields are left undocumented.
BeginQuorumEpochRequest => key 53, max version 1, flexible v1+, admin
  ClusterID: nullable-string
  // Replica ID of the voter receiving the request.
  VoterID: int32(-1) // v1+
  Topics: [=>]
    Topic: string
    Partitions: [=>]
      Partition: int32
      // Directory ID of the receiving replica.
      VoterDirectoryID: uuid // v1+
      // The ID of the newly elected leader.
      LeaderID: int32
      // The epoch of the newly elected leader.
      LeaderEpoch: int32
  // Endpoints for the leader.
  LeaderEndpoints: [=>] // v1+
    Name: string
    Host: string
    Port: uint16

BeginQuorumEpochResponse =>
  ErrorCode: int16
  Topics: [=>]
    Topic: string
    Partitions: [=>]
      Partition: int32
      ErrorCode: int16
      // The ID of the current leader, or -1 if the leader is unknown.
      LeaderID: int32
      // The latest known leader epoch.
      LeaderEpoch: int32
  // Endpoints for all leaders enumerated in PartitionData.
  NodeEndpoints: [=>] // tag 0
    NodeID: int32 // v1+
    Host: string // v1+
    Port: uint16 // v1+
