MINOR: use new method to get number of topics in DeleteTopicsRequest#10351
Merged
dajac merged 5 commits intoapache:trunkfrom Mar 23, 2021
Merged
MINOR: use new method to get number of topics in DeleteTopicsRequest#10351dajac merged 5 commits intoapache:trunkfrom
dajac merged 5 commits intoapache:trunkfrom
Conversation
dajac
reviewed
Mar 18, 2021
clients/src/main/java/org/apache/kafka/common/requests/DeleteTopicsRequest.java
Show resolved
Hide resolved
Member
Author
|
Build was broken due to an unrelated change, but should be fixed now. |
dajac
reviewed
Mar 19, 2021
clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
Outdated
Show resolved
Hide resolved
Member
dajac
reviewed
Mar 22, 2021
clients/src/test/java/org/apache/kafka/common/requests/DeleteTopicsRequestTest.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/common/requests/DeleteTopicsRequestTest.java
Outdated
Show resolved
Hide resolved
| assertEquals(topics, requestWithNames2.topicNames()); | ||
| assertEquals(topics, requestWithNamesSerialized2.topicNames()); | ||
|
|
||
| } catch (UnsupportedVersionException e) { |
Member
There was a problem hiding this comment.
It would be better to use assertThrows instead of doing this because it is not clear where we expect this exception to be thrown. So, I would so something like the following:
if (version >= 6) {
// Do the regular part
} else {
// assertThrows with the expected code that must throw.
}
| // All topic names should be replaced with null | ||
| requestWithIds.data().topics().forEach(topic -> assertNull(topic.name())); | ||
| requestWithIdsSerialized.data().topics().forEach(topic -> assertNull(topic.name())); | ||
| } catch (UnsupportedVersionException e) { |
clients/src/test/java/org/apache/kafka/common/requests/DeleteTopicsRequestTest.java
Show resolved
Hide resolved
Terrdi
pushed a commit
to Terrdi/kafka
that referenced
this pull request
Apr 1, 2021
…pache#10351) Reviewers: David Jacot <djacot@confluent.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a result of #9684, a new field for topic names was created. For versions 6+
DeleteTopicsRequestData.topicNameswill return an empty list in KafkaApis. This PR uses a new method to efficiently initialize the size of the collection.Committer Checklist (excluded from commit message)