PepperJo commented on a change in pull request #85:
URL: https://github.com/apache/incubator-crail/pull/85#discussion_r578652011



##########
File path: client/src/main/java/org/apache/crail/tools/RemoveDataNode.java
##########
@@ -0,0 +1,81 @@
+package org.apache.crail.tools;
+
+import org.apache.commons.cli.*;
+import org.apache.crail.conf.CrailConfiguration;
+import org.apache.crail.conf.CrailConstants;
+import org.apache.crail.rpc.*;
+import org.apache.crail.utils.CrailUtils;
+import org.slf4j.Logger;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.Future;
+
+public class RemoveDataNode {
+
+    public static void main(String[] args) throws Exception {
+
+        InetAddress ipaddr = null;
+        int port = -1;
+
+        Option ipOption = Option.builder("i").desc("Ip 
address").hasArg().required().build();
+        Option portOption = 
Option.builder("p").desc("port").hasArg().required().build();
+
+        Options options = new Options();
+        options.addOption(ipOption);
+        options.addOption(portOption);
+
+        HelpFormatter formatter = new HelpFormatter();
+        CommandLineParser parser = new DefaultParser();
+        CommandLine line = parser.parse(options, args);
+
+        try {
+            ipaddr = 
InetAddress.getByName(line.getOptionValue(ipOption.getOpt()));
+            port = Integer.parseInt(line.getOptionValue(portOption.getOpt()));
+        } catch(Exception e) {
+            formatter.printHelp("RemoveDataNode", options);

Review comment:
       We should exit here, e.g. with System.exit(-1); or by rethrowing the 
exception




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to