guozhangwang commented on a change in pull request #11609:
URL: https://github.com/apache/kafka/pull/11609#discussion_r771737051



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java
##########
@@ -349,8 +351,10 @@ private void rebuildMetadata(final Map<HostInfo, 
Set<TopicPartition>> activePart
                     final Map<String, Collection<String>> 
namedTopologyToStoreName = new HashMap<>();
                     final Set<String> topologyNames = 
topologyMetadata.namedTopologiesView();
                     topologyNames.forEach(topologyName -> {
-                        final Collection<String> storesOnHostForTopologyName = 
getStoresOnHost(storeToSourceTopics, activePartitionHostMap.get(hostInfo), 
topologyName);
-                        
storesOnHostForTopologyName.addAll(getStoresOnHost(storeToSourceTopics, 
standbyPartitionHostMap.get(hostInfo), topologyName));
+                        final Map<String, List<String>> 
topologyStoresToSourceTopics =

Review comment:
       What's the difference between `topologyStoresToSourceTopics` and 
`storeToSourceTopics` here?

##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java
##########
@@ -296,9 +297,10 @@ private boolean hasPartitionsForAnyTopics(final 
List<String> topicNames, final S
     }
 
     private Set<String> getStoresOnHost(final Map<String, List<String>> 
storeToSourceTopics,
-        final Set<TopicPartition> sourceTopicPartitions, final String 
topologyName) {
+                                        final Set<TopicPartition> 
sourceTopicPartitions,
+                                        final String topologyName) {
         final InternalTopologyBuilder builder = 
topologyMetadata.lookupBuilderForNamedTopology(topologyName);
-        final Set<String> sourceTopicNames = builder.sourceTopicNames();
+        final Collection<String> sourceTopicNames = 
builder.sourceTopicCollection();

Review comment:
       Do we want the raw topic names (without the prefix) or the decorated 
ones here? 
   
   BTW The function/variable names are a bit confusing but they stored 
different things. Maybe we should just rename them to be more clear.




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