agavra commented on code in PR #14648:
URL: https://github.com/apache/kafka/pull/14648#discussion_r1398269442


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/StreamJoinedStoreFactory.java:
##########
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams.kstream.internals;
+
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.common.serialization.Serde;
+import org.apache.kafka.streams.kstream.EmitStrategy;
+import org.apache.kafka.streams.kstream.JoinWindows;
+import org.apache.kafka.streams.processor.StateStore;
+import org.apache.kafka.streams.processor.internals.StoreFactory;
+import org.apache.kafka.streams.state.DslWindowParams;
+import org.apache.kafka.streams.state.StoreBuilder;
+import org.apache.kafka.streams.state.Stores;
+import org.apache.kafka.streams.state.WindowBytesStoreSupplier;
+import org.apache.kafka.streams.state.WindowStore;
+
+public class StreamJoinedStoreFactory<K, V1, V2> extends 
AbstractConfigurableStoreFactory {
+
+    private final String name;
+    private final JoinWindows windows;
+    private final Serde<?> valueSerde;
+    private final WindowBytesStoreSupplier storeSupplier;
+    private final StreamJoinedInternal<K, V1, V2> joinedInternal;
+
+    private boolean loggingEnabled;
+    private final Map<String, String> logConfig;
+
+    public enum Type {
+        THIS,
+        OTHER
+    }
+
+    public StreamJoinedStoreFactory(
+            final String name,
+            final JoinWindows windows,
+            final StreamJoinedInternal<K, V1, V2> joinedInternal,
+            final Type type
+    ) {
+        super(joinedInternal.dslStoreSuppliers());
+        this.name = name + "-store";
+        this.joinedInternal = joinedInternal;
+        this.windows = windows;
+        this.loggingEnabled = joinedInternal.loggingEnabled();
+        this.logConfig = new HashMap<>(joinedInternal.logConfig());
+
+        // since this store is configured to retain duplicates, we should
+        // not compact, so we override the configuration to make sure that
+        // it's just delete (window stores are configured to compact,delete)
+        this.logConfig.put(TopicConfig.CLEANUP_POLICY_CONFIG, 
TopicConfig.CLEANUP_POLICY_DELETE);

Review Comment:
   There is a test for it (not added in this PR)! that's how it caught this bug 
;) I don't remember which file it's in though.. if I figure it out I'll link it 
here



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to