This is an automated email from the ASF dual-hosted git repository. chia7712 pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new 9a32a71e76d KAFKA-19699 improve the documentation of `RecordsToDelete` (#20527) 9a32a71e76d is described below commit 9a32a71e76da604f3e84734737fdf5e3fe9823f6 Author: Lan Ding <isdin...@163.com> AuthorDate: Wed Sep 17 23:49:42 2025 +0800 KAFKA-19699 improve the documentation of `RecordsToDelete` (#20527) document the behavior of "-1" (HIGH_WATERMARK) Reviewers: Ken Huang <s7133...@gmail.com>, TengYao Chi <kiting...@gmail.com>, Chia-Ping Tsai <chia7...@gmail.com> --- .../main/java/org/apache/kafka/clients/admin/RecordsToDelete.java | 6 ++++-- clients/src/main/resources/common/message/DeleteRecordsRequest.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/RecordsToDelete.java b/clients/src/main/java/org/apache/kafka/clients/admin/RecordsToDelete.java index d3da26b03bb..57421e3568b 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/RecordsToDelete.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/RecordsToDelete.java @@ -33,14 +33,16 @@ public class RecordsToDelete { /** * Delete all the records before the given {@code offset} * - * @param offset the offset before which all records will be deleted + * @param offset The offset before which all records will be deleted. + * Use {@code -1} to truncate to the high watermark. */ public static RecordsToDelete beforeOffset(long offset) { return new RecordsToDelete(offset); } /** - * The offset before which all records will be deleted + * The offset before which all records will be deleted. + * Use {@code -1} to truncate to the high watermark. */ public long beforeOffset() { return offset; diff --git a/clients/src/main/resources/common/message/DeleteRecordsRequest.json b/clients/src/main/resources/common/message/DeleteRecordsRequest.json index fc697944a02..969efd63e95 100644 --- a/clients/src/main/resources/common/message/DeleteRecordsRequest.json +++ b/clients/src/main/resources/common/message/DeleteRecordsRequest.json @@ -33,7 +33,7 @@ { "name": "PartitionIndex", "type": "int32", "versions": "0+", "about": "The partition index." }, { "name": "Offset", "type": "int64", "versions": "0+", - "about": "The deletion offset." } + "about": "The deletion offset. -1 means that records should be truncated to the high watermark." } ]} ]}, { "name": "TimeoutMs", "type": "int32", "versions": "0+",