vpapavas commented on code in PR #12644:
URL: https://github.com/apache/kafka/pull/12644#discussion_r981415910


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/StreamStreamJoinNode.java:
##########
@@ -92,17 +96,38 @@ public void writeToTopology(final InternalTopologyBuilder 
topologyBuilder) {
         final String thisWindowedStreamProcessorName = 
thisWindowedStreamProcessorParameters.processorName();
         final String otherWindowedStreamProcessorName = 
otherWindowedStreamProcessorParameters.processorName();
 
-        topologyBuilder.addProcessor(thisProcessorName, 
thisProcessorParameters().processorSupplier(), thisWindowedStreamProcessorName);
-        topologyBuilder.addProcessor(otherProcessorName, 
otherProcessorParameters().processorSupplier(), 
otherWindowedStreamProcessorName);
-        
topologyBuilder.addProcessor(mergeProcessorParameters().processorName(), 
mergeProcessorParameters().processorSupplier(), thisProcessorName, 
otherProcessorName);
-        topologyBuilder.addStateStore(thisWindowStoreBuilder, 
thisWindowedStreamProcessorName, otherProcessorName);
-        topologyBuilder.addStateStore(otherWindowStoreBuilder, 
otherWindowedStreamProcessorName, thisProcessorName);
-
-        if (enableSpuriousResultFix) {
-            outerJoinWindowStoreBuilder.ifPresent(builder -> 
topologyBuilder.addStateStore(builder, thisProcessorName, otherProcessorName));
+        if (isSelfJoin) {
+            
topologyBuilder.addProcessor(selfJoinProcessorParameters.processorName(), 
selfJoinProcessorParameters.processorSupplier(), 
thisWindowedStreamProcessorName);
+            topologyBuilder.addStateStore(thisWindowStoreBuilder, 
thisWindowedStreamProcessorName, selfJoinProcessorParameters.processorName());
+        } else {
+            topologyBuilder.addProcessor(thisProcessorName, 
thisProcessorParameters().processorSupplier(), thisWindowedStreamProcessorName);
+            topologyBuilder.addProcessor(otherProcessorName, 
otherProcessorParameters().processorSupplier(), 
otherWindowedStreamProcessorName);
+            
topologyBuilder.addProcessor(mergeProcessorParameters().processorName(), 
mergeProcessorParameters().processorSupplier(), thisProcessorName, 
otherProcessorName);
+            topologyBuilder.addStateStore(thisWindowStoreBuilder, 
thisWindowedStreamProcessorName, otherProcessorName);
+            topologyBuilder.addStateStore(otherWindowStoreBuilder, 
otherWindowedStreamProcessorName, thisProcessorName);
+
+            if (enableSpuriousResultFix) {
+                outerJoinWindowStoreBuilder.ifPresent(builder -> 
topologyBuilder.addStateStore(builder, thisProcessorName, otherProcessorName));
+            }
         }
     }
 
+    public void setSelfJoin() {
+        this.isSelfJoin = true;
+    }
+
+    public boolean getSelfJoin() {

Review Comment:
   It's used in the tests



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