ableegoldman commented on a change in pull request #10683: URL: https://github.com/apache/kafka/pull/10683#discussion_r669250045
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java ########## @@ -1065,14 +1086,22 @@ private void buildProcessorNode(final Map<String, ProcessorNode<?, ?, ?, ?>> pro return Collections.unmodifiableMap(globalStateStores); } - public Set<String> allStateStoreName() { + public Set<String> allStateStoreNames() { Objects.requireNonNull(applicationId, "topology has not completed optimization"); final Set<String> allNames = new HashSet<>(stateFactories.keySet()); allNames.addAll(globalStateStores.keySet()); return Collections.unmodifiableSet(allNames); } + public boolean hasStore(final String name) { + return stateFactories.containsKey(name) || globalStateStores.containsKey(name); + } + + public boolean hasPersistentStores() { Review comment: Previously we would get a handle on the actual topology and then it would have to iterate through all the stores to check each one for persistence. But while you can now add and remove individual named topologies, you still can't change a topology or the stores in it while the app is running, so we may as well just keep track of whether we found any persistent stores or not as we go along, rather than iterate over all of them later. Also, this way we can keep and access this metadata easily through the TopologyMetadata/InternalTopologyBuilder, rather than ever having to go access the ProcessorTopology directly at all That said, I'm not _too_ attached to this way of doing things, so if you have concerns I can go back to something like how it was before. Just lmk what you think -- 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