...
Code Block |
---|
|
{
"apiKey": xxx,
"type": "metadata",
"name": "DeleteTopicPartitionsRecord",
"validVersions": "0",
"fields": [
{ "name": "TopicId", "type": "uuid", "versions": "0+",
"about": "The topic partition to remove. " },
{ "name": "DeletePartitions", "type": "int32", "versions": "0+","about": "The partition to remove. All associated partitions will be removed as well." },
{ "name": "DeletePartitionsDelayTimestamp", "type": "bool", "versions": "0+","about": "Delay timestamp deletion of data." },
{ "name": "CreateTimestamp", "type": "int64", "versions": "0+","about": "The record create timestamp." },
]
}
|
...
AdminClient API changes
...
The AdminClient API
...
will have new methods added
Code Block |
---|
|
code |
DeletePartitionsRequest Request (Version: 0) => timeout_ms
immediate_delete [topics] TAG_BUFFER
timeout_ms => INT32
immediate_delete => BOOLEAN
topics => name [partitions] TAG_BUFFER
name => COMPACT_STRING
partitions => INT32 TAG_BUFFER
|
deletePartitions(Map<String, DeletePartitions> partitions)
@InterfaceStability.Evolving
public class DeletePartitions {
private int totalCount;
private boolean immediateDelete;
}
|
Protocol RPC changes
A new API DeletePartitions will be added with the following DeletePartitionsRequest and DeletePartitionsResponse
Code Block |
---|
|
DeletePartitionsRequest Request (Version: 0) => timeout_ms
immediate_delete [topics] TAG_BUFFER
timeout_ms => INT32
delete_partitions_delay => LONG
topics => name [partitions] TAG_BUFFER
name => COMPACT_STRING
partitions => INT32 TAG_BUFFER
|
Code Block |
---|
|
DeletePartitionsResponse Response (Version: 0) => throttle_time_ms error_code error_message [responses] TAG_BUFFER
throttle_time_ms => INT32
error_code => INT16
error_message => COMPACT_NULLABLE_STRING
responses => name [partitions] TAG_BUFFER
name => COMPACT_STRING
partitions => partition_index status_code error_code error_message TAG_BUFFER
partition_index => INT32
status_code => INT8
error_code => INT16
error_message => COMPACT_NULLABLE_STRING
|
In UpdateMeta API we add status_mode field to return the partition read/write status of the current topic partitions.
Code Block |
---|
|
UpdateMetadata Request (Version: 7) => controller_id controller_epoch broker_epoch [topic_states] [live_brokers] TAG_BUFFER
controller_id => INT32
controller_epoch => INT32
broker_epoch => INT64
topic_states => topic_name [partition_states] TAG_BUFFER
topic_name => COMPACT_STRING
partition_states => partition_index controller_epoch leader leader_epoch [isr] zk_version [replicas] [offline_replicas] status_mode TAG_BUFFER
partition_index => INT32
controller_epoch => INT32
leader => INT32
leader_epoch => INT32
isr => INT32
zk_version => INT32
replicas => INT32
offline_replicas => INT32
status_mode => INT8
live_brokers => id [endpoints] rack TAG_BUFFER
id => INT32
endpoints => port host listener security_protocol TAG_BUFFER
port => INT32
host => COMPACT_STRING
listener => COMPACT_STRING
security_protocol => INT16
rack => COMPACT_NULLABLE_STRING
|
Code Block |
---|
|
UpdateMetadata Response (Version: 7) => error_code TAG_BUFFER
error_code => INT16 |
Code Block |
---|
|
DeletePartitionsResponse Response (Version: 0) => throttle_time_ms error_code error_message [responses] TAG_BUFFER
throttle_time_ms => INT32
error_code => INT16
error_message => COMPACT_NULLABLE_STRING
responses => name [partitions] TAG_BUFFER
name => COMPACT_STRING
partitions => partition_index status_code error_code error_message TAG_BUFFER
partition_index => INT32
status_code => INT8
error_code => INT16
error_message => COMPACT_NULLABLE_STRING
|
MetaData API changes
- Add status_code field in Metadata API that represents the partitions of current topic
...
Code Block |
---|
language | java |
---|
linenumbers | true |
---|
|
public class PartitionInfo {public class PartitionInfo {
private final String topic;
private final int partition;
private final Node leader;
private final Node[] replicas;
private final Node[]String inSyncReplicastopic;
private final Node[]int offlineReplicaspartition;
private int status;
}
|
...
- The AdminClient API will have new methods
Code Block |
---|
language | java |
---|
linenumbers | true |
---|
|
deletePartitions(Map<String, DeletePartitions> partitions)
@InterfaceStability.Evolving
public class DeletePartitions { private final Node leader;
private final Node[] replicas;
private final Node[] inSyncReplicas;
private int totalCountfinal Node[] offlineReplicas;
private booleanint immediateDeletestatus;
}}
|
Kafka Topic Command changes
...