gov.llnl.ontology.mapreduce
Class MRArgOptions

java.lang.Object
  extended by edu.ucla.sspace.common.ArgOptions
      extended by gov.llnl.ontology.mapreduce.MRArgOptions

public class MRArgOptions
extends edu.ucla.sspace.common.ArgOptions

This class sets up some basic options that will be used in a wide number of map reduce jobs that connect to either a CorpusTable or a EvidenceTable.

MRArgOptions provides the following options:

Author:
Keith Stevens

Constructor Summary
MRArgOptions()
          Creates a new MRArgOptions.
 
Method Summary
 CorpusTable corpusTable()
          Returns an instance of the CorpusTable specified via the command line.
 String corpusTableType()
          Returns the type of the CorpusTable specified via the command line.
 EvidenceTable evidenceTable()
          Returns an instance of the EvidenceTable specified via the command line.
 String evidenceTableType()
          Returns the type of the EvidenceTable specified via the command line.
 void fail(String message, String extraOptionDescription, Class c)
          Reports an usage message to the user and exits with failure.
 String sourceCorpus()
          Returns the name of the source corpus specified via the command line, or the empty string if none was specified.
 void validate(String message, String extraOptionDescription, Class c, int expectedPosArgs, char... requiredList)
          Validates the parsed options.
 
Methods inherited from class edu.ucla.sspace.common.ArgOptions
addOption, addOption, addOption, getBooleanOption, getBooleanOption, getBooleanOption, getBooleanOption, getDoubleOption, getDoubleOption, getDoubleOption, getDoubleOption, getIntOption, getIntOption, getIntOption, getIntOption, getLongOption, getLongOption, getLongOption, getLongOption, getObjectOption, getObjectOption, getPositionalArg, getPositionalArgs, getStringOption, getStringOption, getStringOption, getStringOption, hasOption, hasOption, numPositionalArgs, numProvidedOptions, parseOptions, prettyPrint, removeOption, removeOption, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MRArgOptions

public MRArgOptions()
Creates a new MRArgOptions.

Method Detail

corpusTable

public CorpusTable corpusTable()
Returns an instance of the CorpusTable specified via the command line.


corpusTableType

public String corpusTableType()
Returns the type of the CorpusTable specified via the command line.


evidenceTable

public EvidenceTable evidenceTable()
Returns an instance of the EvidenceTable specified via the command line.


evidenceTableType

public String evidenceTableType()
Returns the type of the EvidenceTable specified via the command line.


sourceCorpus

public String sourceCorpus()
Returns the name of the source corpus specified via the command line, or the empty string if none was specified.


validate

public void validate(String message,
                     String extraOptionDescription,
                     Class c,
                     int expectedPosArgs,
                     char... requiredList)
Validates the parsed options. If any of the required options do not exist, an error message will be printed instructing the user with the available options and the program will immediately exit. When exiting, the format output format will be: usage: java CLASSNAME [OPTIONS] extraAgs
Options:
. . .
message

Parameters:
message - An error message to print that is specific to the calling program
extraOptionDescription - A one line summary of the extra positional options that are expcted
c - The class type of the running program
expectedPosArgs - The number of expected positional arguments
requiredList - A list of chars denoting the required options

fail

public void fail(String message,
                 String extraOptionDescription,
                 Class c)
Reports an usage message to the user and exits with failure. The usage message will be in the following format. usage: java CLASSNAME [OPTIONS] extraAgs
Options:
. . .
message

Parameters:
message - An error message to print that is specific to the calling program
extraOptionDescription - A one line summary of the extra positional options that are expcted
c - The class type of the running program


Copyright © 2010-2011. All Rights Reserved.