Skip to content

KAFKA-5370: Replace uses of the old consumer with the new consumer when possible#3320

Closed
vahidhashemian wants to merge 4 commits intoapache:trunkfrom
vahidhashemian:KAFKA-5370
Closed

KAFKA-5370: Replace uses of the old consumer with the new consumer when possible#3320
vahidhashemian wants to merge 4 commits intoapache:trunkfrom
vahidhashemian:KAFKA-5370

Conversation

@vahidhashemian
Copy link
Copy Markdown
Contributor

@vahidhashemian vahidhashemian commented Jun 13, 2017

Also, methods in ClientUtils that are called by server or tools code are introduced in AdminUtils with the implementation living in AdminUtils. All the existing callers apart from the old clients call the AdminUtils methods.

@asfbot
Copy link
Copy Markdown

asfbot commented Jun 13, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/5226/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jun 13, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/5242/
Test FAILed (JDK 7 and Scala 2.11).

@vahidhashemian
Copy link
Copy Markdown
Contributor Author

@ijuma Is this close to what you had in mind by your earlier comment? Thanks.

@vahidhashemian vahidhashemian force-pushed the KAFKA-5370 branch 4 times, most recently from b7e2211 to 96f91b7 Compare June 21, 2017 20:54
@asfgit
Copy link
Copy Markdown

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/5571/
Test FAILed (JDK 8 and Scala 2.12).

@asfgit
Copy link
Copy Markdown

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/5585/
Test FAILed (JDK 7 and Scala 2.11).

@asfgit
Copy link
Copy Markdown

asfgit commented Jun 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/5577/
Test PASSed (JDK 8 and Scala 2.12).

@asfgit
Copy link
Copy Markdown

asfgit commented Jun 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/5591/
Test FAILed (JDK 7 and Scala 2.11).

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 and sorry for the delay. I left some comments. Also, it would be great if we could update ProducerBounceTest to use the new consumer.

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.

We should use a JUnit assertion (i.e. assertTrue).

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.

Can you elaborate on why many of these tests were removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this PR I used an API that did not provide some of the details the deprecated API provided. In the new patch I switch to Metadata API that seem to cover the missing info. So, these tests will be back in the new patch.

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.

Maybe this should be a method in BrokerEndPoint.

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.

This doesn't seem to make sense since we are now using the new consumer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the new patch this method is no longer needed.

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.

On second thought, this should probably not be here. AdminUtils is the place for methods that interact with ZK. We could add it to the ClientUtils in the client module maybe (that makes it clear that we are communicating with Kafka via the protocol).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we want to deprecate ClientUtils? If so, should we find another host for this method? Suggestions? What do you think about channelToAnyBroker and channelToOffsetManager?

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Aug 4, 2017

One more thing: we should consider removing methods from the Scala ClientUtils if the new implementation is suitable across the board (like the method that parses the broker list).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 4, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6571/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 4, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6556/
Test PASSed (JDK 8 and Scala 2.12).

Copy link
Copy Markdown
Contributor Author

@vahidhashemian vahidhashemian left a comment

Choose a reason for hiding this comment

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

@ijuma Thanks for reviewing the PR. I tried to address your comments. I asked inline about where to put a couple of existing methods. Let me know if you have any suggestions. Thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we want to deprecate ClientUtils? If so, should we find another host for this method? Suggestions? What do you think about channelToAnyBroker and channelToOffsetManager?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the new patch this method is no longer needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this PR I used an API that did not provide some of the details the deprecated API provided. In the new patch I switch to Metadata API that seem to cover the missing info. So, these tests will be back in the new patch.

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 8, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6630/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 8, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6615/
Test PASSed (JDK 8 and Scala 2.12).

@vahidhashemian vahidhashemian changed the title KAFKA-5370 (WIP): Replace uses of the old consumer with the new consumer when possible KAFKA-5370: Replace uses of the old consumer with the new consumer when possible Aug 8, 2017
@vahidhashemian
Copy link
Copy Markdown
Contributor Author

@ijuma I'm making some additional adjustments. Please hold off reviewing until the next patch is submitted. Thanks.

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6648/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6633/
Test PASSed (JDK 8 and Scala 2.12).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6659/
Test FAILed (JDK 8 and Scala 2.12).

@asfgit
Copy link
Copy Markdown

asfgit commented Aug 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6674/
Test PASSed (JDK 7 and Scala 2.11).

@vahidhashemian
Copy link
Copy Markdown
Contributor Author

@ijuma The PR should be in a better shape now. We may need to move the methods from ClientUtils, as you suggested. If so, please let me now which file(s) you think should host them.

…ssible

- Uses of the old consumers in tools and tests where the new consumer would work as well (or better).
…ssible

Uses of the old consumers in tools and tests where the new consumer would work as well (or better) should be updated.

