View Source KlifeProtocol.Messages.StopReplica (Klife Protocol v0.5.0)

Kafka protocol StopReplica message

Request versions summary:

  • Version 1 adds the broker epoch and reorganizes the partitions to be stored per topic.
  • Version 2 is the first flexible version.
  • Version 3 adds the leader epoch per partition (KIP-570).
  • Version 4 adds KRaft Controller ID field as part of KIP-866

Response versions summary:

  • Version 1 is the same as version 0.
  • Version 2 is the first flexible version.
  • Version 3 returns FENCED_LEADER_EPOCH if the epoch of the leader is stale (KIP-570).

Link to this section Summary

Functions

Returns the message api key number.

Receive a binary in the kafka wire format and deserialize it into a map.

Returns the current max supported version of this message.

Returns the current min supported version of this message.

Receives a map and serialize it to kafka wire format of the given version.

Link to this section Functions

Returns the message api key number.

Link to this function

deserialize_response(data, version, with_header? \\ true)

View Source

Receive a binary in the kafka wire format and deserialize it into a map.

Response content fields:

  • error_code: The top-level error code, or 0 if there was no top-level error. (int16 | versions 0+)

  • partition_errors: The responses for each partition. ([]StopReplicaPartitionError | versions 0+)

    • topic_name: The topic name. (string | versions 0+)

    • partition_index: The partition index. (int32 | versions 0+)

    • error_code: The partition error code, or 0 if there was no partition error. (int16 | versions 0+)

Returns the current max supported version of this message.

Returns the current min supported version of this message.

Link to this function

serialize_request(map, version)

View Source

Receives a map and serialize it to kafka wire format of the given version.

Input content fields:

  • controller_id: The controller id. (int32 | versions 0+)

  • is_k_raft_controller: If KRaft controller id is used during migration. See KIP-866 (bool | versions 4+)

  • controller_epoch: The controller epoch. (int32 | versions 0+)

  • broker_epoch: The broker epoch. (int64 | versions 1+)

  • delete_partitions: Whether these partitions should be deleted. (bool | versions 0-2)

  • ungrouped_partitions: The partitions to stop. ([]StopReplicaPartitionV0 | versions 0)

    • topic_name: The topic name. (string | versions 0)

    • partition_index: The partition index. (int32 | versions 0)

  • topics: The topics to stop. ([]StopReplicaTopicV1 | versions 1-2)

    • name: The topic name. (string | versions 1-2)

    • partition_indexes: The partition indexes. ([]int32 | versions 1-2)

  • topic_states: Each topic. ([]StopReplicaTopicState | versions 3+)

    • topic_name: The topic name. (string | versions 3+)

    • partition_states: The state of each partition ([]StopReplicaPartitionState | versions 3+)

      • partition_index: The partition index. (int32 | versions 3+)

      • leader_epoch: The leader epoch. (int32 | versions 3+)

      • delete_partition: Whether this partition should be deleted. (bool | versions 3+)