chia7712 commented on code in PR #22512:
URL: https://github.com/apache/kafka/pull/22512#discussion_r3527975031


##########
clients/src/main/java/org/apache/kafka/common/Node.java:
##########
@@ -31,30 +31,47 @@ public class Node {
     private final int port;
     private final String rack;
     private final boolean isFenced;
+    private final boolean isCoordinator;
 
     // Cache hashCode as it is called in performance sensitive parts of the 
code (e.g. RecordAccumulator.ready)
     private Integer hash;
 
     public Node(int id, String host, int port) {
-        this(id, host, port, null, false);
+        this(id, host, port, null, false, false);
     }
 
     public Node(int id, String host, int port, String rack) {
-        this.id = id;
-        this.idString = Integer.toString(id);
-        this.host = host;
-        this.port = port;
-        this.rack = rack;
-        this.isFenced = false;
+        this(id, host, port, rack, false, false);
     }
 
     public Node(int id, String host, int port, String rack, boolean isFenced) {
+        this(id, host, port, rack, isFenced, false);
+    }
+
+    public Node(int id, String host, int port, String rack, boolean isFenced, 
boolean isCoordinator) {

Review Comment:
   I actually like the "+" workaround. it's a very clever trick! :laughing: 
   
   Since Node is a public API, the current contract of `idString` must be 
maintained for backward compatibility. However, have we considered deprecating 
`idString` in favor of a new method that clearly reflects this new routing 
behavior? For example: `connectionId()`?



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

Reply via email to