Skip to content

KAFKA-7502: Cleanup KTable materialization logic in a single place#6174

Merged
guozhangwang merged 9 commits intoapache:trunkfrom
dongjinleekr:feature/KAFKA-7502
Mar 15, 2019
Merged

KAFKA-7502: Cleanup KTable materialization logic in a single place#6174
guozhangwang merged 9 commits intoapache:trunkfrom
dongjinleekr:feature/KAFKA-7502

Conversation

@dongjinleekr
Copy link
Copy Markdown
Contributor

This is a draft cleanup for KAFKA-7502. Here is the details:

  1. Make KTableKTableJoinNode abstract, and define its child classes ([NonMaterialized,Materialized]KTableKTableJoinNode) instead: now, all materialization-related routines are separated into the other classes.
  2. KTableKTableJoinNodeBuilder#build now instantiates [NonMaterialized,Materialized]KTableKTableJoinNode classes instead of KTableKTableJoinNode.

Committer Checklist (excluded from commit message)

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

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

@guozhangwang Is this what you meant? I found similar routines in KTableImpl#[filter, map, transform] methods. If it is correct, I will do the same work to that methods.

Please have a look you are free.

@mjsax mjsax added the streams label Jan 27, 2019
@dongjinleekr
Copy link
Copy Markdown
Contributor Author

retest this please

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

Rebased against the latest trunk. cc/ @guozhangwang @mjsax

Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

@dongjinleekr Thanks for your PR! I went through it and realized my original description on the JIRA ticket may not be very clear. I've hence updated the description and let me know if it clarifies a few things.

As for the PR itself, splitting KTableKTableJoinNode seems to me not addressing the original issue, but I do really like the way you inlined buildJoin. So how about reducing the scope of this PR to just do the cleanup of inlining buildJoin, while we can continue discussing on the ticket at the best solution to achieve the address of the ticket.

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

@guozhangwang I see. Then, how about this? I rebased against the latest trunk and added two commits (296ddfc, e57ad22); Now, all materialization logic in KTableKTableJoinNode is now moved into KTableImpl#doJoin. Is this way correct?

Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

This PR lgtm. I think this is a good first step towards KAFKA-7502. Left some minor comments.

Call for another review @bbejeck

Comment thread streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableImpl.java Outdated
@guozhangwang
Copy link
Copy Markdown
Contributor

@dongjinleekr could you run the unit test locally and see if the error is related?

@guozhangwang
Copy link
Copy Markdown
Contributor

retest this please

Copy link
Copy Markdown
Member

@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 looks good to me, just a couple of minor comments.

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 7, 2019

Java 8 passed, Java 11 failed but build results already cleaned up.

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 8, 2019

Both Java 8 and Java 11 failed, test results already cleaned out

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 11, 2019

@dongjinleekr what's the status on this PR? Once the comments are addressed I believe we can merge this PR.

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

@bbejeck Here is the update for the join operation. I am now working on the other operations and can finish it by this Friday.

@guozhangwang
Copy link
Copy Markdown
Contributor

@dongjinleekr Let's use separate PRs on other operations so that we can keep this one small and tangible for reviewing / merging.

BTW the failures are due to compilation errors: Execution failed for task ':streams:compileJava'.

Could you run ./gradlew streams:test locally and see if you can resolve these errors?

…ized]KTableKTableJoinNode. 2. Add KTableKTableJoinNodeBuilde#builder.
1. Add KTableKTableJoinNode[Builder]#keySerde.
2. Reorder KTableKTableJoinNodeBuilder's member methods, following the memeber variable definition order.
3. Add KTableKTableJoinNode#[getKeySerde, getValueSerde] methods.
4. Move KTableImpl#[keySerde, valueSerde] decision logic into KTableKTableJoinNodeBuilder#builder and [NonMaterialized, Materialized]KTableKTableJoinNode#[keySerde, valueSerde].
1. Make KTableKTableJoinMerger publie. (like KTableReduce, KTableAggregate.)
2. Add KTableKTableJoinMerger#of static methods: works as a workaround to the constructor.
3. Move [internalQueryableName, joinMerge, joinMergeProcessorParameters] variable in KTableImpl#doJoin into [NonMaterialized, Materialized]KTableKTableJoinNode.
…eJoinNode into KTableKTableJoinNode. 2. Move all materialization logic in KTableKTableJoinNode into KTable#doJoin.
…KTableKTableJoinNode#queryableStoreName and use KTableKTableJoinMerger#getQueryableName instead.
@dongjinleekr
Copy link
Copy Markdown
Contributor Author

