Skip to content
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

Merged
merged 1 commit into from May 31, 2019

Conversation

fhussonnois
Copy link
Contributor

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.

@fhussonnois fhussonnois changed the title KAFKA-6958-SUB-TASK3 KAFKA-6958: Overload KStream methods to allow to name operation name using the new Named class Mar 8, 2019
Copy link
Contributor

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

Overall this PR looks good to me, as any changes I'd suggest have already been addressed ion #6409 and #6410 this PR seems to be focused on adding the Named parameter overload to KStream and KStreamImpl and updating the tests.

@bbejeck
Copy link
Contributor

bbejeck commented Mar 12, 2019

@fhussonnois please rebase this PR

@bbejeck
Copy link
Contributor

bbejeck commented Mar 13, 2019

ping @vvcephei and @ableegoldman for reviews

@fhussonnois fhussonnois force-pushed the KAFKA-6958-SUB-TASK3 branch 6 times, most recently from 47e51ed to 0d9d8c2 Compare March 20, 2019 14:55
@bbejeck
Copy link
Contributor

bbejeck commented Apr 18, 2019

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!

@fhussonnois fhussonnois force-pushed the KAFKA-6958-SUB-TASK3 branch 3 times, most recently from 08a559e to dc354f4 Compare April 23, 2019 14:56
@fhussonnois
Copy link
Contributor Author

@bbejeck This PR has been rebase.

The KIP has been updated to include the newest methods that was missing :
flatTransformValues(ValueTransformerWithKeySupplier, Named,  String... )
flatTransformValues(ValueTransformerSupplier, Named, String...)

@bbejeck
Copy link
Contributor

bbejeck commented Apr 23, 2019

Thanks @fhussonnois! taking a look at this today.

Copy link
Contributor

@bbejeck bbejeck left a 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

@bbejeck
Copy link
Contributor

bbejeck commented Apr 24, 2019

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() {
Copy link
Contributor

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.

Copy link
Contributor

@vvcephei vvcephei 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 @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!

}

@Test
@SuppressWarnings("unchecked")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})

@fhussonnois fhussonnois force-pushed the KAFKA-6958-SUB-TASK3 branch 3 times, most recently from 8ace90c to 796954a Compare May 3, 2019 21:22
@fhussonnois
Copy link
Contributor Author

@bbejeck This PR has been rebased, most of the feedbacks has been resolved.

@bbejeck
Copy link
Contributor

bbejeck commented May 14, 2019

both Java 8 and Java 11 failed, test results already removed.

retest this please

@fhussonnois
Copy link
Contributor Author

@bbejeck if everything is OK we this PR, could we merge it to move forward to the next one ?

Copy link
Contributor

@bbejeck bbejeck left a 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

bbejeck added a commit that referenced this pull request May 17, 2019
…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>
@bbejeck
Copy link
Contributor

bbejeck commented May 22, 2019

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
@fhussonnois
Copy link
Contributor Author

Hi @bbejeck , this PR has been rebased.

@bbejeck
Copy link
Contributor

bbejeck commented May 30, 2019

both Java 8 and Java 11 failed, test results already cleared out.

retest this please

@bbejeck
Copy link
Contributor

bbejeck commented May 30, 2019

Java 8 passed Java 11 failed with kafka.integration.UncleanLeaderElectionTest.testUncleanLeaderElectionDisabled

retest this please

@bbejeck
Copy link
Contributor

bbejeck commented May 30, 2019

Java 8 failed, Java 11 passed

retest this please

@bbejeck
Copy link
Contributor

bbejeck commented May 31, 2019

retest this please

@bbejeck bbejeck merged commit 78c55c8 into apache:trunk May 31, 2019
@bbejeck
Copy link
Contributor

bbejeck commented May 31, 2019

Merged #6411 into trunk.

@bbejeck
Copy link
Contributor

bbejeck commented May 31, 2019

Thank you @fhussonnois!

Pengxiaolong pushed a commit to Pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…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>
Pengxiaolong pushed a commit to Pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…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>
@mjsax mjsax added the kip Requires or implements a KIP label Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kip Requires or implements a KIP streams
Projects
None yet
5 participants