gaurav-narula commented on code in PR #24320:
URL: https://github.com/apache/kafka/pull/24320#discussion_r4682733106
##########
metadata/src/main/java/org/apache/kafka/image/TopicImage.java:
##########
@@ -27,29 +28,108 @@
import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Optional;
/**
* Represents a topic in the metadata image.
*
* This class is thread-safe.
*/
-public record TopicImage(String name, Uuid id, Map<Integer,
PartitionRegistration> partitions) {
- public TopicImage {
- partitions = Collections.unmodifiableMap(partitions);
+public final class TopicImage {
Review Comment:
I thought about this again and feel a sealed interface, `Mirror` and two
concrete types `ActiveMirror`, `NoMirror` models it better and is more explicit
than `Optional` for representing the `NoMirror` case. Please have a look
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]