MINOR: Suppress header-less partitioner deprecation - #23134
MINOR: Suppress header-less partitioner deprecation#23134UladzislauBlok wants to merge 2 commits into
Conversation
mjsax
left a comment
There was a problem hiding this comment.
Thanks for the cleanup. Made a pass.
| } | ||
| } | ||
|
|
||
| private static class FixedPartitionPartitioner implements StreamPartitioner<Integer, Object> { |
There was a problem hiding this comment.
| private static class FixedPartitionPartitioner implements StreamPartitioner<Integer, Object> { | |
| private static class FixedPartitionPartitioner implements StreamPartitioner<String, String> { |
There was a problem hiding this comment.
The removed code also uses <String, String>
private StreamPartitioner<String, String> constantPartitioner(final Integer partition)
| partitionerInvocation.incrementAndGet(); | ||
| return Optional.of(Collections.singleton(partition)); | ||
| .withStreamPartitioner(new StreamPartitioner<>() { | ||
| @SuppressWarnings({"removal"}) |
There was a problem hiding this comment.
| @SuppressWarnings({"removal"}) | |
| @SuppressWarnings("removal") |
| return config; | ||
| } | ||
|
|
||
| private static class FixedPartitionPartitioner implements StreamPartitioner<Integer, Object> { |
There was a problem hiding this comment.
Seems we are duplicating code here (3x in this PR), plus already existing FixedPartitionPartitioner in StreamsMetadataStateTest).
Might be worth to move to test-fixtures module and have it only a single time?
There was a problem hiding this comment.
I mentioned it. Just wandering if 4 occurrences is enough to extract it
Don't think we expect any more uses of this partitoner + after 5.0 we're going to remove it (and we could back to lambda syntax)
There was a problem hiding this comment.
Guess should be fine either way. (Don't think there is a "count threshold"; well, for production code there is, and it's 2 -- we should not have any duplication there. But for test-only code, we can handle it more loosley)
as a title
We could think about promoting some set of standard test partitioners into common util, but would be overkill IMO
Reviewers: Matthias J. Sax matthias@confluent.io