Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Schema:
{ "fields" :
    [ {"name": "version", "type": "int", "doc": "version id},
      {"name": "id", "type": "string", "doc": option[UUIDUuid]},
      {"name": "partitions",
       "type": {"type": "map",
                "values": {"type": "array", "items": "int", "doc": "a list of replica ids"},
                "doc": "a map from partition id to replica list"},

             {"name": "adding_replicas",
       "type": {"type": "map",
                "values": {"type": "array", "items": "int", "doc": "a list of replica ids"},
                "doc": "a map from partition id to a list of replicas to add in a pending reassignment"},

             {"name": "removing_replicas",
       "type": {"type": "map",
                "values": {"type": "array", "items": "int", "doc": "a list of replica ids"},
                "doc": "a map from partition id to a list of replicas to remove in a pending reassignment"},
      }
    ]
}
 
Example:
{
  "version": 3,
  "id": "b8tRS7h4TJ2Vt43Dp85v2A",
  "partitions": {"0": [0, 1, 3] },
    "adding_replicas": {},
    "removing_replicas": {}
}

...

  • Metadata schema version (schema_version: int32)
  • Topic ID (id: UUIDUuid)

This file will be plain text (key/value pairs).

...

public class CreateTopicsResult {

  public KafkaFuture<UUID> KafkaFuture<Uuid> topicId(String topic)

...

  public static class TopicMetadataAndConfig {

    TopicMetadataAndConfig(UUID Uuid topicId, int numPartitions, int replicationFactor, Config config)

    public UUID Uuid topicId()

}

The protocol for CreateTopicsResponse will also need a slight modification.

...

/**
* Create an instance with the specified parameters.
*
* @param name The topic name
* @param internal Whether the topic is internal to Kafka
* @param partitions A list of partitions where the index represents the partition id and the element contains
*                   leadership and replica information for that partition.
* @param authorizedOperations authorized operations for this topic, or null if this is not known.
* @param topicId Unique value that identifies the topic
*
*/
public TopicDescription(String name, boolean internal, List<TopicPartitionInfo> partitions,
    Set<AclOperation> authorizedOperations, UUID topicIdUuid topicId)


/**
* A unique identifier for the topic.
*/
public UUID topicIdUuid topicId()

MetadataResponse v10

Metadata Response (Version: 10) => throttle_time_ms [brokers] cluster_id controller_id [topics] cluster_authorized_operations
    throttle_time_ms => INT32
    brokers => node_id host port rack
        node_id => INT32
        host => STRING
        port => INT32
        rack => STRING
    cluster_id => STRING
    controller_id => INT32
    topics => error_code name topic_id* is_internal [partitions] topic_authorized_operations
        error_code => INT16
        name => STRING 
        topic_id* => UUID
        is_internal => BOOL
        partitions => error_code partition_index leader_id leader_epoch [replica_nodes] [isr_nodes] [offline_replicas]
            error_code => INT16
            partition_index => INT32
            leader_id => INT32
            leader_epoch => INT32
            replica_nodes => INT32
            isr_nodes => INT32
            offline_replicas => INT32
        topic_authorized_operations => INT32
    cluster_authorized_operations => INT32

...

default DescribeTopicsResult describeTopics(Collection<UUID> Collection<Uuid> topicIds)

DescribeTopicsResult describeTopics(Collection<UUID> Collection<Uuid> topicIds, DescribeTopicsOptions options)

...

default DeleteTopicsResult deleteTopics(Collection<UUID> Collection<Uuid> topics)

DeleteTopicsResult deleteTopics(Collection<UUID> Collection<Uuid> topics, DeleteTopicsOptions options);

...

The idea is that this will be a hard-coded UUID that no other topic can be assigned. Initially the all zero UUID was considered, but was ultimately rejected since this is used as a null ID in some places and it is better to keep these usages separate. An example of a hard-coded UUID is 00000000-0000-0000-0000-000000000001 00000000000000000000000000000001

LeaderAndIsr, UpdateMetadata, and StopReplica 

...