Skip to content

MINOR: Use KafkaConsumer in GetOffsetShell#5220

Merged
ijuma merged 5 commits intoapache:trunkfrom
ijuma:use-java-consumer-in-offset-shell
Jun 14, 2018
Merged

MINOR: Use KafkaConsumer in GetOffsetShell#5220
ijuma merged 5 commits intoapache:trunkfrom
ijuma:use-java-consumer-in-offset-shell

Conversation

@ijuma
Copy link
Copy Markdown
Member

@ijuma ijuma commented 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:

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.

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

Committer Checklist (excluded from commit message)

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the above two lines be removed?

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.

Yes, will remove.

ijuma and others added 2 commits June 13, 2018 21:24
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 ijuma force-pushed the use-java-consumer-in-offset-shell branch from 53bb908 to aaa6c5c Compare June 14, 2018 04:27
if(args.length == 0)

if (args.length == 0)
CommandLineUtils.printUsageAndDie(parser, "An interactive shell for getting consumer offsets.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we can update existing usage description
"An interactive shell for getting TOPIC offsets."

System.err.println(("Error: no valid topic metadata for topic: %s, " + " probably the topic does not exist, run ").format(topic) +
"kafka-list-topic.sh to verify")
Exit.exit(1)
val partitionIdsRequested = options.valueOf(partitionOpt).split(",").map(_.toInt).toSet
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need to handle empty string. partitionOpt default value is empty string


val config = new Properties
config.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, brokerList)
config.setProperty(ConsumerConfig.CLIENT_ID_CONFIG, clientId)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing consumer deserializer props

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Jun 14, 2018

Thanks for the review @omkreddy. Sorry, I should have mentioned that this was still WIP and I had not tested it yet. :)

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram 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 the PR, LGTM

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Jun 14, 2018

JUnit test failure is unrelated and get_offset_shell system test passed:

https://jenkins.confluent.io/view/All/job/system-test-kafka-branch-builder/1788/console

Merging to trunk and 2.0.

@ijuma ijuma merged commit a423b1d into apache:trunk Jun 14, 2018
@ijuma ijuma deleted the use-java-consumer-in-offset-shell branch June 14, 2018 17:37
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>
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