[120] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
| 2 | <!--NewPage--> |
---|
| 3 | <HTML> |
---|
| 4 | <HEAD> |
---|
| 5 | <!-- Generated by javadoc (build 1.6.0_07) on Tue Sep 01 20:56:55 UTC 2009 --> |
---|
| 6 | <TITLE> |
---|
| 7 | GenericOptionsParser (Hadoop 0.20.1 API) |
---|
| 8 | </TITLE> |
---|
| 9 | |
---|
| 10 | <META NAME="date" CONTENT="2009-09-01"> |
---|
| 11 | |
---|
| 12 | <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
---|
| 13 | |
---|
| 14 | <SCRIPT type="text/javascript"> |
---|
| 15 | function windowTitle() |
---|
| 16 | { |
---|
| 17 | if (location.href.indexOf('is-external=true') == -1) { |
---|
| 18 | parent.document.title="GenericOptionsParser (Hadoop 0.20.1 API)"; |
---|
| 19 | } |
---|
| 20 | } |
---|
| 21 | </SCRIPT> |
---|
| 22 | <NOSCRIPT> |
---|
| 23 | </NOSCRIPT> |
---|
| 24 | |
---|
| 25 | </HEAD> |
---|
| 26 | |
---|
| 27 | <BODY BGCOLOR="white" onload="windowTitle();"> |
---|
| 28 | <HR> |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | <!-- ========= START OF TOP NAVBAR ======= --> |
---|
| 32 | <A NAME="navbar_top"><!-- --></A> |
---|
| 33 | <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
---|
| 34 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
| 35 | <TR> |
---|
| 36 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
| 37 | <A NAME="navbar_top_firstrow"><!-- --></A> |
---|
| 38 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
| 39 | <TR ALIGN="center" VALIGN="top"> |
---|
| 40 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
| 41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 42 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericOptionsParser.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 47 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
| 48 | </TR> |
---|
| 49 | </TABLE> |
---|
| 50 | </TD> |
---|
| 51 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
| 52 | </EM> |
---|
| 53 | </TD> |
---|
| 54 | </TR> |
---|
| 55 | |
---|
| 56 | <TR> |
---|
| 57 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 58 | <A HREF="../../../../org/apache/hadoop/util/DiskChecker.DiskOutOfSpaceException.html" title="class in org.apache.hadoop.util"><B>PREV CLASS</B></A> |
---|
| 59 | <A HREF="../../../../org/apache/hadoop/util/GenericsUtil.html" title="class in org.apache.hadoop.util"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 61 | <A HREF="../../../../index.html?org/apache/hadoop/util/GenericOptionsParser.html" target="_top"><B>FRAMES</B></A> |
---|
| 62 | <A HREF="GenericOptionsParser.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 63 | <SCRIPT type="text/javascript"> |
---|
| 64 | <!-- |
---|
| 65 | if(window==top) { |
---|
| 66 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
| 67 | } |
---|
| 68 | //--> |
---|
| 69 | </SCRIPT> |
---|
| 70 | <NOSCRIPT> |
---|
| 71 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
| 72 | </NOSCRIPT> |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | </FONT></TD> |
---|
| 76 | </TR> |
---|
| 77 | <TR> |
---|
| 78 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 79 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 81 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
| 82 | </TR> |
---|
| 83 | </TABLE> |
---|
| 84 | <A NAME="skip-navbar_top"></A> |
---|
| 85 | <!-- ========= END OF TOP NAVBAR ========= --> |
---|
| 86 | |
---|
| 87 | <HR> |
---|
| 88 | <!-- ======== START OF CLASS DATA ======== --> |
---|
| 89 | <H2> |
---|
| 90 | <FONT SIZE="-1"> |
---|
| 91 | org.apache.hadoop.util</FONT> |
---|
| 92 | <BR> |
---|
| 93 | Class GenericOptionsParser</H2> |
---|
| 94 | <PRE> |
---|
| 95 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
---|
| 96 | <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.util.GenericOptionsParser</B> |
---|
| 97 | </PRE> |
---|
| 98 | <HR> |
---|
| 99 | <DL> |
---|
| 100 | <DT><PRE>public class <B>GenericOptionsParser</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> |
---|
| 101 | </PRE> |
---|
| 102 | |
---|
| 103 | <P> |
---|
| 104 | <code>GenericOptionsParser</code> is a utility to parse command line |
---|
| 105 | arguments generic to the Hadoop framework. |
---|
| 106 | |
---|
| 107 | <code>GenericOptionsParser</code> recognizes several standarad command |
---|
| 108 | line arguments, enabling applications to easily specify a namenode, a |
---|
| 109 | jobtracker, additional configuration resources etc. |
---|
| 110 | |
---|
| 111 | <h4 id="GenericOptions">Generic Options</h4> |
---|
| 112 | |
---|
| 113 | <p>The supported generic options are:</p> |
---|
| 114 | <p><blockquote><pre> |
---|
| 115 | -conf <configuration file> specify a configuration file |
---|
| 116 | -D <property=value> use value for given property |
---|
| 117 | -fs <local|namenode:port> specify a namenode |
---|
| 118 | -jt <local|jobtracker:port> specify a job tracker |
---|
| 119 | -files <comma separated list of files> specify comma separated |
---|
| 120 | files to be copied to the map reduce cluster |
---|
| 121 | -libjars <comma separated list of jars> specify comma separated |
---|
| 122 | jar files to include in the classpath. |
---|
| 123 | -archives <comma separated list of archives> specify comma |
---|
| 124 | separated archives to be unarchived on the compute machines. |
---|
| 125 | |
---|
| 126 | </pre></blockquote></p> |
---|
| 127 | |
---|
| 128 | <p>The general command line syntax is:</p> |
---|
| 129 | <p><tt><pre> |
---|
| 130 | bin/hadoop command [genericOptions] [commandOptions] |
---|
| 131 | </pre></tt></p> |
---|
| 132 | |
---|
| 133 | <p>Generic command line arguments <strong>might</strong> modify |
---|
| 134 | <code>Configuration </code> objects, given to constructors.</p> |
---|
| 135 | |
---|
| 136 | <p>The functionality is implemented using Commons CLI.</p> |
---|
| 137 | |
---|
| 138 | <p>Examples:</p> |
---|
| 139 | <p><blockquote><pre> |
---|
| 140 | $ bin/hadoop dfs -fs darwin:8020 -ls /data |
---|
| 141 | list /data directory in dfs with namenode darwin:8020 |
---|
| 142 | |
---|
| 143 | $ bin/hadoop dfs -D fs.default.name=darwin:8020 -ls /data |
---|
| 144 | list /data directory in dfs with namenode darwin:8020 |
---|
| 145 | |
---|
| 146 | $ bin/hadoop dfs -conf hadoop-site.xml -ls /data |
---|
| 147 | list /data directory in dfs with conf specified in hadoop-site.xml |
---|
| 148 | |
---|
| 149 | $ bin/hadoop job -D mapred.job.tracker=darwin:50020 -submit job.xml |
---|
| 150 | submit a job to job tracker darwin:50020 |
---|
| 151 | |
---|
| 152 | $ bin/hadoop job -jt darwin:50020 -submit job.xml |
---|
| 153 | submit a job to job tracker darwin:50020 |
---|
| 154 | |
---|
| 155 | $ bin/hadoop job -jt local -submit job.xml |
---|
| 156 | submit a job to local runner |
---|
| 157 | |
---|
| 158 | $ bin/hadoop jar -libjars testlib.jar |
---|
| 159 | -archives test.tgz -files file.txt inputjar args |
---|
| 160 | job submission with libjars, files and archives |
---|
| 161 | </pre></blockquote></p> |
---|
| 162 | <P> |
---|
| 163 | |
---|
| 164 | <P> |
---|
| 165 | <DL> |
---|
| 166 | <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/util/Tool.html" title="interface in org.apache.hadoop.util"><CODE>Tool</CODE></A>, |
---|
| 167 | <A HREF="../../../../org/apache/hadoop/util/ToolRunner.html" title="class in org.apache.hadoop.util"><CODE>ToolRunner</CODE></A></DL> |
---|
| 168 | <HR> |
---|
| 169 | |
---|
| 170 | <P> |
---|
| 171 | |
---|
| 172 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
| 173 | |
---|
| 174 | <A NAME="constructor_summary"><!-- --></A> |
---|
| 175 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 176 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 177 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 178 | <B>Constructor Summary</B></FONT></TH> |
---|
| 179 | </TR> |
---|
| 180 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 181 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#GenericOptionsParser(org.apache.hadoop.conf.Configuration, org.apache.commons.cli.Options, java.lang.String[])">GenericOptionsParser</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf, |
---|
| 182 | org.apache.commons.cli.Options options, |
---|
| 183 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</CODE> |
---|
| 184 | |
---|
| 185 | <BR> |
---|
| 186 | Create a <code>GenericOptionsParser</code> to parse given options as well |
---|
| 187 | as generic Hadoop options.</TD> |
---|
| 188 | </TR> |
---|
| 189 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 190 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#GenericOptionsParser(org.apache.hadoop.conf.Configuration, java.lang.String[])">GenericOptionsParser</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf, |
---|
| 191 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</CODE> |
---|
| 192 | |
---|
| 193 | <BR> |
---|
| 194 | Create a <code>GenericOptionsParser<code> to parse only the generic Hadoop |
---|
| 195 | arguments.</TD> |
---|
| 196 | </TR> |
---|
| 197 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 198 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#GenericOptionsParser(org.apache.commons.cli.Options, java.lang.String[])">GenericOptionsParser</A></B>(org.apache.commons.cli.Options opts, |
---|
| 199 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</CODE> |
---|
| 200 | |
---|
| 201 | <BR> |
---|
| 202 | Create an options parser with the given options to parse the args.</TD> |
---|
| 203 | </TR> |
---|
| 204 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 205 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#GenericOptionsParser(java.lang.String[])">GenericOptionsParser</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</CODE> |
---|
| 206 | |
---|
| 207 | <BR> |
---|
| 208 | Create an options parser to parse the args.</TD> |
---|
| 209 | </TR> |
---|
| 210 | </TABLE> |
---|
| 211 | |
---|
| 212 | <!-- ========== METHOD SUMMARY =========== --> |
---|
| 213 | |
---|
| 214 | <A NAME="method_summary"><!-- --></A> |
---|
| 215 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 216 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 217 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 218 | <B>Method Summary</B></FONT></TH> |
---|
| 219 | </TR> |
---|
| 220 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 221 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 222 | <CODE> org.apache.commons.cli.CommandLine</CODE></FONT></TD> |
---|
| 223 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getCommandLine()">getCommandLine</A></B>()</CODE> |
---|
| 224 | |
---|
| 225 | <BR> |
---|
| 226 | Returns the commons-cli <code>CommandLine</code> object |
---|
| 227 | to process the parsed arguments.</TD> |
---|
| 228 | </TR> |
---|
| 229 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 230 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 231 | <CODE> <A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A></CODE></FONT></TD> |
---|
| 232 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getConfiguration()">getConfiguration</A></B>()</CODE> |
---|
| 233 | |
---|
| 234 | <BR> |
---|
| 235 | Get the modified configuration</TD> |
---|
| 236 | </TR> |
---|
| 237 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 238 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 239 | <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</A>[]</CODE></FONT></TD> |
---|
| 240 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getLibJars(org.apache.hadoop.conf.Configuration)">getLibJars</A></B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf)</CODE> |
---|
| 241 | |
---|
| 242 | <BR> |
---|
| 243 | If libjars are set in the conf, parse the libjars.</TD> |
---|
| 244 | </TR> |
---|
| 245 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 246 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 247 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD> |
---|
| 248 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getRemainingArgs()">getRemainingArgs</A></B>()</CODE> |
---|
| 249 | |
---|
| 250 | <BR> |
---|
| 251 | Returns an array of Strings containing only application-specific arguments.</TD> |
---|
| 252 | </TR> |
---|
| 253 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 254 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 255 | <CODE>static void</CODE></FONT></TD> |
---|
| 256 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#printGenericCommandUsage(java.io.PrintStream)">printGenericCommandUsage</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream</A> out)</CODE> |
---|
| 257 | |
---|
| 258 | <BR> |
---|
| 259 | Print the usage message for generic command-line options supported.</TD> |
---|
| 260 | </TR> |
---|
| 261 | </TABLE> |
---|
| 262 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
| 263 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 264 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
| 265 | <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
---|
| 266 | </TR> |
---|
| 267 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 268 | <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> |
---|
| 269 | </TR> |
---|
| 270 | </TABLE> |
---|
| 271 | |
---|
| 272 | <P> |
---|
| 273 | |
---|
| 274 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
| 275 | |
---|
| 276 | <A NAME="constructor_detail"><!-- --></A> |
---|
| 277 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 278 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 279 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 280 | <B>Constructor Detail</B></FONT></TH> |
---|
| 281 | </TR> |
---|
| 282 | </TABLE> |
---|
| 283 | |
---|
| 284 | <A NAME="GenericOptionsParser(org.apache.commons.cli.Options, java.lang.String[])"><!-- --></A><H3> |
---|
| 285 | GenericOptionsParser</H3> |
---|
| 286 | <PRE> |
---|
| 287 | public <B>GenericOptionsParser</B>(org.apache.commons.cli.Options opts, |
---|
| 288 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</PRE> |
---|
| 289 | <DL> |
---|
| 290 | <DD>Create an options parser with the given options to parse the args. |
---|
| 291 | <P> |
---|
| 292 | <DL> |
---|
| 293 | <DT><B>Parameters:</B><DD><CODE>opts</CODE> - the options<DD><CODE>args</CODE> - the command line arguments</DL> |
---|
| 294 | </DL> |
---|
| 295 | <HR> |
---|
| 296 | |
---|
| 297 | <A NAME="GenericOptionsParser(java.lang.String[])"><!-- --></A><H3> |
---|
| 298 | GenericOptionsParser</H3> |
---|
| 299 | <PRE> |
---|
| 300 | public <B>GenericOptionsParser</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</PRE> |
---|
| 301 | <DL> |
---|
| 302 | <DD>Create an options parser to parse the args. |
---|
| 303 | <P> |
---|
| 304 | <DL> |
---|
| 305 | <DT><B>Parameters:</B><DD><CODE>args</CODE> - the command line arguments</DL> |
---|
| 306 | </DL> |
---|
| 307 | <HR> |
---|
| 308 | |
---|
| 309 | <A NAME="GenericOptionsParser(org.apache.hadoop.conf.Configuration, java.lang.String[])"><!-- --></A><H3> |
---|
| 310 | GenericOptionsParser</H3> |
---|
| 311 | <PRE> |
---|
| 312 | public <B>GenericOptionsParser</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf, |
---|
| 313 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</PRE> |
---|
| 314 | <DL> |
---|
| 315 | <DD>Create a <code>GenericOptionsParser<code> to parse only the generic Hadoop |
---|
| 316 | arguments. |
---|
| 317 | |
---|
| 318 | The array of string arguments other than the generic arguments can be |
---|
| 319 | obtained by <A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getRemainingArgs()"><CODE>getRemainingArgs()</CODE></A>. |
---|
| 320 | <P> |
---|
| 321 | <DL> |
---|
| 322 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the <code>Configuration</code> to modify.<DD><CODE>args</CODE> - command-line arguments.</DL> |
---|
| 323 | </DL> |
---|
| 324 | <HR> |
---|
| 325 | |
---|
| 326 | <A NAME="GenericOptionsParser(org.apache.hadoop.conf.Configuration, org.apache.commons.cli.Options, java.lang.String[])"><!-- --></A><H3> |
---|
| 327 | GenericOptionsParser</H3> |
---|
| 328 | <PRE> |
---|
| 329 | public <B>GenericOptionsParser</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf, |
---|
| 330 | org.apache.commons.cli.Options options, |
---|
| 331 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] args)</PRE> |
---|
| 332 | <DL> |
---|
| 333 | <DD>Create a <code>GenericOptionsParser</code> to parse given options as well |
---|
| 334 | as generic Hadoop options. |
---|
| 335 | |
---|
| 336 | The resulting <code>CommandLine</code> object can be obtained by |
---|
| 337 | <A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#getCommandLine()"><CODE>getCommandLine()</CODE></A>. |
---|
| 338 | <P> |
---|
| 339 | <DL> |
---|
| 340 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration to modify<DD><CODE>options</CODE> - options built by the caller<DD><CODE>args</CODE> - User-specified arguments</DL> |
---|
| 341 | </DL> |
---|
| 342 | |
---|
| 343 | <!-- ============ METHOD DETAIL ========== --> |
---|
| 344 | |
---|
| 345 | <A NAME="method_detail"><!-- --></A> |
---|
| 346 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 347 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 348 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 349 | <B>Method Detail</B></FONT></TH> |
---|
| 350 | </TR> |
---|
| 351 | </TABLE> |
---|
| 352 | |
---|
| 353 | <A NAME="getRemainingArgs()"><!-- --></A><H3> |
---|
| 354 | getRemainingArgs</H3> |
---|
| 355 | <PRE> |
---|
| 356 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[] <B>getRemainingArgs</B>()</PRE> |
---|
| 357 | <DL> |
---|
| 358 | <DD>Returns an array of Strings containing only application-specific arguments. |
---|
| 359 | <P> |
---|
| 360 | <DD><DL> |
---|
| 361 | |
---|
| 362 | <DT><B>Returns:</B><DD>array of <code>String</code>s containing the un-parsed arguments |
---|
| 363 | or <strong>empty array</strong> if commandLine was not defined.</DL> |
---|
| 364 | </DD> |
---|
| 365 | </DL> |
---|
| 366 | <HR> |
---|
| 367 | |
---|
| 368 | <A NAME="getConfiguration()"><!-- --></A><H3> |
---|
| 369 | getConfiguration</H3> |
---|
| 370 | <PRE> |
---|
| 371 | public <A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> <B>getConfiguration</B>()</PRE> |
---|
| 372 | <DL> |
---|
| 373 | <DD>Get the modified configuration |
---|
| 374 | <P> |
---|
| 375 | <DD><DL> |
---|
| 376 | |
---|
| 377 | <DT><B>Returns:</B><DD>the configuration that has the modified parameters.</DL> |
---|
| 378 | </DD> |
---|
| 379 | </DL> |
---|
| 380 | <HR> |
---|
| 381 | |
---|
| 382 | <A NAME="getCommandLine()"><!-- --></A><H3> |
---|
| 383 | getCommandLine</H3> |
---|
| 384 | <PRE> |
---|
| 385 | public org.apache.commons.cli.CommandLine <B>getCommandLine</B>()</PRE> |
---|
| 386 | <DL> |
---|
| 387 | <DD>Returns the commons-cli <code>CommandLine</code> object |
---|
| 388 | to process the parsed arguments. |
---|
| 389 | |
---|
| 390 | Note: If the object is created with |
---|
| 391 | <A HREF="../../../../org/apache/hadoop/util/GenericOptionsParser.html#GenericOptionsParser(org.apache.hadoop.conf.Configuration, java.lang.String[])"><CODE>GenericOptionsParser(Configuration, String[])</CODE></A>, then returned |
---|
| 392 | object will only contain parsed generic options. |
---|
| 393 | <P> |
---|
| 394 | <DD><DL> |
---|
| 395 | |
---|
| 396 | <DT><B>Returns:</B><DD><code>CommandLine</code> representing list of arguments |
---|
| 397 | parsed against Options descriptor.</DL> |
---|
| 398 | </DD> |
---|
| 399 | </DL> |
---|
| 400 | <HR> |
---|
| 401 | |
---|
| 402 | <A NAME="getLibJars(org.apache.hadoop.conf.Configuration)"><!-- --></A><H3> |
---|
| 403 | getLibJars</H3> |
---|
| 404 | <PRE> |
---|
| 405 | public static <A HREF="http://java.sun.com/javase/6/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</A>[] <B>getLibJars</B>(<A HREF="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A> conf) |
---|
| 406 | throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> |
---|
| 407 | <DL> |
---|
| 408 | <DD>If libjars are set in the conf, parse the libjars. |
---|
| 409 | <P> |
---|
| 410 | <DD><DL> |
---|
| 411 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - |
---|
| 412 | <DT><B>Returns:</B><DD>libjar urls |
---|
| 413 | <DT><B>Throws:</B> |
---|
| 414 | <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL> |
---|
| 415 | </DD> |
---|
| 416 | </DL> |
---|
| 417 | <HR> |
---|
| 418 | |
---|
| 419 | <A NAME="printGenericCommandUsage(java.io.PrintStream)"><!-- --></A><H3> |
---|
| 420 | printGenericCommandUsage</H3> |
---|
| 421 | <PRE> |
---|
| 422 | public static void <B>printGenericCommandUsage</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream</A> out)</PRE> |
---|
| 423 | <DL> |
---|
| 424 | <DD>Print the usage message for generic command-line options supported. |
---|
| 425 | <P> |
---|
| 426 | <DD><DL> |
---|
| 427 | <DT><B>Parameters:</B><DD><CODE>out</CODE> - stream to print the usage message to.</DL> |
---|
| 428 | </DD> |
---|
| 429 | </DL> |
---|
| 430 | <!-- ========= END OF CLASS DATA ========= --> |
---|
| 431 | <HR> |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
| 435 | <A NAME="navbar_bottom"><!-- --></A> |
---|
| 436 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
| 437 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
| 438 | <TR> |
---|
| 439 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
| 440 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
| 441 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
| 442 | <TR ALIGN="center" VALIGN="top"> |
---|
| 443 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
| 444 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 445 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 446 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericOptionsParser.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 447 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 448 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 449 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 450 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
| 451 | </TR> |
---|
| 452 | </TABLE> |
---|
| 453 | </TD> |
---|
| 454 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
| 455 | </EM> |
---|
| 456 | </TD> |
---|
| 457 | </TR> |
---|
| 458 | |
---|
| 459 | <TR> |
---|
| 460 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 461 | <A HREF="../../../../org/apache/hadoop/util/DiskChecker.DiskOutOfSpaceException.html" title="class in org.apache.hadoop.util"><B>PREV CLASS</B></A> |
---|
| 462 | <A HREF="../../../../org/apache/hadoop/util/GenericsUtil.html" title="class in org.apache.hadoop.util"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 463 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 464 | <A HREF="../../../../index.html?org/apache/hadoop/util/GenericOptionsParser.html" target="_top"><B>FRAMES</B></A> |
---|
| 465 | <A HREF="GenericOptionsParser.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 466 | <SCRIPT type="text/javascript"> |
---|
| 467 | <!-- |
---|
| 468 | if(window==top) { |
---|
| 469 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
| 470 | } |
---|
| 471 | //--> |
---|
| 472 | </SCRIPT> |
---|
| 473 | <NOSCRIPT> |
---|
| 474 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
| 475 | </NOSCRIPT> |
---|
| 476 | |
---|
| 477 | |
---|
| 478 | </FONT></TD> |
---|
| 479 | </TR> |
---|
| 480 | <TR> |
---|
| 481 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 482 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 483 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 484 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
| 485 | </TR> |
---|
| 486 | </TABLE> |
---|
| 487 | <A NAME="skip-navbar_bottom"></A> |
---|
| 488 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
| 489 | |
---|
| 490 | <HR> |
---|
| 491 | Copyright © 2009 The Apache Software Foundation |
---|
| 492 | </BODY> |
---|
| 493 | </HTML> |
---|