GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SPARK-12177][Streaming][Kafka] Update KafkaDStreams to new Kafka 0.10 Consumer API by koeninger · Pull Request #11863 · apache/spark

Conversation

@koeninger

@koeninger koeninger commented Mar 21, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

New Kafka consumer api for the released 0.10 version of Kafka

How was this patch tested?

Unit tests, manual tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
koeninger added 14 commits March 3, 2016 16:55
@koeninger
[SPARK-12177][Streaming][Kafka] separate project for starting work on…
aaef0fc
… beta consumer, modify getPreferredLocations to choose a consistent executor per topicpartition
@koeninger
[SPARK-12177][Streaming][Kafka] WIP modify KafkaRDD to use cached new…
d4e504a
… consumers
@koeninger
[SPARK-12177][Streaming][Kafka] WIP modify DirectKafkaInputDStream to…
37cca1e
… use new consumer
@koeninger
Merge branch 'master' into kafka-0.9
1c0699d
@koeninger
[SPARK-12177][Streaming][Kafka] WIP merge backpressure fixes from master
f37717c
@koeninger
[SPARK-12177][Streaming][Kafka] WIP remove KafkaUtils until interface…
e01daea
… for new consumers is finished
@koeninger
[SPARK-12177][Streaming][Kafka] fix handling of kafkaParams
20b59e1
@koeninger
[SPARK-12177][Streaming][Kafka] better handling of dynamic topic subs…
b55a3d4
…criptions
@koeninger
[SPARK-12177][Streaming][Kafka] WIP cached consumers basically workin…
d2949f8
…g, but dont handle recalculating the same RDD efficiently
@koeninger
[SPARK-12177][Streaming][Kafka] WIP remove unused class
47209c0
@koeninger
[SPARK-12177][Streaming][Kafka] WIP add java convenience constructors…
dea8ec0
…, fix tests
@koeninger
[SPARK-12177][Streaming][Kafka] WIP allow user configuration of consu…
43c27e9
…mer for dynamic topics, listener, etc
@koeninger
[SPARK-12177][Streaming][Kafka] WIP allow manual commit of offsets to…
c04bc68
… kafka
@koeninger
[SPARK-12177][Streaming][Kafka] WIP pause topicpartitions to prevent …
546246e
…consuming messages on driver
@SparkQA

SparkQA commented Mar 21, 2016

Copy link
Copy Markdown

Test build #53680 has finished for PR 11863 at commit 546246e.

  • This patch fails Scala style tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

koeninger added 2 commits March 21, 2016 11:03
@koeninger
[SPARK-12177][Streaming][Kafka] scalastyle cleanup
8f2da8c
@koeninger
Merge branch 'master' of https://github.com/apache/spark into kafka-0.9
477055c
@SparkQA

SparkQA commented Mar 21, 2016

Copy link
Copy Markdown

Test build #53682 has finished for PR 11863 at commit 477055c.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger
[SPARK-12177][Streaming][Kafka] scalastyle test cleanup
ba41956
@SparkQA

SparkQA commented Mar 21, 2016

Copy link
Copy Markdown

Test build #53686 has started for PR 11863 at commit ba41956.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger
[SPARK-12177][Streaming][Kafka] workaround performance issues, error …
e559183
…on attempts to serialize ConsumerRecord
@SparkQA

SparkQA commented Apr 7, 2016

Copy link
Copy Markdown

Test build #55252 has finished for PR 11863 at commit e559183.

  • This patch fails MiMa tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

koeninger added 2 commits April 8, 2016 10:57
@koeninger
[SPARK-12177][Streaming][Kafka] keep executor consumer group distinct…
47d3a9f
… from driver
@koeninger
Merge branch 'master' into kafka-0.9
f77288b
markgrover
markgrover reviewed Apr 15, 2016
View reviewed changes
Comment thread external/kafka-beta-assembly/pom.xml
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka-beta-assembly_2.11</artifactId>
<packaging>jar</packaging>
<name>Spark Project External Kafka Assembly</name>

