-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-4964] [Streaming] Exactly-once semantics for Kafka #3798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
76913e2
Batch oriented kafka rdd, WIP. todo: cluster metadata / finding leader
koeninger 1d70625
WIP on kafka cluster
koeninger 0b94b33
use dropWhile rather than filter to trim beginning of fetch response
koeninger 4dafd1b
method to get leader offsets, switch rdd bound to being exclusive sta…
koeninger ce91c59
method to get consumer offsets, explicit error handling
koeninger 7d050bc
methods to set consumer offsets and get topic metadata, switch back t…
koeninger 783b477
update tests for kafka 8.1.1
koeninger 29c6b43
cleanup logging
koeninger 3c2a96a
fix scalastyle errors
koeninger 4b078bf
differentiate between leader and consumer offsets in error message
koeninger 8d7de4a
make sure leader offsets can be found even for leaders that arent in …
koeninger 979da25
dont allow empty leader offsets to be returned
koeninger 38bb727
give easy access to the parameters of a KafkaRDD
koeninger 326ff3c
add some tests
koeninger 6bf14f2
first attempt at a Kafka dstream that allows for exactly-once semantics
koeninger bcca8a4
Merge branch 'master' of https://github.com/apache/spark into kafkaRdd
koeninger 37d3053
make KafkaRDDPartition available to users so offsets can be committed…
koeninger cac63ee
additional testing, fix fencepost error
koeninger e09045b
[SPARK-4964] add foreachPartitionWithIndex, to avoid doing equivalent…
koeninger 8bfd6c0
[SPARK-4964] configure rate limiting via spark.streaming.receiver.max…
koeninger 1d50749
[SPARK-4964] code cleanup per tdas
koeninger adf99a6
[SPARK-4964] fix serialization issues for checkpointing
koeninger 356c7cc
[SPARK-4964] code cleanup per helena
koeninger e93eb72
[SPARK-4964] refactor to add preferredLocations. depends on SPARK-4014
koeninger e86317b
[SPARK-4964] try seed brokers in random order to spread metadata requ…
koeninger 0458e4e
[SPARK-4964] recovery of generated rdds from checkpoint
koeninger 548d529
Merge branch 'master' of https://github.com/apache/spark into kafkaRdd
koeninger c1bd6d9
[SPARK-4964] use newly available attemptNumber for correct retry beha…
koeninger d4a7cf7
[SPARK-4964] allow for use cases that need to override compute for cu…
koeninger bb80bbe
[SPARK-4964] scalastyle line length
koeninger 2e67117
[SPARK-4964] one potential way of hiding most of the implementation, …
koeninger 19406cc
Merge branch 'master' of https://github.com/apache/spark into kafkaRdd
koeninger 99d2eba
[SPARK-4964] Reduce level of nesting. If beginning is past end, its …
koeninger 80fd6ae
[SPARK-4964] Rename createExactlyOnceStream so it isnt over-promising…
koeninger 2b340d8
[SPARK-4964] refactor per TD feedback
koeninger 9a838c2
[SPARK-4964] code cleanup, add more tests
koeninger 0090553
[SPARK-4964] javafication of interfaces
koeninger 9adaa0a
[SPARK-4964] formatting
koeninger 4354bce
[SPARK-4964] per td, remove java interfaces, replace with final class…
koeninger 825110f
[SPARK-4964] rename stuff per TD
koeninger 8991017
[SPARK-4964] formatting
koeninger 0df3ebe
[SPARK-4964] add comments per pwendell / dibbhatt
koeninger 8c31855
[SPARK-4964] remove HasOffsetRanges interface from return types
koeninger 59e29f6
[SPARK-4964] settle on "Direct" as a naming convention for the new st…
koeninger 1dc2941
[SPARK-4964] silence ConsumerConfig warnings about broker connection …
koeninger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[SPARK-4964] code cleanup per tdas
- Loading branch information
commit 1d507490c8300bdb0c423d538aeaa81b402b5926
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,8 +73,6 @@ class DeterministicKafkaInputDStream[ | |
| } | ||
| } | ||
|
|
||
| // TODO based on the design of InputDStream's lastValidTime, it appears there isn't a | ||
| // thread safety concern with private mutable state, but is this certain? | ||
| private var currentOffsets = fromOffsets | ||
|
|
||
| @tailrec | ||
|
|
@@ -99,9 +97,7 @@ class DeterministicKafkaInputDStream[ | |
| maxMessagesPerPartition.map { mmp => | ||
| leaderOffsets.map { kv => | ||
|
||
| val (k, v) = kv | ||
| val curr = currentOffsets(k) | ||
| val diff = v - curr | ||
| if (diff > mmp) (k, curr + mmp) else (k, v) | ||
| k -> Math.min(currentOffsets(k) + mmp, v) | ||
| } | ||
| }.getOrElse(leaderOffsets) | ||
| } | ||
|
|
||
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.
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.
There isnt a thread concern here. For all these class fields, there is a concern with checkpointing necessary for driver fault recovery. Lets talk about this in the main thread.