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


##########
ratis-shell/src/main/java/org/apache/ratis/shell/cli/RaftUtils.java:
##########
@@ -64,9 +64,13 @@ public static RaftPeerId getPeerId(String host, int port) {
    * @return return a raft client
    */
   public static RaftClient createClient(RaftGroup raftGroup) {
-    RaftProperties properties = new RaftProperties();
-    RaftClientConfigKeys.Rpc.setRequestTimeout(properties,
+    RaftProperties defaults = new RaftProperties();
+    RaftClientConfigKeys.Rpc.setRequestTimeout(defaults,
         TimeDuration.valueOf(15, TimeUnit.SECONDS));
+
+    // Since ratis-shell support GENERIC_COMMAND_OPTIONS, here we should
+    // merge these options to raft properties to make it work.
+    RaftProperties systems = new RaftProperties(System.getProperties());

Review Comment:
   @AngersZhuuuu , let's simply use `forEach` instead of changing 
`RaftProperties`.
   ```java
   @@ -67,6 +68,12 @@ public final class RaftUtils {
        RaftProperties properties = new RaftProperties();
        RaftClientConfigKeys.Rpc.setRequestTimeout(properties,
            TimeDuration.valueOf(15, TimeUnit.SECONDS));
   +
   +    // Since ratis-shell support GENERIC_COMMAND_OPTIONS, here we should
   +    // merge these options to raft properties to make it work.
   +    final Properties sys = System.getProperties();
   +    sys.stringPropertyNames().forEach(key -> properties.set(key, 
sys.getProperty(key)));
   +
        ExponentialBackoffRetry retryPolicy = 
ExponentialBackoffRetry.newBuilder()
   ```



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