cmccabe commented on code in PR #16106:
URL: https://github.com/apache/kafka/pull/16106#discussion_r1628472263


##########
clients/src/main/java/org/apache/kafka/clients/admin/QuorumInfo.java:
##########
@@ -94,21 +104,24 @@ public String toString() {
 
     public static class ReplicaState {
         private final int replicaId;
+        private final Optional<Uuid> replicaDirectoryId;
         private final long logEndOffset;
         private final OptionalLong lastFetchTimestamp;
         private final OptionalLong lastCaughtUpTimestamp;
 
         ReplicaState() {
-            this(0, 0, OptionalLong.empty(), OptionalLong.empty());
+            this(0, Optional.empty(), 0, OptionalLong.empty(), 
OptionalLong.empty());
         }
 
         ReplicaState(
             int replicaId,
+            Optional<Uuid> replicaDirectoryId,

Review Comment:
   Don't make this an `Optional<>`. Just return a Uuid.
   
   It should be `Uuid.ZERO_UUID` in the case where directory IDs aren't 
supported



##########
clients/src/main/java/org/apache/kafka/clients/admin/QuorumInfo.java:
##########
@@ -122,6 +135,13 @@ public int replicaId() {
             return replicaId;
         }
 
+        /**
+         * Return the directory id of the replica if configured.
+         */
+        public Optional<Uuid> replicaDirectoryId() {
+            return replicaDirectoryId;

Review Comment:
   Don't make this an `Optional<>` or use a null. Just return a Uuid.
   
   It should be `Uuid.ZERO_UUID` in the case where directory IDs aren't 
supported



-- 
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

Reply via email to