ableegoldman commented on a change in pull request #9978: URL: https://github.com/apache/kafka/pull/9978#discussion_r565801932
########## File path: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java ########## @@ -782,8 +782,27 @@ private KafkaStreams(final InternalTopologyBuilder internalTopologyBuilder, final Time time) throws StreamsException { this.config = config; this.time = time; + + this.internalTopologyBuilder = internalTopologyBuilder; + internalTopologyBuilder.rewriteTopology(config); + + // sanity check to fail-fast in case we cannot build a ProcessorTopology due to an exception + taskTopology = internalTopologyBuilder.buildTopology(); + globalTaskTopology = internalTopologyBuilder.buildGlobalStateTopology(); + + final boolean hasGlobalTopology = globalTaskTopology != null; + final boolean hasPersistentStores = taskTopology.hasPersistentLocalStore() || + (hasGlobalTopology && globalTaskTopology.hasPersistentGlobalStore()); + + try { + stateDirectory = new StateDirectory(config, time, hasPersistentStores); + processId = stateDirectory.initializeProcessId(); Review comment: this is the only logical change in the KafkaStreams constructor: the rest of the diff is due to moving things around in order to get everything initialized in the proper order ---------------------------------------------------------------- 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