Skip to content

MINOR: Replace ApiVersion by auto-generated protocol#9746

Merged
chia7712 merged 4 commits intoapache:trunkfrom
chia7712:MINOR-9746
Jan 19, 2021
Merged

MINOR: Replace ApiVersion by auto-generated protocol#9746
chia7712 merged 4 commits intoapache:trunkfrom
chia7712:MINOR-9746

Conversation

@chia7712
Copy link
Copy Markdown
Member

@chia7712 chia7712 commented Dec 14, 2020

This PR includes following changes.

  1. rename (auto-generated) ApiVersionsResponseKey to ApiVersion
  2. replace clients/src/main/java/org/apache/kafka/clients/ApiVersion.java by auto-generated ApiVersion

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@chia7712 chia7712 requested review from dajac and hachikuji December 14, 2020 12:12
@chia7712 chia7712 changed the title MINOR: substitue ApiVersionsResponseKey for ApiVersion MINOR: substitute ApiVersionsResponseKey for ApiVersion Dec 14, 2020
@chia7712 chia7712 force-pushed the MINOR-9746 branch 2 times, most recently from 9732583 to fc66801 Compare December 16, 2020 15:33
Comment thread clients/src/main/java/org/apache/kafka/clients/NodeApiVersions.java Outdated
@chia7712 chia7712 changed the title MINOR: substitute ApiVersionsResponseKey for ApiVersion MINOR: Replace ApiVersion by auto-generated protocol Jan 6, 2021
@chia7712
Copy link
Copy Markdown
Member Author

chia7712 commented Jan 8, 2021

@dajac @ijuma Could you please take a look?

@dajac
Copy link
Copy Markdown
Member

dajac commented Jan 8, 2021

@chia7712 Sorry for the delay. I will take a look at it next week.

@chia7712
Copy link
Copy Markdown
Member Author

fix conflicting files

@chia7712 chia7712 force-pushed the MINOR-9746 branch 2 times, most recently from b53bb93 to 81dd7d6 Compare January 16, 2021 19:06
@chia7712
Copy link
Copy Markdown
Member Author

rewrite whole PR due to recent changes ...

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Left a few minor comments.

Comment thread clients/src/main/java/org/apache/kafka/clients/NodeApiVersions.java Outdated
Comment thread clients/src/main/java/org/apache/kafka/clients/NodeApiVersions.java Outdated

public static Optional<ApiVersionsResponseData.ApiVersion> intersect(ApiVersionsResponseData.ApiVersion thisVersion,
ApiVersionsResponseData.ApiVersion other) {
if (other == null) return Optional.empty();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit weird that we only check if other is null. Do we need this check at all?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the usage of this method, only other can be null. So current check is enough.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a good way to design apis, right? This kind of thing should be symmetric. Why is other sometimes null?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is other sometimes null?

The api key is supported by client-side but Controller doesn't.

That's not a good way to design apis, right? This kind of thing should be symmetric.

make sense. will address it and add unit tests.

Comment thread clients/src/test/java/org/apache/kafka/clients/NodeApiVersionsTest.java Outdated
@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jan 19, 2021

Also, one file has conflicts that need to be resolved.

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, LGTM.

@chia7712 chia7712 merged commit f7c0b0d into apache:trunk Jan 19, 2021
@chia7712 chia7712 deleted the MINOR-9746 branch March 25, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants