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



##########
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 would not put any code that is not related to casts of 
`ProcessorContext` into `ProessorContextUtils`. I think the goal of 
`ProessorContextUtils` is to contain all code of which we want to get rid of in 
the future once the casts are fixed.
   
   We could move the `null` check into the constructor of `StateSerde` since we 
do also there a `null` check. 




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