Search in sources :

Example 21 with CommandLine

use of org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine in project hbase by apache.

the class ThriftServer method processOptions.

/**
 * Parse the command line options to set parameters the conf.
 */
protected void processOptions(final String[] args) throws Exception {
    if (args == null || args.length == 0) {
        return;
    }
    Options options = new Options();
    addOptions(options);
    CommandLineParser parser = new DefaultParser();
    CommandLine cmd = parser.parse(options, args);
    if (cmd.hasOption("help")) {
        printUsageAndExit(options, 1);
    }
    parseCommandLine(cmd, options);
}
Also used : Options(org.apache.hbase.thirdparty.org.apache.commons.cli.Options) CommandLine(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine) CommandLineParser(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser) DefaultParser(org.apache.hbase.thirdparty.org.apache.commons.cli.DefaultParser)

Aggregations

CommandLine (org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine)21 Options (org.apache.hbase.thirdparty.org.apache.commons.cli.Options)14 ParseException (org.apache.hbase.thirdparty.org.apache.commons.cli.ParseException)12 CommandLineParser (org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser)9 DefaultParser (org.apache.hbase.thirdparty.org.apache.commons.cli.DefaultParser)9 Configuration (org.apache.hadoop.conf.Configuration)8 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)8 HelpFormatter (org.apache.hbase.thirdparty.org.apache.commons.cli.HelpFormatter)8 PosixParser (org.apache.hbase.thirdparty.org.apache.commons.cli.PosixParser)5 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 Path (org.apache.hadoop.fs.Path)4 GnuParser (org.apache.hbase.thirdparty.org.apache.commons.cli.GnuParser)4 List (java.util.List)2 FileSystem (org.apache.hadoop.fs.FileSystem)2 TableName (org.apache.hadoop.hbase.TableName)2 MissingOptionException (org.apache.hbase.thirdparty.org.apache.commons.cli.MissingOptionException)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Objects (java.util.Objects)1