lucliu1108 commented on code in PR #20968:
URL: https://github.com/apache/kafka/pull/20968#discussion_r2791201370
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java:
##########
@@ -58,6 +58,11 @@ public ProcessorParameters(final
FixedKeyProcessorSupplier<KIn, VIn, VOut> proce
public ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier() {
return processorSupplier;
}
+
+ public ProcessorSupplier<KIn, VIn, KOut, VOut>
wrappedProcessSupplier(final InternalTopologyBuilder topologyBuilder) {
+ ApiUtils.checkSupplier(processorSupplier);
+ return topologyBuilder.wrapProcessorSupplier(processorName,
processorSupplier);
+ }
Review Comment:
The wrapping process is also repeated in
`ProcessorParameters#addProcessorTo` method, maybe we want to substitute [these
lines](https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java#L68-L69)
with the helper method?
This will make [processorSupplier
block](https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java#L67)
and [fixedKeyProcessorSupplier
block](https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/ProcessorParameters.java#L82)
not looks similar, so might be good to add a parallel
`wrappedFixedKeyProcessSupplier` method
- it could be over-engineering on helper method, just random thoughts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]