| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0_31) on Thu Apr 05 22:07:28 PDT 2012 --> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <TITLE> |
| CrunchMultipleOutputs (crunch 0.2.0 API) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2012-04-05"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="CrunchMultipleOutputs (crunch 0.2.0 API)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CrunchMultipleOutputs.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../../index.html?org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="CrunchMultipleOutputs.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.apache.hadoop.mapreduce.lib.output</FONT> |
| <BR> |
| Class CrunchMultipleOutputs<KEYOUT,VALUEOUT></H2> |
| <PRE> |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.mapreduce.lib.output.CrunchMultipleOutputs<KEYOUT,VALUEOUT></B> |
| </PRE> |
| <HR> |
| <DL> |
| <DT><PRE>public class <B>CrunchMultipleOutputs<KEYOUT,VALUEOUT></B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> |
| </PRE> |
| |
| <P> |
| The MultipleOutputs class simplifies writing output data |
| to multiple outputs |
| |
| <p> |
| Case one: writing to additional outputs other than the job default output. |
| |
| Each additional output, or named output, may be configured with its own |
| <code>OutputFormat</code>, with its own key class and with its own value |
| class. |
| |
| <p> |
| Case two: to write data to different files provided by user |
| </p> |
| |
| <p> |
| MultipleOutputs supports counters, by default they are disabled. The |
| counters group is the <A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="class in org.apache.hadoop.mapreduce.lib.output"><CODE>CrunchMultipleOutputs</CODE></A> class name. The names of the |
| counters are the same as the output name. These count the number records |
| written to each output name. |
| </p> |
| |
| Usage pattern for job submission: |
| <pre> |
| |
| Job job = new Job(); |
| |
| FileInputFormat.setInputPath(job, inDir); |
| FileOutputFormat.setOutputPath(job, outDir); |
| |
| job.setMapperClass(MOMap.class); |
| job.setReducerClass(MOReduce.class); |
| ... |
| |
| // Defines additional single text based output 'text' for the job |
| MultipleOutputs.addNamedOutput(job, "text", TextOutputFormat.class, |
| LongWritable.class, Text.class); |
| |
| // Defines additional sequence-file based output 'sequence' for the job |
| MultipleOutputs.addNamedOutput(job, "seq", |
| SequenceFileOutputFormat.class, |
| LongWritable.class, Text.class); |
| ... |
| |
| job.waitForCompletion(true); |
| ... |
| </pre> |
| <p> |
| Usage in Reducer: |
| <pre> |
| <K, V> String generateFileName(K k, V v) { |
| return k.toString() + "_" + v.toString(); |
| } |
| |
| public class MOReduce extends |
| Reducer<WritableComparable, Writable,WritableComparable, Writable> { |
| private MultipleOutputs mos; |
| public void setup(Context context) { |
| ... |
| mos = new MultipleOutputs(context); |
| } |
| |
| public void reduce(WritableComparable key, Iterator<Writable> values, |
| Context context) |
| throws IOException { |
| ... |
| mos.write("text", , key, new Text("Hello")); |
| mos.write("seq", LongWritable(1), new Text("Bye"), "seq_a"); |
| mos.write("seq", LongWritable(2), key, new Text("Chau"), "seq_b"); |
| mos.write(key, new Text("value"), generateFileName(key, new Text("value"))); |
| ... |
| } |
| |
| public void cleanup(Context) throws IOException { |
| mos.close(); |
| ... |
| } |
| |
| } |
| </pre> |
| <P> |
| |
| <P> |
| <HR> |
| |
| <P> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Constructor Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#CrunchMultipleOutputs(org.apache.hadoop.mapreduce.TaskInputOutputContext)">CrunchMultipleOutputs</A></B>(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">KEYOUT</A>,<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">VALUEOUT</A>> context)</CODE> |
| |
| <BR> |
| Creates and initializes multiple outputs support, |
| it should be instantiated in the Mapper/Reducer setup method.</TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#addNamedOutput(org.apache.hadoop.mapreduce.Job, java.lang.String, java.lang.Class, java.lang.Class, java.lang.Class)">addNamedOutput</A></B>(org.apache.hadoop.mapreduce.Job job, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> keyClass, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> valueClass)</CODE> |
| |
| <BR> |
| Adds a named output for the job.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#close()">close</A></B>()</CODE> |
| |
| <BR> |
| Closes all the opened outputs.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#getCountersEnabled(org.apache.hadoop.mapreduce.JobContext)">getCountersEnabled</A></B>(org.apache.hadoop.mapreduce.JobContext job)</CODE> |
| |
| <BR> |
| Returns if the counters for the named outputs are enabled or not.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#setCountersEnabled(org.apache.hadoop.mapreduce.Job, boolean)">setCountersEnabled</A></B>(org.apache.hadoop.mapreduce.Job job, |
| boolean enabled)</CODE> |
| |
| <BR> |
| Enables or disables counters for the named outputs.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#write(KEYOUT, VALUEOUT, java.lang.String)">write</A></B>(<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">KEYOUT</A> key, |
| <A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">VALUEOUT</A> value, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> baseOutputPath)</CODE> |
| |
| <BR> |
| Write key value to an output file name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><K,V> void</CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#write(java.lang.String, K, V)">write</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| K key, |
| V value)</CODE> |
| |
| <BR> |
| Write key and value to the namedOutput.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><K,V> void</CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html#write(java.lang.String, K, V, java.lang.String)">write</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| K key, |
| V value, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> baseOutputPath)</CODE> |
| |
| <BR> |
| Write key and value to baseOutputPath using the namedOutput.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="http://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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://download.oracle.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> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Constructor Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="CrunchMultipleOutputs(org.apache.hadoop.mapreduce.TaskInputOutputContext)"><!-- --></A><H3> |
| CrunchMultipleOutputs</H3> |
| <PRE> |
| public <B>CrunchMultipleOutputs</B>(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">KEYOUT</A>,<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">VALUEOUT</A>> context)</PRE> |
| <DL> |
| <DD>Creates and initializes multiple outputs support, |
| it should be instantiated in the Mapper/Reducer setup method. |
| <P> |
| <DL> |
| <DT><B>Parameters:</B><DD><CODE>context</CODE> - the TaskInputOutputContext object</DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="addNamedOutput(org.apache.hadoop.mapreduce.Job, java.lang.String, java.lang.Class, java.lang.Class, java.lang.Class)"><!-- --></A><H3> |
| addNamedOutput</H3> |
| <PRE> |
| public static void <B>addNamedOutput</B>(org.apache.hadoop.mapreduce.Job job, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends org.apache.hadoop.mapreduce.OutputFormat> outputFormatClass, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> keyClass, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><?> valueClass)</PRE> |
| <DL> |
| <DD>Adds a named output for the job. |
| <p/> |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>job</CODE> - job to add the named output<DD><CODE>namedOutput</CODE> - named output name, it has to be a word, letters |
| and numbers only, cannot be the word 'part' as |
| that is reserved for the default output.<DD><CODE>outputFormatClass</CODE> - OutputFormat class.<DD><CODE>keyClass</CODE> - key class<DD><CODE>valueClass</CODE> - value class</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setCountersEnabled(org.apache.hadoop.mapreduce.Job, boolean)"><!-- --></A><H3> |
| setCountersEnabled</H3> |
| <PRE> |
| public static void <B>setCountersEnabled</B>(org.apache.hadoop.mapreduce.Job job, |
| boolean enabled)</PRE> |
| <DL> |
| <DD>Enables or disables counters for the named outputs. |
| |
| The counters group is the <A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="class in org.apache.hadoop.mapreduce.lib.output"><CODE>CrunchMultipleOutputs</CODE></A> class name. |
| The names of the counters are the same as the named outputs. These |
| counters count the number records written to each output name. |
| By default these counters are disabled. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>job</CODE> - job to enable counters<DD><CODE>enabled</CODE> - indicates if the counters will be enabled or not.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getCountersEnabled(org.apache.hadoop.mapreduce.JobContext)"><!-- --></A><H3> |
| getCountersEnabled</H3> |
| <PRE> |
| public static boolean <B>getCountersEnabled</B>(org.apache.hadoop.mapreduce.JobContext job)</PRE> |
| <DL> |
| <DD>Returns if the counters for the named outputs are enabled or not. |
| By default these counters are disabled. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>job</CODE> - the job |
| <DT><B>Returns:</B><DD>TRUE if the counters are enabled, FALSE if they are disabled.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="write(java.lang.String,java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="write(java.lang.String, K, V)"><!-- --></A><H3> |
| write</H3> |
| <PRE> |
| public <K,V> void <B>write</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| K key, |
| V value) |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> |
| <DL> |
| <DD>Write key and value to the namedOutput. |
| |
| Output path is a unique file generated for the namedOutput. |
| For example, {namedOutput}-(m|r)-{part-number} |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>namedOutput</CODE> - the named output name<DD><CODE>key</CODE> - the key<DD><CODE>value</CODE> - the value |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="write(java.lang.String,java.lang.Object,java.lang.Object,java.lang.String)"><!-- --></A><A NAME="write(java.lang.String, K, V, java.lang.String)"><!-- --></A><H3> |
| write</H3> |
| <PRE> |
| public <K,V> void <B>write</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> namedOutput, |
| K key, |
| V value, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> baseOutputPath) |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> |
| <DL> |
| <DD>Write key and value to baseOutputPath using the namedOutput. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>namedOutput</CODE> - the named output name<DD><CODE>key</CODE> - the key<DD><CODE>value</CODE> - the value<DD><CODE>baseOutputPath</CODE> - base-output path to write the record to. |
| Note: Framework will generate unique filename for the baseOutputPath |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="write(java.lang.Object,java.lang.Object,java.lang.String)"><!-- --></A><A NAME="write(KEYOUT, VALUEOUT, java.lang.String)"><!-- --></A><H3> |
| write</H3> |
| <PRE> |
| public void <B>write</B>(<A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">KEYOUT</A> key, |
| <A HREF="../../../../../../org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" title="type parameter in CrunchMultipleOutputs">VALUEOUT</A> value, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> baseOutputPath) |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> |
| <DL> |
| <DD>Write key value to an output file name. |
| |
| Gets the record writer from job's output format. |
| Job's output format should be a FileOutputFormat. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key<DD><CODE>value</CODE> - the value<DD><CODE>baseOutputPath</CODE> - base-output path to write the record to. |
| Note: Framework will generate unique filename for the baseOutputPath |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="close()"><!-- --></A><H3> |
| close</H3> |
| <PRE> |
| public void <B>close</B>() |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></PRE> |
| <DL> |
| <DD>Closes all the opened outputs. |
| |
| This should be called from cleanup method of map/reduce task. |
| If overridden subclasses must invoke <code>super.close()</code> at the |
| end of their <code>close()</code> |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE></DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CrunchMultipleOutputs.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| NEXT CLASS</FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../../index.html?org/apache/hadoop/mapreduce/lib/output/CrunchMultipleOutputs.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="CrunchMultipleOutputs.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| Copyright © 2012. All Rights Reserved. |
| </BODY> |
| </HTML> |