ml.shifu.guagua.mapreduce
类 GuaguaOptionsParser

java.lang.Object
  继承者 ml.shifu.guagua.mapreduce.GuaguaOptionsParser

public class GuaguaOptionsParser
extends Object

Copy from hadoop GenericOptionsParser and extend it.

Add other parameter support like -w, -m ...

另请参见:
Tool, ToolRunner

构造方法摘要
GuaguaOptionsParser(org.apache.hadoop.conf.Configuration conf, org.apache.commons.cli.Options options, String[] args)
          Create a GuaguaOptionsParser to parse given options as well as generic Hadoop options.
GuaguaOptionsParser(org.apache.hadoop.conf.Configuration conf, String[] args)
          Create a GuaguaOptionsParser to parse only the generic Hadoop arguments.
GuaguaOptionsParser(org.apache.commons.cli.Options opts, String[] args)
          Create an options parser with the given options to parse the args.
GuaguaOptionsParser(String[] args)
          Create an options parser to parse the args.
 
方法摘要
 org.apache.commons.cli.CommandLine getCommandLine()
          Returns the commons-cli CommandLine object to process the parsed arguments.
 org.apache.hadoop.conf.Configuration getConfiguration()
          Get the modified configuration
static URL[] getLibJars(org.apache.hadoop.conf.Configuration conf)
          If libjars are set in the conf, parse the libjars.
 String[] getRemainingArgs()
          Returns an array of Strings containing only application-specific arguments.
static void printGenericCommandUsage(PrintStream out)
          Print the usage message for generic command-line options supported.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GuaguaOptionsParser

public GuaguaOptionsParser(org.apache.commons.cli.Options opts,
                           String[] args)
                    throws IOException
Create an options parser with the given options to parse the args.

参数:
opts - the options
args - the command line arguments
抛出:
IOException

GuaguaOptionsParser

public GuaguaOptionsParser(String[] args)
                    throws IOException
Create an options parser to parse the args.

参数:
args - the command line arguments
抛出:
IOException

GuaguaOptionsParser

public GuaguaOptionsParser(org.apache.hadoop.conf.Configuration conf,
                           String[] args)
                    throws IOException
Create a GuaguaOptionsParser to parse only the generic Hadoop arguments. The array of string arguments other than the generic arguments can be obtained by getRemainingArgs().

参数:
conf - the Configuration to modify.
args - command-line arguments.
抛出:
IOException

GuaguaOptionsParser

public GuaguaOptionsParser(org.apache.hadoop.conf.Configuration conf,
                           org.apache.commons.cli.Options options,
                           String[] args)
                    throws IOException
Create a GuaguaOptionsParser to parse given options as well as generic Hadoop options. The resulting CommandLine object can be obtained by getCommandLine().

参数:
conf - the configuration to modify
options - options built by the caller
args - User-specified arguments
抛出:
IOException
方法详细信息

getRemainingArgs

public String[] getRemainingArgs()
Returns an array of Strings containing only application-specific arguments.

返回:
array of Strings containing the un-parsed arguments or empty array if commandLine was not defined.

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Get the modified configuration

返回:
the configuration that has the modified parameters.

getCommandLine

public org.apache.commons.cli.CommandLine getCommandLine()
Returns the commons-cli CommandLine object to process the parsed arguments. Note: If the object is created with GuaguaOptionsParser(Configuration, String[]), then returned object will only contain parsed generic options.

返回:
CommandLine representing list of arguments parsed against Options descriptor.

getLibJars

public static URL[] getLibJars(org.apache.hadoop.conf.Configuration conf)
                        throws IOException
If libjars are set in the conf, parse the libjars.

抛出:
IOException

printGenericCommandUsage

public static void printGenericCommandUsage(PrintStream out)
Print the usage message for generic command-line options supported.

参数:
out - stream to print the usage message to.


Copyright © 2014. All Rights Reserved.