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



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractProcessorContext.java
##########
@@ -45,24 +45,23 @@
     protected ProcessorNode<?, ?> currentNode;
     private long currentSystemTimeMs;
 
-    final StateManager stateManager;

Review comment:
       Not sure why we need to move this from the abstract class into the child 
classes?

##########
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:
       It seems we don't need this if-then-else any longer as it's already 
taken care of within `ProcessorContextUtils.changelogFor`? (Similar for other 
classes.)

##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
##########
@@ -73,22 +73,23 @@
     private final Set<String> globalNonPersistentStoresTopics = new 
HashSet<>();
     private final OffsetCheckpoint checkpointFile;
     private final Map<TopicPartition, Long> checkpointFileCache;
+    private final Map<String, String> storeToChangelogTopic;
 
     public GlobalStateManagerImpl(final LogContext logContext,
                                   final ProcessorTopology topology,
                                   final Consumer<byte[], byte[]> 
globalConsumer,
                                   final StateDirectory stateDirectory,
                                   final StateRestoreListener 
stateRestoreListener,
                                   final StreamsConfig config) {
+        storeToChangelogTopic = topology.storeToChangelogTopic();

Review comment:
       Wondering if we should pass `storeToChangelogTopic()` and 
`.globalStateStores()` into the constructor instead of `ProcessorTopology` ?




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