szetszwo commented on code in PR #945:
URL: https://github.com/apache/ratis/pull/945#discussion_r1367929509


##########
ratis-common/src/main/java/org/apache/ratis/protocol/RoutingTable.java:
##########
@@ -159,7 +164,7 @@ public String toString() {
 
   /** @return a new {@link RoutingTable} represented by the given map. */
   static RoutingTable newRoutingTable(Map<RaftPeerId, Set<RaftPeerId>> map){
-    Builder.validate(map);
+    RaftPeerId primary = Builder.validate(map);

Review Comment:
   Let's update the build() method.
   ```java
   //RoutingTable
       public RoutingTable build() {
         final Map<RaftPeerId, Set<RaftPeerId>> map = ref.getAndSet(null);
         if (map == null) {
           throw new IllegalStateException("RoutingTable Already built");
         }
         return RoutingTable.newRoutingTable(map);
       }
   ```



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