cadonna commented on a change in pull request #8902:
URL: https://github.com/apache/kafka/pull/8902#discussion_r452148874



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStore.java
##########
@@ -103,8 +104,12 @@ public void init(final ProcessorContext context,
 
     @SuppressWarnings("unchecked")
     void initStoreSerde(final ProcessorContext context) {
+        final String storeName = name();
+        final String changelogTopic = 
ProcessorContextUtils.changelogFor(context, storeName);
         serdes = new StateSerdes<>(
-            ProcessorStateManager.storeChangelogTopic(context.applicationId(), 
name()),
+             changelogTopic != null ?
+                changelogTopic :
+                
ProcessorStateManager.storeChangelogTopic(context.applicationId(), storeName),

Review comment:
       I think we still need the if-then-else. 
`ProcessorContextUtils.changelogFor()` checks that the processor context is of 
type `InternalProcessorContext` to be able to call `changelogFor()` on it. It 
does not consider the case where no changelog exists (i.e., `changelogFor()` 
returns `null`). The `null` check is done here. Fallback is in both cases 
`ProcessorStateManager.storeChangelogTopic()`.  




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