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/05/13 18:40:35 UTC

[GitHub] [kafka] ableegoldman commented on a change in pull request #10609: KAFKA-12648: Pt. 1 - Add NamedTopology to protocol and state directory structure

ableegoldman commented on a change in pull request #10609:
URL: https://github.com/apache/kafka/pull/10609#discussion_r632022730



##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/TaskId.java
##########
@@ -59,8 +58,8 @@ public TaskId(final int topicGroupId, final int partition, final String namedTop
         }
     }
 
-    public Optional<String> namedTopology() {
-        return namedTopology == null ? Optional.empty() : Optional.of(namedTopology);
+    public String namedTopology() {

Review comment:
       I have considered a bit whether to do that, and just make the "normal" (unnamed) case like a specific case of the named topology where the name is just the app id or empty string or something, but I think that ultimately only complicates things even more, so I decided against it. For example we'd need to check whether the named topology was equal to `app.id`/`""` before placing task dirs into named subdirectories, inserting the name into internal topics, etc. It's easier to just check whether it exists, that way it's pretty obvious if you miss something, vs a subtle bug that eg changed the internal topic names by one extra `-` 
   
   But once we circle back on making this a public API I think we can clean things up a lot, at which time it may make more sense to consolidate things in that way




-- 
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:
users@infra.apache.org