org.apache.hadoop.hive.common.cli
Class CommonCliOptions

java.lang.Object
  extended by org.apache.hadoop.hive.common.cli.CommonCliOptions
Direct Known Subclasses:
HiveMetaStore.HiveMetastoreCli, HiveServer.HiveServerCli

public class CommonCliOptions
extends Object

Reusable code for Hive Cli's.

Basic usage is: create an instance (usually a subclass if you want to all your own options or processing instructions), parse, and then use the resulting information.

See HiveServer or HiveMetaStore for examples of use.


Field Summary
protected  String cliname
          The name of this cli.
protected  org.apache.commons.cli.CommandLine commandLine
           
protected  org.apache.commons.cli.Options OPTIONS
          Options for parsing the command line.
 
Constructor Summary
CommonCliOptions(String cliname, boolean includeHiveConf)
          Create an instance with common options (help, verbose, etc...).
 
Method Summary
 Properties addHiveconfToSystemProperties()
          Add the hiveconf properties to the Java system properties, override anything therein.
 boolean isVerbose()
          Should the client be verbose.
 void parse(String[] args)
          Parse the arguments.
 void printUsage()
          Print usage information for the CLI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIONS

protected final org.apache.commons.cli.Options OPTIONS
Options for parsing the command line.


commandLine

protected org.apache.commons.cli.CommandLine commandLine

cliname

protected final String cliname
The name of this cli.

Constructor Detail

CommonCliOptions

public CommonCliOptions(String cliname,
                        boolean includeHiveConf)
Create an instance with common options (help, verbose, etc...).

Parameters:
cliname - the name of the command
includeHiveConf - include "hiveconf" as an option if true
Method Detail

addHiveconfToSystemProperties

public Properties addHiveconfToSystemProperties()
Add the hiveconf properties to the Java system properties, override anything therein.

Returns:
a copy of the properties specified in hiveconf

printUsage

public void printUsage()
Print usage information for the CLI.


parse

public void parse(String[] args)
Parse the arguments.

Parameters:
args -

isVerbose

public boolean isVerbose()
Should the client be verbose.



Copyright © 2013 The Apache Software Foundation