ableegoldman commented on code in PR #18342:
URL: https://github.com/apache/kafka/pull/18342#discussion_r1917416613
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/GroupedStreamAggregateBuilder.java:
##########
@@ -66,23 +66,67 @@ class GroupedStreamAggregateBuilder<K, V> {
this.userProvidedRepartitionTopicName = groupedInternal.name();
}
- <KR, VR> KTable<KR, VR> build(final NamedInternal functionName,
- final StoreFactory storeFactory,
- final KStreamAggProcessorSupplier<K, V, KR,
VR> aggregateSupplier,
- final String queryableStoreName,
- final Serde<KR> keySerde,
- final Serde<VR> valueSerde,
- final boolean isOutputVersioned) {
- assert queryableStoreName == null ||
queryableStoreName.equals(storeFactory.storeName());
+ <KR, VR> KTable<KR, VR> buildNonWindowed(final NamedInternal functionName,
+ final String storeName,
+ final
KStreamAggProcessorSupplier<K, V, KR, VR> aggregateSupplier,
+ final String queryableStoreName,
+ final Serde<KR> keySerde,
+ final Serde<VR> valueSerde,
+ final boolean isOutputVersioned) {
+ final String aggFunctionName = functionName.name();
+
+ final ProcessorGraphNode<K, V> aggProcessorNode =
+ new ProcessorGraphNode<>(
+ aggFunctionName,
+ new ProcessorParameters<>(aggregateSupplier, aggFunctionName)
+ );
+ aggProcessorNode.setOutputVersioned(isOutputVersioned);
+
+ return build(aggFunctionName, storeName, aggregateSupplier,
aggProcessorNode, queryableStoreName, keySerde, valueSerde);
+ }
+
+ <KR, VR> KTable<KR, VR> buildWindowed(final NamedInternal functionName,
+ final String storeName,
+ final long gracePeriod,
+ final KStreamAggProcessorSupplier<K,
V, KR, VR> aggregateSupplier,
+ final String queryableStoreName,
+ final Serde<KR> keySerde,
+ final Serde<VR> valueSerde,
+ final boolean isOutputVersioned) {
final String aggFunctionName = functionName.name();
+ final GracePeriodGraphNode<K, V> gracePeriodAggProcessorNode =
+ new GracePeriodGraphNode<>(
+ aggFunctionName,
+ new ProcessorParameters<>(aggregateSupplier, aggFunctionName),
+ gracePeriod
+ );
+
+ gracePeriodAggProcessorNode.setOutputVersioned(isOutputVersioned);
+
+ return build(aggFunctionName, storeName, aggregateSupplier,
gracePeriodAggProcessorNode, queryableStoreName, keySerde, valueSerde);
+ }
+
+ <KR, VR> KTable<KR, VR> build(final String aggFunctionName,
+ final String storeName,
Review Comment:
whoops 🙂
--
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]