guozhangwang commented on code in PR #18342:
URL: https://github.com/apache/kafka/pull/18342#discussion_r1915899685


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/GraphGraceSearchUtil.java:
##########
@@ -70,27 +61,4 @@ private static long findAndVerifyWindowGrace(final GraphNode 
graphNode, final St
         return inheritedGrace;
     }
 
-    @SuppressWarnings("rawtypes")
-    private static Long extractGracePeriod(final GraphNode node) {

Review Comment:
   Still a good progress that we replaced four nested instanceof with just one 
:) Just kidding.



##########
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:
   nit: misaligned indentation?



-- 
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]

Reply via email to