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
KAFKA-6958: Overload KStream methods to allow to name operation name using the new Named class #6411
Conversation
68f4244
to
74a7a61
Compare
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.
@fhussonnois please rebase this PR |
ping @vvcephei and @ableegoldman for reviews |
47e51ed
to
0d9d8c2
Compare
Hi @fhussonnois #6410 was just merged, so if you could rebase this PR, we can make another pass and get this one merged as well. Thanks for your work and patience! |
08a559e
to
dc354f4
Compare
@bbejeck This PR has been rebase. The KIP has been updated to include the newest methods that was missing : |
Thanks @fhussonnois! taking a look at this today. |
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.
Thanks @fhussonnois just some very minor comments, otherwise LGTM
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java
Outdated
Show resolved
Hide resolved
call for second review any of @guozhangwang , @mjsax @vvcephei, @ableegoldman, @abbccdda |
@@ -470,6 +479,233 @@ public void shouldUseSpecifiedNameForSinkProcessor() { | |||
assertSpecifiedNameForOperation(topology, "KSTREAM-SOURCE-0000000000", expected, "KSTREAM-SINK-0000000001"); | |||
} | |||
|
|||
@Test | |||
public void shouldUseSpecifiedNameForMapOperation() { |
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.
Do we consider refactoring these tests with one comment function? I could see L485-487 are repeated multiple times.
dc354f4
to
f7b5a09
Compare
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.
Thanks for the PR @fhussonnois !
According to my code analyser, several of the new methods are unused. Can we make sure we have test coverage verifying the new overloads work properly? I know this may seem paranoid, but we've had several embarrasing bugs in the Scala API, which should be similarly trivial, due to typos in the implementation code that could have been caught if they had any test coverage at all.
I had some thoughts about Named/NamedInternal, which I made inline.
There were several nits, which I just sent "suggestions" for.
Not sure if it helps, but I created a child page to your KIP, so the reviewers can strike though methods as you send PRs for them. (I just did the methods in this PR). I found it useful to go down the checklist for this PR.
Looks good, thanks!
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
@SuppressWarnings("unchecked") |
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.
@SuppressWarnings("unchecked") | |
@SuppressWarnings({"unchecked", "rawtypes"}) |
streams/src/test/java/org/apache/kafka/streams/StreamsBuilderTest.java
Outdated
Show resolved
Hide resolved
streams/src/test/java/org/apache/kafka/streams/StreamsBuilderTest.java
Outdated
Show resolved
Hide resolved
streams/src/test/java/org/apache/kafka/streams/StreamsBuilderTest.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java
Outdated
Show resolved
Hide resolved
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java
Outdated
Show resolved
Hide resolved
8ace90c
to
796954a
Compare
796954a
to
9aa0eed
Compare
@bbejeck This PR has been rebased, most of the feedbacks has been resolved. |
both Java 8 and Java 11 failed, test results already removed. retest this please |
@bbejeck if everything is OK we this PR, could we merge it to move forward to the next one ? |
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.
Thanks @fhussonnois LGTM modulo comments left over from @vvcephei and @abbccdda
…ndex counter (#6754) When users provide a name for operation via the Streams DSL, we need to increment the counter used for auto-generated names to make sure any operators downstream of a named operator still produce a compatible name. This PR is a subset of #6411 by @fhussonnois. We need to merge this PR now because it covers cases when users name repartition topics or state stores. Updated tests to reflect the counter produces expected number even when the user provides a name. Matthias J. Sax <mjsax@apache.org>, John Roesler <john@confluent.io>
Hi @fhussonnois if you can rebase this PR we can then merge it, then move on to parts 4 and 5. Thanks! |
…using the new Named class Sub-task required to allow to define custom processor names with KStreams DSL(KIP-307) : - overload methods for stateless operations to accept a Named parameter (filter, filterNot, map, mapValues, foreach, peek, branch, transform, transformValue, flatTransform) - overload process method to accept a Named parameter - overload join/leftJoin/outerJoin methods
9aa0eed
to
35e5b43
Compare
Hi @bbejeck , this PR has been rebased. |
both Java 8 and Java 11 failed, test results already cleared out. retest this please |
Java 8 passed Java 11 failed with retest this please |
Java 8 failed, Java 11 passed retest this please |
retest this please |
Merged #6411 into trunk. |
Thank you @fhussonnois! |
…ndex counter (apache#6754) When users provide a name for operation via the Streams DSL, we need to increment the counter used for auto-generated names to make sure any operators downstream of a named operator still produce a compatible name. This PR is a subset of apache#6411 by @fhussonnois. We need to merge this PR now because it covers cases when users name repartition topics or state stores. Updated tests to reflect the counter produces expected number even when the user provides a name. Matthias J. Sax <mjsax@apache.org>, John Roesler <john@confluent.io>
…using the new Named class (apache#6411) Sub-task required to allow to define custom processor names with KStreams DSL(KIP-307) : - overload methods for stateless operations to accept a Named parameter (filter, filterNot, map, mapValues, foreach, peek, branch, transform, transformValue, flatTransform) - overload process method to accept a Named parameter - overload join/leftJoin/outerJoin methods Reviewers: John Roesler <john@confluent.io>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bbejeck@gmail.com>
Hi @mjsax @bbejeck
This is the 3rd PR for the KIP-307.
NOTE : PR 6410 should be merge first
Thanks a lot for the review.