@guozhangwang Here is the fix. I omitted a file from the last commit. (+1. rebased onto the latest trunk.)

And also, I will separate the other operators from this issue in Jira. Is that okay?

cc/ @bbejeck

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

@guozhangwang Or, only separated PRs for this issue? @bbejeck

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 13, 2019

Java 8 failed with

org.apache.kafka.common.security.authenticator.SaslAuthenticatorTest.testValidSaslScramSha256
org.apache.kafka.common.security.authenticator.SaslAuthenticatorTest.testMultipleServerMechanisms
kafka.api.UserQuotaTest.testThrottledProducerConsumer

Java 11 passed

retest this please

Copy link
Copy Markdown
Member

@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.

This PR looks good to me, less just one minor comment.

Comment thread streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableImpl.java Outdated
@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 13, 2019

Or, only separated PRs for this issue?

Fine with me to have multiple PRs on one Jira ticket, just make sure to have the Jira number in each PR title and in the PR comments state what parts you are working on.
\cc @guozhangwang

@dongjinleekr
Copy link
Copy Markdown
Contributor Author

Here it is. OMG, I just learned one more thing about Java's final variable! Thanks @bbejeck :)

And about Issue management, I am +1 to separating the PRs only. In that case, two of the other PRs should be based on the other, since TableProcessorNode is used by all of filter, map, and transform. (In other words, one former PR will be the preliminary work for the other two PRs.)

I am now working on filter now. Let's roll! 😄

cc/ @guozhangwang

Copy link
Copy Markdown
Member

@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.

LGTM! Thanks @dongjinleekr

@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM!

@guozhangwang guozhangwang merged commit 4ca8e40 into apache:trunk Mar 15, 2019
guozhangwang pushed a commit that referenced this pull request Mar 28, 2019
…ilter) (#6453)

This PR is a follow-up of #6174, which handles doFilter / doMapValues / doTransformValues methods.

Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
bbejeck pushed a commit that referenced this pull request Mar 29, 2019
This PR is a follow-up of #6174 and #6453, which cleans up KTableImpl#doTransformValues method.

Reviewers: Bill Bejeck <bbejeck@gmail.com>
jarekr pushed a commit to confluentinc/kafka that referenced this pull request Apr 18, 2019
* apache/trunk:
  MINOR: Retain public constructors of classes from public API (apache#6455)
  KAFKA-8118; Ensure ZK clients are closed in tests, fix verification (apache#6456)
  KAFKA-7813: JmxTool throws NPE when --object-name is omitted
  KAFKA-8114: Wait for SCRAM credential propagation in DelegationTokenEndToEndAuthorizationTest (apache#6452)
  KAFKA-8111; Set min and max versions for Metadata requests (apache#6451)
  KAFKA-7855: Kafka Streams Maven Archetype quickstart fails to compile out of the box (apache#6194)
  MINOR: Update code to not use deprecated methods (apache#6434)
  MINOR: Update Trogdor ConnectionStressWorker status at the end of execution (apache#6445)
  KAFKA-8091; Use commitSync to check connection failure in listener update test (apache#6450)
  KAFKA-7027: Add an overload build method in scala (apache#6373)
  MINOR: Fix typos in LogValidator (apache#6449)
  KAFKA-7502: Cleanup KTable materialization logic in a single place (apache#6174)
  KAFKA-7730; Limit number of active connections per listener in brokers (KIP-402)
  KAFKA-8091; Remove unsafe produce from dynamic listener update test (apache#6443)
  MINOR: Fix JavaDocs warnings (apache#6435)
  MINOR: Better messaging for invalid fetch response (apache#6427)
  MINOR: Use Java 8 lambdas in KStreamImplTest (apache#6430)
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…pache#6174)

This is a draft cleanup for KAFKA-7502. Here is the details:

* Make KTableKTableJoinNode abstract, and define its child classes ([NonMaterialized,Materialized]KTableKTableJoinNode) instead: now, all materialization-related routines are separated into the other classes.

* KTableKTableJoinNodeBuilder#build now instantiates [NonMaterialized,Materialized]KTableKTableJoinNode classes instead of KTableKTableJoinNode.

Reviewers: Guozhang Wang <wangguoz@gmail.com>,  Bill Bejeck <bbejeck@gmail.com>
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…ilter) (apache#6453)

This PR is a follow-up of apache#6174, which handles doFilter / doMapValues / doTransformValues methods.

Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
This PR is a follow-up of apache#6174 and apache#6453, which cleans up KTableImpl#doTransformValues method.

Reviewers: Bill Bejeck <bbejeck@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants