View Source KlifeProtocol.Messages.UpdateMetadata (Klife Protocol v0.7.0)

Kafka protocol UpdateMetadata message

Request versions summary:

  • Version 1 allows specifying multiple endpoints for each broker.
  • Version 2 adds the rack.
  • Version 3 adds the listener name.
  • Version 4 adds the offline replica list.
  • Version 5 adds the broker epoch field and normalizes partitions by topic.
  • Version 7 adds topicId
  • Version 8 adds KRaft Controller ID field as part of KIP-866

Response versions summary:

  • Versions 1, 2, 3, 4, and 5 are the same as version 0

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 error code, or 0 if there was no 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 8+)

  • type: Indicates if this request is a Full metadata snapshot (2), Incremental (1), or Unknown (0). Using during ZK migration, see KIP-866 (int8 | versions 8+)

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

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

  • ungrouped_partition_states: In older versions of this RPC, each partition that we would like to update. ([]UpdateMetadataPartitionState | versions 0-4)

    • topic_name: In older versions of this RPC, the topic name. (string | versions 0-4)

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

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

    • leader: The ID of the broker which is the current partition leader. (int32 | versions 0+)

    • leader_epoch: The leader epoch of this partition. (int32 | versions 0+)

    • isr: The brokers which are in the ISR for this partition. ([]int32 | versions 0+)

    • zk_version: The Zookeeper version. (int32 | versions 0+)

    • replicas: All the replicas of this partition. ([]int32 | versions 0+)

    • offline_replicas: The replicas of this partition which are offline. ([]int32 | versions 4+)

  • topic_states: In newer versions of this RPC, each topic that we would like to update. ([]UpdateMetadataTopicState | versions 5+)

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

    • topic_id: The topic id. (uuid | versions 7+)

    • partition_states: The partition that we would like to update. ([]UpdateMetadataPartitionState | versions 5+)

      • topic_name: In older versions of this RPC, the topic name. (string | versions 0-4)

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

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

      • leader: The ID of the broker which is the current partition leader. (int32 | versions 0+)

      • leader_epoch: The leader epoch of this partition. (int32 | versions 0+)

      • isr: The brokers which are in the ISR for this partition. ([]int32 | versions 0+)

      • zk_version: The Zookeeper version. (int32 | versions 0+)

      • replicas: All the replicas of this partition. ([]int32 | versions 0+)

      • offline_replicas: The replicas of this partition which are offline. ([]int32 | versions 4+)

  • live_brokers: ([]UpdateMetadataBroker | versions 0+)

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

    • v0_host: The broker hostname. (string | versions 0)

    • v0_port: The broker port. (int32 | versions 0)

    • endpoints: The broker endpoints. ([]UpdateMetadataEndpoint | versions 1+)

      • port: The port of this endpoint (int32 | versions 1+)

      • host: The hostname of this endpoint (string | versions 1+)

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

      • security_protocol: The security protocol type. (int16 | versions 1+)

    • rack: The rack which this broker belongs to. (string | versions 2+)