mjsax commented on code in PR #20910:
URL: https://github.com/apache/kafka/pull/20910#discussion_r2536883093


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableProcessValues.java:
##########
@@ -90,80 +88,69 @@ public boolean enableSendingOldValues(final boolean 
forceMaterialization) {
         return sendOldValues;
     }
 
-    private class KTableTransformValuesProcessor extends 
ContextualProcessor<K, Change<V>, K, Change<VOut>> {
-        private final ValueTransformerWithKey<? super K, ? super V, ? extends 
VOut> valueTransformer;
-        private KeyValueStoreWrapper<K, VOut> store;
-        private TimestampedTupleForwarder<K, VOut> tupleForwarder;
+    private class KTableFixedKeyProcessor extends ContextualProcessor<K, 
Change<V>, K, Change<VOut>> {
+        private final FixedKeyProcessor<? super K, ? super V, ? extends VOut> 
fixedKeyProcessor;
+        private ForwardCaptureProcessorContext<K, V, VOut> captureContext;
 
-        private KTableTransformValuesProcessor(final ValueTransformerWithKey<? 
super K, ? super V, ? extends VOut> valueTransformer) {
-            this.valueTransformer = Objects.requireNonNull(valueTransformer, 
"valueTransformer");
+
+        private KTableFixedKeyProcessor(final FixedKeyProcessor<? super K, ? 
super V, ? extends VOut> fixedKeyProcessor) {
+            this.fixedKeyProcessor = Objects.requireNonNull(fixedKeyProcessor, 
"fixedKeyProcessor");
         }
 
+        @SuppressWarnings({"rawtypes", "unchecked"})
         @Override
         public void init(final ProcessorContext<K, Change<VOut>> context) {
             super.init(context);
-            final InternalProcessorContext<K, Change<VOut>> 
internalProcessorContext = (InternalProcessorContext<K, Change<VOut>>) context;
-            valueTransformer.init(new 
ForwardingDisabledProcessorContext(internalProcessorContext));
-            if (queryableName != null) {
-                store = new KeyValueStoreWrapper<>(context, queryableName);
-                tupleForwarder = new TimestampedTupleForwarder<>(
-                    store.store(),
-                    context,
-                    new TimestampedCacheFlushListener<>(context),
-                    sendOldValues);
-            }
+            captureContext = new ForwardCaptureProcessorContext<>(context, 
queryableName, sendOldValues, fixedKeyProcessor);
+            fixedKeyProcessor.init((FixedKeyProcessorContext) captureContext);
         }
 
         @Override
         public void process(final Record<K, Change<V>> record) {
-            final VOut newValue = valueTransformer.transform(record.key(), 
record.value().newValue);
-
-            if (queryableName != null) {

Review Comment:
   This moves into `ForwardCaptureProcessorContext`



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