@markgrover markgrover Apr 15, 2016

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think it may be a good idea to update this, so the two kafka assemblies can be differentiated in the build.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zsxwing
zsxwing reviewed Jun 29, 2016
View reviewed changes
Comment thread external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka/KafkaUtils.scala
@Experimental
object KafkaUtils extends Logging {
/**
* Scala constructor for a batch-oriented interface for consuming from Kafka.

@zsxwing zsxwing Jun 29, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please add :: Experimental :: at the beginning of comments if you add the @Experimental tag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zsxwing

zsxwing commented Jun 29, 2016

Copy link
Copy Markdown
Member

Finished my round of reviewing. Some some nits and one question about commitAsync left.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger
[SPARK-12177][Streaming][Kafka] review feedback
f863369
@koeninger

koeninger commented Jun 29, 2016

Copy link
Copy Markdown
Contributor Author

@zsxwing Thanks for the fixes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tdas
tdas reviewed Jun 29, 2016
View reviewed changes
Comment thread ...nal/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka/DirectKafkaInputDStream.scala Outdated
* configuration parameters</a>.
* Requires "bootstrap.servers" to be set with Kafka broker(s),
* NOT zookeeper servers, specified in host1:port1,host2:port2 form.
* @param driverConsumer zero-argument function for you to construct a Kafka Consumer,

@tdas tdas Jun 29, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

fix docs

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tdas

tdas commented Jun 30, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Overall, this is looking good. Two high level points.

  1. Now we have two subprojects both creating org.apache.spark.streaming.kafka.KafkaUtils. I think this is going to cause problems downstream in the docs and stuff. Also it will be hard for users to disambiguate what's being used in code. So I propose changing the package name for the new one to o.a.s.streaming.kafka010. All the new classes will be in that package. What do you think?
  2. Don't need CanCommitOffsets.
  3. We need a whole lot of new docs, especially updates in the streaming kafka integration guide. That will be a different PR. Could you start working on that?
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger

koeninger commented Jun 30, 2016

Copy link
Copy Markdown
Contributor Author

You do need CanCommitOffsets because DirectKafkaInputDstream is now
private, so otherwise you have nothing to cast to to access that method.
On Jun 29, 2016 7:11 PM, "Tathagata Das" [email protected] wrote:

Overall, this is looking good. Two high level points.

Now we have two subprojects both creating
org.apache.spark.streaming.kafka.KafkaUtils. I think this is going to cause
problems downstream in the docs and stuff. Also it will be hard for user to
disambiguate whats being used. So I propose changing the package name for
the new one to o.a.s.streaming.kafka010. All the new classes will be
in that package.
2.

Don't need CanCommitOffsets.
3.

We need a whole lot of new docs, especially updates in the streaming
kafka integration guide. That will be a different PR. Could you start
working on that?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11863 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAGABz0T__MSSwsM6znRLSwfh8UwC1Kcks5qQwmqgaJpZM4H1Pg1
.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SparkQA

SparkQA commented Jun 30, 2016

Copy link
Copy Markdown

Test build #61495 has finished for PR 11863 at commit 31502d9.

  • This patch fails from timeout after a configured wait of 250m.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tdas

tdas commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

Aah, right. My bad. In that case, there arent major issues as far as i can see, let me merge this, and test how the docs look like. I am pretty sure its going to cause trouble with two KafkaUtils. And in that case I will handle the package renaming.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tdas

tdas commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

Well.. after the tests pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger

koeninger commented Jun 30, 2016

Copy link
Copy Markdown
Contributor Author

I'll do the scaladoc fix and the package rename. I think the package rename is fine even if it did work with docs, just to disambiguate things.

Will start a separate ticket for documentation updates.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tdas

tdas commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

sounds good. thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

koeninger added 2 commits June 29, 2016 19:55
@koeninger
[SPARK-12177][Streaming][Kafka] fix docstring
4caca18
@koeninger
[SPARK-12177][Streaming][Kafka] move package name to include kafka 0.…
cffb0e0
…10 version number, to disambiguate from the older connector
@SparkQA

SparkQA commented Jun 30, 2016

Copy link
Copy Markdown

Test build #61506 has finished for PR 11863 at commit f863369.

  • This patch fails from timeout after a configured wait of 250m.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SparkQA

SparkQA commented Jun 30, 2016

Copy link
Copy Markdown

Test build #3151 has finished for PR 11863 at commit f863369.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SparkQA

SparkQA commented Jun 30, 2016

Copy link
Copy Markdown

Test build #3150 has finished for PR 11863 at commit f863369.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SparkQA

SparkQA commented Jun 30, 2016

Copy link
Copy Markdown

Test build #61513 has finished for PR 11863 at commit cffb0e0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tdas

tdas commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

LGTM. Merging this to master and 2.0. Thank you very much @koeninger for this awesome effort. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asfgit asfgit closed this in dedbcee Jun 30, 2016
asfgit pushed a commit that referenced this pull request Jun 30, 2016
@koeninger @tdas
[SPARK-12177][STREAMING][KAFKA] Update KafkaDStreams to new Kafka 0.1…
3134f11
…0 Consumer API

## What changes were proposed in this pull request?

New Kafka consumer api for the released 0.10 version of Kafka

## How was this patch tested?

Unit tests, manual tests

Author: cody koeninger <[email protected]>

Closes #11863 from koeninger/kafka-0.9.

(cherry picked from commit dedbcee)
Signed-off-by: Tathagata Das <[email protected]>
tdas
tdas reviewed Jun 30, 2016
View reviewed changes
Comment thread .../kafka-0-10/src/test/java/org/apache/spark/streaming/kafka010/JavaConsumerStrategySuite.java

// make sure constructors can be called from java
final ConsumerStrategy<String, String> sub0 =
Subscribe.<String, String>apply(topics, kafkaParams, offsets);

@tdas tdas Jun 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is seems to break in scala 2.10 and not scala 2.11. This is very weird.

Merging this PR broke 2.10 builds - https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Compile/job/spark-master-compile-sbt-scala-2.10/1947/console

[error] /home/jenkins/workspace/spark-master-compile-sbt-scala-2.10/external/kafka-0-10/src/test/java/org/apache/spark/streaming/kafka010/JavaConsumerStrategySuite.java:54:  error: incompatible types: Collection<String> cannot be converted to Iterable<String>
[error]       Subscribe.<String, String>apply(topics, kafkaParams, offsets);
[error]                                       ^
[error] /home/jenkins/workspace/spark-master-compile-sbt-scala-2.10/external/kafka-0-10/src/test/java/org/apache/spark/streaming/kafka010/JavaConsumerStrategySuite.java:69:  error: incompatible types: Collection<TopicPartition> cannot be converted to Iterable<TopicPartition>
[error]       Assign.<String, String>apply(parts, kafkaParams, offsets);
[error]                                    ^

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rxin rxin Jun 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We should figure out a way to fix scala 2.10. I don't think we need to revert this though since 2.10 is no longer the default build and it does not fail PRs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tdas tdas Jun 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Okay found the issue. In scala 2.10, if companion object of a case class has explicitly defined apply(), then the implicit apply method is not generated. In scala 2.11 it is generated.

I remember now, this type of stuff is why we avoid using case classes in the public API. Do you mind if I convert these to simple classes??

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tdas tdas Jun 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I refactored the API to avoid case classes and minimize publicly visible classes - #13996

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tdas

tdas commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

I played around with the API and I found a few issues

  1. I mentioned above, case classes lead to problems in the public API. The API could be simpler, and same for both Java and Scala users (dont like the apply vs create).
  2. The wrapping between java and scala maps were sometimes leading to the map not being serializable, and thus causing serialization issues in Subscribe and Assign strategies when checkpointing.
  3. ConsumerStrategy class is an interface making it hard to add methods later without breaking compatibility.

I have opened a new PR to address them - please take a look - #13996

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BiyuHuang

BiyuHuang commented Aug 3, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

hey,I have an question about the setting "enable.auto.commit",could it be changed ????Because I wanna save the offsets information to zookeeper cluster.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@koeninger

koeninger commented Aug 3, 2017 via email

Copy link
Copy Markdown
Contributor Author
You won't get any reasonable semantics out of auto commit, because it will commit on the driver without regard to what the executors have done.
…
On Aug 2, 2017 21:46, "Wallace Huang" ***@***.***> wrote: hey,I have an question about the setting "auto.commit.enable", It could be changed ????Because I wanna save the offsets information to zookeeper cluster. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#11863 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGAByVZ2QEf_o627Z7BKdRBuCtmza-Nks5sUTSTgaJpZM4H1Pg1> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BiyuHuang

BiyuHuang commented Aug 3, 2017

Copy link
Copy Markdown

I'm wondering that why the setting "enable.auto.commit" existed, but it was set to false by default and I could't modify it . Anyway, how do I use it ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@koeninger @SparkQA @markgrover @tdas @zsxwing @BiyuHuang @lfrancke @rxin @jerryshao @eallain-poctu
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.