spena commented on a change in pull request #10462:
URL: https://github.com/apache/kafka/pull/10462#discussion_r614114447



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamKStreamJoin.java
##########
@@ -60,20 +82,41 @@
     }
 
     private class KStreamKStreamJoinProcessor extends AbstractProcessor<K, V1> 
{
+        private static final boolean 
DISABLE_OUTER_JOIN_SPURIOUS_RESULTS_FIX_DEFAULT = false;
+
+        private final Predicate<Windowed<KeyAndJoinSide<K>>> 
recordWindowHasClosed =
+            windowedKey -> windowedKey.window().start() + joinAfterMs + 
joinGraceMs < maxObservedStreamTime.get();
 
         private WindowStore<K, V2> otherWindow;
         private StreamsMetricsImpl metrics;
         private Sensor droppedRecordsSensor;
+        private Optional<WindowStore<KeyAndJoinSide<K>, LeftOrRightValue>> 
outerJoinWindowStore = Optional.empty();
 
         @SuppressWarnings("unchecked")
         @Override
         public void init(final ProcessorContext context) {
             super.init(context);
             metrics = (StreamsMetricsImpl) context.metrics();
             droppedRecordsSensor = 
droppedRecordsSensorOrSkippedRecordsSensor(Thread.currentThread().getName(), 
context.taskId().toString(), metrics);
-            otherWindow = (WindowStore<K, V2>) 
context.getStateStore(otherWindowName);
+            otherWindow = context.getStateStore(otherWindowName);
+
+            if (!internalOuterJoinFixDisabled(context.appConfigs())) {
+                outerJoinWindowStore = outerJoinWindowName.map(name -> 
context.getStateStore(name));
+            }
         }
 
+        private boolean internalOuterJoinFixDisabled(final Map<String, Object> 
configs) {
+            final Object value = 
configs.get(StreamsConfig.InternalConfig.INTERNAL_DISABLE_OUTER_JOIN_SPURIOUS_RESULTS_FIX);
+            if (value == null) {
+                return DISABLE_OUTER_JOIN_SPURIOUS_RESULTS_FIX_DEFAULT;

Review comment:
       That constant name is confusing. I just removed the *_DEFAULT constant 
and return false when the config is not set. But the idea is that the join fix 
is enabled (disabled = false) if the config is not set.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to