DaveTeng0 commented on code in PR #1060:
URL: https://github.com/apache/ratis/pull/1060#discussion_r1556158982


##########
ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java:
##########
@@ -69,11 +70,35 @@ public int run(CommandLine cl) throws IOException {
       printf("peers or path can't be empty.");
       return -1;
     }
+    Set<String> addresses = new HashSet<>();

Review Comment:
   makes sense! updated.



##########
ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java:
##########
@@ -69,11 +70,35 @@ public int run(CommandLine cl) throws IOException {
       printf("peers or path can't be empty.");
       return -1;
     }
+    Set<String> addresses = new HashSet<>();
     List<RaftPeerProto> raftPeerProtos = new ArrayList<>();
-    for (String address : peersStr.split(",")) {
-      String peerId = 
RaftUtils.getPeerId(parseInetSocketAddress(address)).toString();
+    for (String idWithAddress : peersStr.split(",")) {
+      String[] peerIdWithAddressArray = idWithAddress.split(SEPARATOR);
+
+      if (peerIdWithAddressArray.length < 1 || peerIdWithAddressArray.length > 
2) {
+        printf("Please make sure to provide list of peers in format 
<P0_HOST:P0_PORT,P1_HOST:P1_PORT,P2_HOST:P2_PORT>, "
+          + "or 
<P0_Id|P0_HOST:P0_PORT,P1_Id|P1_HOST:P1_PORT,P2_Id|P2_HOST:P2_PORT>");

Review Comment:
   makes sense! updated.



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