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-4217: Add KStream.flatTransform #5273
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
cc4a397
Add KStream.flatTransform
e220883
Add KStream.flatTransform (push 2)
cadonna bb0e6cc
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna 8380808
Add KStream.flatTransform (push 3)
cadonna ab703f8
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna f90c38c
Add KStream.flatTransform (push 4)
cadonna bd8410e
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna e4e3eed
Add KStream.flatTransform (push 5)
cadonna a1e1ccf
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna ec27fbc
Add KStream.flatTransform (push 6)
cadonna 0463abc
Add KStream.flatTransform (push 7)
cadonna a432cd1
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna a78be14
Add KStream.flatTransform (push 8)
cadonna 4002654
Add KStream.flatTransform (push 9)
cadonna 4a6b14a
Merge remote-tracking branch 'upstream/trunk' into kafka4217-flatTran…
cadonna defa401
Add KStream.flatTransform (push 10)
cadonna File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -263,6 +263,7 @@ public interface KStream<K, V> { | |
* @see #mapValues(ValueMapperWithKey) | ||
* @see #flatMapValues(ValueMapper) | ||
* @see #flatMapValues(ValueMapperWithKey) | ||
* @see #transform(TransformerSupplier, String...) | ||
* @see #flatTransform(TransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerWithKeySupplier, String...) | ||
|
@@ -304,6 +305,7 @@ public interface KStream<K, V> { | |
* @see #flatMap(KeyValueMapper) | ||
* @see #mapValues(ValueMapper) | ||
* @see #mapValues(ValueMapperWithKey) | ||
* @see #transform(TransformerSupplier, String...) | ||
* @see #flatTransform(TransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerWithKeySupplier, String...) | ||
|
@@ -351,6 +353,7 @@ public interface KStream<K, V> { | |
* @see #flatMap(KeyValueMapper) | ||
* @see #mapValues(ValueMapper) | ||
* @see #mapValues(ValueMapperWithKey) | ||
* @see #transform(TransformerSupplier, String...) | ||
* @see #flatTransform(TransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerSupplier, String...) | ||
* @see #transformValues(ValueTransformerWithKeySupplier, String...) | ||
|
@@ -497,7 +500,7 @@ void to(final TopicNameExtractor<K, V> topicExtractor, | |
* returns zero or one output record. | ||
* Thus, an input record {@code <K,V>} can be transformed into an output record {@code <K':V'>}. | ||
* This is a stateful record-by-record operation (cf. {@link #map(KeyValueMapper)}). | ||
* Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)} the processing progress | ||
* Furthermore, via {@link org.apache.kafka.streams.processor.Punctuator#punctuate(long)}, the processing progress | ||
* can be observed and additional periodic actions can be performed. | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already changed by somebody else. |
||
* <p> | ||
|
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.
Why do you remove
transform
? We only add a newflatTransform
buttransform
is not removed.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 didn't want to make the list of referenced methods too long, so I thought to let map reference transform and flatMap reference flatTransform. But I do not have hard feelings about it.
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.
Fair point. Not sure either :) So far, we list a lot of methods. Do you think we should do a general cleanup reduction of listed method? In the past, we only added but never removed?
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'd be in favor of either just adding the new method to the list (without removing another one) or deleting this whole list.
Personally, I feel the list is a little redundant with this interface itself.
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 am fine with both options, but I am in favor of deleting the list. Out of curiosity, what is the advantage of just adding new methods to the list without removing others?
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.
Unless @mjsax objects, I vote to just delete these lists. At this point, it almost looks like it's directing you to all the other methods in this interface, which seems redundant.
I'm not sure I follow your last question. The list exists to direct readers to other relevant methods. I'm not sure why adding
flatTransform
renderstransform
irrelevant...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's overall useful to use
@see
to guide users -- however, I agree that it's getting a very long list. This seems to be a general issue though. Maybe, we should do a follow up PR, and go over all JavaDocs and clean them up? We should define a "strategy/guideline" how we cross reference. For example, does it make sense to link to bothflatMapValues
-- I guess not.WDYT @vvcephei ?
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.
Yeah, I'm fine with defining and applying a coherent strategy.
In lieu of that, I guess the default thing to do here would be to just add the new method to the list without removing any other items.
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 re-added the links. @vvcephei My questions was about just adding links vs reorganizing links. I think my question was answered by the decision taken.
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.
Created https://issues.apache.org/jira/browse/KAFKA-7602