[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:58 UTC 2009 --> |
---|
| 6 | <TITLE> |
---|
| 7 | AggregateWordCount (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="AggregateWordCount (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/AggregateWordCount.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 | PREV CLASS |
---|
| 59 | <A HREF="../../../../org/apache/hadoop/examples/AggregateWordCount.WordCountPlugInClass.html" title="class in org.apache.hadoop.examples"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 61 | <A HREF="../../../../index.html?org/apache/hadoop/examples/AggregateWordCount.html" target="_top"><B>FRAMES</B></A> |
---|
| 62 | <A HREF="AggregateWordCount.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: <A HREF="#nested_class_summary">NESTED</A> | 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.examples</FONT> |
---|
| 92 | <BR> |
---|
| 93 | Class AggregateWordCount</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.examples.AggregateWordCount</B> |
---|
| 97 | </PRE> |
---|
| 98 | <HR> |
---|
| 99 | <DL> |
---|
| 100 | <DT><PRE>public class <B>AggregateWordCount</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 | This is an example Aggregated Hadoop Map/Reduce application. It reads the |
---|
| 105 | text input files, breaks each line into words and counts them. The output is |
---|
| 106 | a locally sorted list of words and the count of how often they occurred. |
---|
| 107 | |
---|
| 108 | To run: bin/hadoop jar hadoop-*-examples.jar aggregatewordcount <i>in-dir</i> |
---|
| 109 | <i>out-dir</i> <i>numOfReducers</i> textinputformat |
---|
| 110 | <P> |
---|
| 111 | |
---|
| 112 | <P> |
---|
| 113 | <HR> |
---|
| 114 | |
---|
| 115 | <P> |
---|
| 116 | <!-- ======== NESTED CLASS SUMMARY ======== --> |
---|
| 117 | |
---|
| 118 | <A NAME="nested_class_summary"><!-- --></A> |
---|
| 119 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 120 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 121 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 122 | <B>Nested Class Summary</B></FONT></TH> |
---|
| 123 | </TR> |
---|
| 124 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 125 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 126 | <CODE>static class</CODE></FONT></TD> |
---|
| 127 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/examples/AggregateWordCount.WordCountPlugInClass.html" title="class in org.apache.hadoop.examples">AggregateWordCount.WordCountPlugInClass</A></B></CODE> |
---|
| 128 | |
---|
| 129 | <BR> |
---|
| 130 | </TD> |
---|
| 131 | </TR> |
---|
| 132 | </TABLE> |
---|
| 133 | |
---|
| 134 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
| 135 | |
---|
| 136 | <A NAME="constructor_summary"><!-- --></A> |
---|
| 137 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 138 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 139 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 140 | <B>Constructor Summary</B></FONT></TH> |
---|
| 141 | </TR> |
---|
| 142 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 143 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/examples/AggregateWordCount.html#AggregateWordCount()">AggregateWordCount</A></B>()</CODE> |
---|
| 144 | |
---|
| 145 | <BR> |
---|
| 146 | </TD> |
---|
| 147 | </TR> |
---|
| 148 | </TABLE> |
---|
| 149 | |
---|
| 150 | <!-- ========== METHOD SUMMARY =========== --> |
---|
| 151 | |
---|
| 152 | <A NAME="method_summary"><!-- --></A> |
---|
| 153 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 154 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 155 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 156 | <B>Method Summary</B></FONT></TH> |
---|
| 157 | </TR> |
---|
| 158 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 159 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 160 | <CODE>static void</CODE></FONT></TD> |
---|
| 161 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/examples/AggregateWordCount.html#main(java.lang.String[])">main</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> |
---|
| 162 | |
---|
| 163 | <BR> |
---|
| 164 | The main driver for word count map/reduce program.</TD> |
---|
| 165 | </TR> |
---|
| 166 | </TABLE> |
---|
| 167 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
| 168 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 169 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
| 170 | <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> |
---|
| 171 | </TR> |
---|
| 172 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 173 | <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> |
---|
| 174 | </TR> |
---|
| 175 | </TABLE> |
---|
| 176 | |
---|
| 177 | <P> |
---|
| 178 | |
---|
| 179 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
| 180 | |
---|
| 181 | <A NAME="constructor_detail"><!-- --></A> |
---|
| 182 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 183 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 184 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 185 | <B>Constructor Detail</B></FONT></TH> |
---|
| 186 | </TR> |
---|
| 187 | </TABLE> |
---|
| 188 | |
---|
| 189 | <A NAME="AggregateWordCount()"><!-- --></A><H3> |
---|
| 190 | AggregateWordCount</H3> |
---|
| 191 | <PRE> |
---|
| 192 | public <B>AggregateWordCount</B>()</PRE> |
---|
| 193 | <DL> |
---|
| 194 | </DL> |
---|
| 195 | |
---|
| 196 | <!-- ============ METHOD DETAIL ========== --> |
---|
| 197 | |
---|
| 198 | <A NAME="method_detail"><!-- --></A> |
---|
| 199 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 200 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 201 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 202 | <B>Method Detail</B></FONT></TH> |
---|
| 203 | </TR> |
---|
| 204 | </TABLE> |
---|
| 205 | |
---|
| 206 | <A NAME="main(java.lang.String[])"><!-- --></A><H3> |
---|
| 207 | main</H3> |
---|
| 208 | <PRE> |
---|
| 209 | public static void <B>main</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) |
---|
| 210 | 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> |
---|
| 211 | <DL> |
---|
| 212 | <DD>The main driver for word count map/reduce program. Invoke this method to |
---|
| 213 | submit the map/reduce job. |
---|
| 214 | <P> |
---|
| 215 | <DD><DL> |
---|
| 216 | |
---|
| 217 | <DT><B>Throws:</B> |
---|
| 218 | <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> - When there is communication problems with the job tracker.</DL> |
---|
| 219 | </DD> |
---|
| 220 | </DL> |
---|
| 221 | <!-- ========= END OF CLASS DATA ========= --> |
---|
| 222 | <HR> |
---|
| 223 | |
---|
| 224 | |
---|
| 225 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
| 226 | <A NAME="navbar_bottom"><!-- --></A> |
---|
| 227 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
| 228 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
| 229 | <TR> |
---|
| 230 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
| 231 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
| 232 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
| 233 | <TR ALIGN="center" VALIGN="top"> |
---|
| 234 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
| 235 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 236 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 237 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AggregateWordCount.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 238 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 239 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 240 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 241 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
| 242 | </TR> |
---|
| 243 | </TABLE> |
---|
| 244 | </TD> |
---|
| 245 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
| 246 | </EM> |
---|
| 247 | </TD> |
---|
| 248 | </TR> |
---|
| 249 | |
---|
| 250 | <TR> |
---|
| 251 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 252 | PREV CLASS |
---|
| 253 | <A HREF="../../../../org/apache/hadoop/examples/AggregateWordCount.WordCountPlugInClass.html" title="class in org.apache.hadoop.examples"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 254 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 255 | <A HREF="../../../../index.html?org/apache/hadoop/examples/AggregateWordCount.html" target="_top"><B>FRAMES</B></A> |
---|
| 256 | <A HREF="AggregateWordCount.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 257 | <SCRIPT type="text/javascript"> |
---|
| 258 | <!-- |
---|
| 259 | if(window==top) { |
---|
| 260 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
| 261 | } |
---|
| 262 | //--> |
---|
| 263 | </SCRIPT> |
---|
| 264 | <NOSCRIPT> |
---|
| 265 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
| 266 | </NOSCRIPT> |
---|
| 267 | |
---|
| 268 | |
---|
| 269 | </FONT></TD> |
---|
| 270 | </TR> |
---|
| 271 | <TR> |
---|
| 272 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 273 | SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 274 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 275 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
| 276 | </TR> |
---|
| 277 | </TABLE> |
---|
| 278 | <A NAME="skip-navbar_bottom"></A> |
---|
| 279 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
| 280 | |
---|
| 281 | <HR> |
---|
| 282 | Copyright © 2009 The Apache Software Foundation |
---|
| 283 | </BODY> |
---|
| 284 | </HTML> |
---|