-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-16319: Divide DeleteTopics requests by leader node #15479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,15 +79,15 @@ public static SimpleAdminApiFuture<TopicPartition, DeletedRecords> newFuture( | |
| @Override | ||
| public DeleteRecordsRequest.Builder buildBatchedRequest(int brokerId, Set<TopicPartition> keys) { | ||
| Map<String, DeleteRecordsRequestData.DeleteRecordsTopic> deletionsForTopic = new HashMap<>(); | ||
| for (Map.Entry<TopicPartition, RecordsToDelete> entry: recordsToDelete.entrySet()) { | ||
| TopicPartition topicPartition = entry.getKey(); | ||
| for (TopicPartition topicPartition : keys) { | ||
| RecordsToDelete toDelete = recordsToDelete.get(topicPartition); | ||
| DeleteRecordsRequestData.DeleteRecordsTopic deleteRecords = deletionsForTopic.computeIfAbsent( | ||
| topicPartition.topic(), | ||
| key -> new DeleteRecordsRequestData.DeleteRecordsTopic().setName(topicPartition.topic()) | ||
| ); | ||
| deleteRecords.partitions().add(new DeleteRecordsRequestData.DeleteRecordsPartition() | ||
| .setPartitionIndex(topicPartition.partition()) | ||
| .setOffset(entry.getValue().beforeOffset())); | ||
| .setOffset(toDelete.beforeOffset())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be unduly paranoid to check for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, in my opinion it would be unduly paranoid. I would end up writing conditional logic for a situation which will never occur, and it would differ from other code in this area of AdminClient which also uses a map which is accessed in this way confidently expecting the entry to be present. |
||
| } | ||
|
|
||
| DeleteRecordsRequestData data = new DeleteRecordsRequestData() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.