You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/12/17 23:12:08 UTC

[GitHub] [kafka] guozhangwang commented on a change in pull request #11609: KAFKA-12648: fixes for query APIs and blocking calls

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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org