SzyWilliam commented on code in PR #797:
URL: https://github.com/apache/ratis/pull/797#discussion_r1044306932
##########
ratis-examples/src/main/java/org/apache/ratis/examples/counter/server/CounterServer.java:
##########
@@ -80,35 +90,46 @@ public void close() throws IOException {
public static void main(String[] args) {
try {
- //get peerIndex from the arguments
- if (args.length != 1) {
- throw new IllegalArgumentException("Invalid argument number: expected
to be 1 but actual is " + args.length);
+ //get peerIndex & simulatedSlowness from the arguments
+ if (args.length != 1 && args.length != 2) {
+ throw new IllegalArgumentException("Invalid argument number: expected
to be 1 or 2 but actual is "
+ + args.length);
}
final int peerIndex = Integer.parseInt(args[0]);
if (peerIndex < 0 || peerIndex > 2) {
throw new IllegalArgumentException("The server index must be 0, 1 or
2: peerIndex=" + peerIndex);
}
+ TimeDuration simulatedSlowness = TimeDuration.ZERO;
+ if (args.length == 2) {
+ final int slowness = Integer.parseInt(args[1]);
Review Comment:
Done
--
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]