...
1// DeleteRecordsRequest is an admin request to delete records from Kafka.
2// This was added for KIP-107.
3//
4// To delete records, Kafka sets the LogStartOffset for partitions to
5// the requested offset. All segments whose max partition is before the
6// requested offset are deleted, and any records within the segment before
7// the requested offset can no longer be read.
8//
9// This request must be issued to the correct brokers that own the partitions
10// you intend to delete records for.
11DeleteRecordsRequest => key 21, max version 2, flexible v2+
12 // Topics contains topics for which to delete records from.
13 Topics: [=>]
14 // Topic is a topic to delete records from.
15 Topic: string
16 // Partitions contains partitions to delete records from.
17 Partitions: [=>]
18 // Partition is a partition to delete records from.
19 Partition: int32
20 // Offset is the offset to set the partition's low watermark (start
21 // offset) to. After a successful response, all records before this
22 // offset are considered deleted and are no longer readable.
23 //
24 // To delete all records, use -1, which is mapped to the partition's
25 // current high watermark.
26 Offset: int64
27 TimeoutMillis
28
29// DeleteRecordsResponse is returned from a DeleteRecordsRequest.
30DeleteRecordsResponse =>
31 ThrottleMillis(1)
32 // Topics contains responses for each topic in the delete records request.
33 Topics: [=>]
34 // Topic is the topic this response corresponds to.
35 Topic: string
36 // Partitions contains responses for each partition in a requested topic
37 // in the delete records request.
38 Partitions: [=>]
39 // Partition is the partition this response corresponds to.
40 Partition: int32
41 // LowWatermark is the new earliest offset for this partition.
42 LowWatermark: int64
43 // ErrorCode is the error code returned for a given partition in
44 // the delete request.
45 //
46 // TOPIC_AUTHORIZATION_FAILED is returned for all partitions if the
47 // client is not authorized to delete records.
48 //
49 // UNKNOWN_TOPIC_OR_PARTITION is returned for all partitions that
50 // the requested broker does not know of.
51 //
52 // NOT_LEADER_FOR_PARTITION is returned for partitions that the
53 // requested broker is not a leader of.
54 //
55 // OFFSET_OUT_OF_RANGE is returned if the requested offset is
56 // negative or higher than the current high watermark.
57 //
58 // POLICY_VIOLATION is returned if records cannot be deleted due to
59 // broker configuration.
60 //
61 // KAFKA_STORAGE_EXCEPTION is returned if the partition is in an
62 // offline log directory.
63 ErrorCode: int16
View as plain text