Conflicts:
	core/src/test/scala/unit/kafka/integration/TopicMetadataTest.scala
…ssible

Uses of the old consumers in tools and tests where the new consumer would work as well (or better) should be updated.

Conflicts:
	core/src/test/scala/unit/kafka/integration/TopicMetadataTest.scala

Conflicts:
	core/src/test/scala/integration/kafka/api/ProducerBounceTest.scala
	core/src/test/scala/unit/kafka/integration/TopicMetadataTest.scala
@ijuma
Copy link
Copy Markdown
Member

ijuma commented Jun 14, 2018

Sorry, I dropped the ball on this review. I don't think this PR is relevant anymore, but I did include you as a co-author in #5220 which overlaps a bit with one of the changes in this PR.

@ijuma ijuma closed this Jun 14, 2018
ijuma added a commit to ijuma/kafka that referenced this pull request Jun 14, 2018
This does the minimal amount of work so that the tool
relies on public non-deprecated APIs (i.e. so that
it doesn't rely on old clients code).

Additional improvements have been proposed via
KIP-308.

There are a few other PRs that touch this class with
overlapping goals:

- apache#2891
- apache#3051
- apache#3320

One of them remains relevant in the context of KIP-308, but
the others are not. I included the authors of the 3 PRs as
co-authors.

Co-authored-by: Arseniy Tashoyan <tashoyan@gmail.com>
Co-authored-by: Vahid Hashemian <vahidhashemian@us.ibm.com>
Co-authored-by: Mohammed Amine GARMES
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
ijuma added a commit to ijuma/kafka that referenced this pull request Jun 14, 2018
This does the minimal amount of work so that the tool
relies on public non-deprecated APIs (i.e. so that
it doesn't rely on old clients code).

Additional improvements have been proposed via
KIP-308.

There are a few other PRs that touch this class with
overlapping goals:

- apache#2891
- apache#3051
- apache#3320

One of them remains relevant in the context of KIP-308, but
the others are not. I included the authors of the 3 PRs as
co-authors.

Co-authored-by: Arseniy Tashoyan <tashoyan@gmail.com>
Co-authored-by: Vahid Hashemian <vahidhashemian@us.ibm.com>
Co-authored-by: Mohammed Amine GARMES
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
ijuma added a commit that referenced this pull request Jun 14, 2018
This does the minimal amount of work so that the tool
relies on public non-deprecated APIs (i.e. it no longer
relies on Scala clients code).

Additional improvements (not included here) have
been proposed via KIP-308.

There are a few other PRs that touch this class with
overlapping goals:

- #2891
- #3051
- #3320

One of them remains relevant in the context of KIP-308, but
the others have been superseded. I included the authors of
the 3 PRs as co-authors.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Vahid Hashemian <vahidhashemian@us.ibm.com>, Manikumar Reddy <manikumar.reddy@gmail.com>

Co-authored-by: Arseniy Tashoyan <tashoyan@gmail.com>
Co-authored-by: Vahid Hashemian <vahidhashemian@us.ibm.com>
Co-authored-by: Mohammed Amine GARMES
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
vahidhashemian added a commit to vahidhashemian/kafka that referenced this pull request Jun 14, 2018
This does the minimal amount of work so that the tool
relies on public non-deprecated APIs (i.e. it no longer
relies on Scala clients code).

Additional improvements (not included here) have
been proposed via KIP-308.

There are a few other PRs that touch this class with
overlapping goals:

- apache#2891
- apache#3051
- apache#3320

One of them remains relevant in the context of KIP-308, but
the others have been superseded. I included the authors of
the 3 PRs as co-authors.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Vahid Hashemian <vahidhashemian@us.ibm.com>, Manikumar Reddy <manikumar.reddy@gmail.com>

Co-authored-by: Arseniy Tashoyan <tashoyan@gmail.com>
Co-authored-by: Vahid Hashemian <vahidhashemian@us.ibm.com>
Co-authored-by: Mohammed Amine GARMES
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
ying-zheng pushed a commit to ying-zheng/kafka that referenced this pull request Jul 6, 2018
This does the minimal amount of work so that the tool
relies on public non-deprecated APIs (i.e. it no longer
relies on Scala clients code).

Additional improvements (not included here) have
been proposed via KIP-308.

There are a few other PRs that touch this class with
overlapping goals:

- apache#2891
- apache#3051
- apache#3320

One of them remains relevant in the context of KIP-308, but
the others have been superseded. I included the authors of
the 3 PRs as co-authors.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Vahid Hashemian <vahidhashemian@us.ibm.com>, Manikumar Reddy <manikumar.reddy@gmail.com>

Co-authored-by: Arseniy Tashoyan <tashoyan@gmail.com>
Co-authored-by: Vahid Hashemian <vahidhashemian@us.ibm.com>
Co-authored-by: Mohammed Amine GARMES
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
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.

4 participants