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:56 UTC 2009 --> |
---|
6 | <TITLE> |
---|
7 | FileOutputFormat (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="FileOutputFormat (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/FileOutputFormat.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/mapred/FileOutputCommitter.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A> |
---|
59 | <A HREF="../../../../org/apache/hadoop/mapred/FileSplit.html" title="class in org.apache.hadoop.mapred"><B>NEXT CLASS</B></A></FONT></TD> |
---|
60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
61 | <A HREF="../../../../index.html?org/apache/hadoop/mapred/FileOutputFormat.html" target="_top"><B>FRAMES</B></A> |
---|
62 | <A HREF="FileOutputFormat.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.mapred</FONT> |
---|
92 | <BR> |
---|
93 | Class FileOutputFormat<K,V></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.mapred.FileOutputFormat<K,V></B> |
---|
97 | </PRE> |
---|
98 | <DL> |
---|
99 | <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html" title="interface in org.apache.hadoop.mapred">OutputFormat</A><K,V></DD> |
---|
100 | </DL> |
---|
101 | <DL> |
---|
102 | <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/hadoop/contrib/index/mapred/IndexUpdateOutputFormat.html" title="class in org.apache.hadoop.contrib.index.mapred">IndexUpdateOutputFormat</A>, <A HREF="../../../../org/apache/hadoop/mapred/MapFileOutputFormat.html" title="class in org.apache.hadoop.mapred">MapFileOutputFormat</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/MultipleOutputFormat.html" title="class in org.apache.hadoop.mapred.lib">MultipleOutputFormat</A>, <A HREF="../../../../org/apache/hadoop/mapred/SequenceFileOutputFormat.html" title="class in org.apache.hadoop.mapred">SequenceFileOutputFormat</A>, <A HREF="../../../../org/apache/hadoop/mapred/TextOutputFormat.html" title="class in org.apache.hadoop.mapred">TextOutputFormat</A></DD> |
---|
103 | </DL> |
---|
104 | <HR> |
---|
105 | <DL> |
---|
106 | <DT><PRE>public abstract class <B>FileOutputFormat<K,V></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><DT>implements <A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html" title="interface in org.apache.hadoop.mapred">OutputFormat</A><K,V></DL> |
---|
107 | </PRE> |
---|
108 | |
---|
109 | <P> |
---|
110 | A base class for <A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html" title="interface in org.apache.hadoop.mapred"><CODE>OutputFormat</CODE></A>. |
---|
111 | <P> |
---|
112 | |
---|
113 | <P> |
---|
114 | <HR> |
---|
115 | |
---|
116 | <P> |
---|
117 | |
---|
118 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
119 | |
---|
120 | <A NAME="constructor_summary"><!-- --></A> |
---|
121 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
122 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
123 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
124 | <B>Constructor Summary</B></FONT></TH> |
---|
125 | </TR> |
---|
126 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
127 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#FileOutputFormat()">FileOutputFormat</A></B>()</CODE> |
---|
128 | |
---|
129 | <BR> |
---|
130 | </TD> |
---|
131 | </TR> |
---|
132 | </TABLE> |
---|
133 | |
---|
134 | <!-- ========== METHOD SUMMARY =========== --> |
---|
135 | |
---|
136 | <A NAME="method_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>Method Summary</B></FONT></TH> |
---|
141 | </TR> |
---|
142 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
143 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
144 | <CODE> void</CODE></FONT></TD> |
---|
145 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#checkOutputSpecs(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf)">checkOutputSpecs</A></B>(<A HREF="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</A> ignored, |
---|
146 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> job)</CODE> |
---|
147 | |
---|
148 | <BR> |
---|
149 | Check for validity of the output-specification for the job.</TD> |
---|
150 | </TR> |
---|
151 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
152 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
153 | <CODE>static boolean</CODE></FONT></TD> |
---|
154 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getCompressOutput(org.apache.hadoop.mapred.JobConf)">getCompressOutput</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</CODE> |
---|
155 | |
---|
156 | <BR> |
---|
157 | Is the job output compressed?</TD> |
---|
158 | </TR> |
---|
159 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
160 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
161 | <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>></CODE></FONT></TD> |
---|
162 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getOutputCompressorClass(org.apache.hadoop.mapred.JobConf, java.lang.Class)">getOutputCompressorClass</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
163 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>> defaultValue)</CODE> |
---|
164 | |
---|
165 | <BR> |
---|
166 | Get the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> for compressing the job outputs.</TD> |
---|
167 | </TR> |
---|
168 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
169 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
170 | <CODE>static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A></CODE></FONT></TD> |
---|
171 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getOutputPath(org.apache.hadoop.mapred.JobConf)">getOutputPath</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</CODE> |
---|
172 | |
---|
173 | <BR> |
---|
174 | Get the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the output directory for the map-reduce job.</TD> |
---|
175 | </TR> |
---|
176 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
177 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
178 | <CODE>static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A></CODE></FONT></TD> |
---|
179 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getPathForCustomFile(org.apache.hadoop.mapred.JobConf, java.lang.String)">getPathForCustomFile</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
180 | <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> name)</CODE> |
---|
181 | |
---|
182 | <BR> |
---|
183 | Helper function to generate a <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> for a file that is unique for |
---|
184 | the task within the job output directory.</TD> |
---|
185 | </TR> |
---|
186 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
187 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
188 | <CODE>abstract <A HREF="../../../../org/apache/hadoop/mapred/RecordWriter.html" title="interface in org.apache.hadoop.mapred">RecordWriter</A><<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</A>,<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</A>></CODE></FONT></TD> |
---|
189 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getRecordWriter(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf, java.lang.String, org.apache.hadoop.util.Progressable)">getRecordWriter</A></B>(<A HREF="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</A> ignored, |
---|
190 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> job, |
---|
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> name, |
---|
192 | <A HREF="../../../../org/apache/hadoop/util/Progressable.html" title="interface in org.apache.hadoop.util">Progressable</A> progress)</CODE> |
---|
193 | |
---|
194 | <BR> |
---|
195 | Get the <A HREF="../../../../org/apache/hadoop/mapred/RecordWriter.html" title="interface in org.apache.hadoop.mapred"><CODE>RecordWriter</CODE></A> for the given job.</TD> |
---|
196 | </TR> |
---|
197 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
198 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
199 | <CODE>static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A></CODE></FONT></TD> |
---|
200 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getTaskOutputPath(org.apache.hadoop.mapred.JobConf, java.lang.String)">getTaskOutputPath</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
201 | <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> name)</CODE> |
---|
202 | |
---|
203 | <BR> |
---|
204 | Helper function to create the task's temporary output directory and |
---|
205 | return the path to the task's output file.</TD> |
---|
206 | </TR> |
---|
207 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
208 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
209 | <CODE>static <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> |
---|
210 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getUniqueName(org.apache.hadoop.mapred.JobConf, java.lang.String)">getUniqueName</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
211 | <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> name)</CODE> |
---|
212 | |
---|
213 | <BR> |
---|
214 | Helper function to generate a name that is unique for the task.</TD> |
---|
215 | </TR> |
---|
216 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
217 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
218 | <CODE>static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A></CODE></FONT></TD> |
---|
219 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getWorkOutputPath(org.apache.hadoop.mapred.JobConf)">getWorkOutputPath</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</CODE> |
---|
220 | |
---|
221 | <BR> |
---|
222 | Get the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the task's temporary output directory |
---|
223 | for the map-reduce job |
---|
224 | |
---|
225 | <h4 id="SideEffectFiles">Tasks' Side-Effect Files</TD> |
---|
226 | </TR> |
---|
227 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
228 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
229 | <CODE>static void</CODE></FONT></TD> |
---|
230 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#setCompressOutput(org.apache.hadoop.mapred.JobConf, boolean)">setCompressOutput</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
231 | boolean compress)</CODE> |
---|
232 | |
---|
233 | <BR> |
---|
234 | Set whether the output of the job is compressed.</TD> |
---|
235 | </TR> |
---|
236 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
237 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
238 | <CODE>static void</CODE></FONT></TD> |
---|
239 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#setOutputCompressorClass(org.apache.hadoop.mapred.JobConf, java.lang.Class)">setOutputCompressorClass</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
240 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>> codecClass)</CODE> |
---|
241 | |
---|
242 | <BR> |
---|
243 | Set the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> to be used to compress job outputs.</TD> |
---|
244 | </TR> |
---|
245 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
246 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
247 | <CODE>static void</CODE></FONT></TD> |
---|
248 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#setOutputPath(org.apache.hadoop.mapred.JobConf, org.apache.hadoop.fs.Path)">setOutputPath</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
249 | <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> outputDir)</CODE> |
---|
250 | |
---|
251 | <BR> |
---|
252 | Set the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> of the output directory for the map-reduce job.</TD> |
---|
253 | </TR> |
---|
254 | </TABLE> |
---|
255 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
256 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
257 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
258 | <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> |
---|
259 | </TR> |
---|
260 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
261 | <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> |
---|
262 | </TR> |
---|
263 | </TABLE> |
---|
264 | |
---|
265 | <P> |
---|
266 | |
---|
267 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
268 | |
---|
269 | <A NAME="constructor_detail"><!-- --></A> |
---|
270 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
271 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
272 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
273 | <B>Constructor Detail</B></FONT></TH> |
---|
274 | </TR> |
---|
275 | </TABLE> |
---|
276 | |
---|
277 | <A NAME="FileOutputFormat()"><!-- --></A><H3> |
---|
278 | FileOutputFormat</H3> |
---|
279 | <PRE> |
---|
280 | public <B>FileOutputFormat</B>()</PRE> |
---|
281 | <DL> |
---|
282 | </DL> |
---|
283 | |
---|
284 | <!-- ============ METHOD DETAIL ========== --> |
---|
285 | |
---|
286 | <A NAME="method_detail"><!-- --></A> |
---|
287 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
288 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
289 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
290 | <B>Method Detail</B></FONT></TH> |
---|
291 | </TR> |
---|
292 | </TABLE> |
---|
293 | |
---|
294 | <A NAME="setCompressOutput(org.apache.hadoop.mapred.JobConf, boolean)"><!-- --></A><H3> |
---|
295 | setCompressOutput</H3> |
---|
296 | <PRE> |
---|
297 | public static void <B>setCompressOutput</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
298 | boolean compress)</PRE> |
---|
299 | <DL> |
---|
300 | <DD>Set whether the output of the job is compressed. |
---|
301 | <P> |
---|
302 | <DD><DL> |
---|
303 | </DL> |
---|
304 | </DD> |
---|
305 | <DD><DL> |
---|
306 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A> to modify<DD><CODE>compress</CODE> - should the output of the job be compressed?</DL> |
---|
307 | </DD> |
---|
308 | </DL> |
---|
309 | <HR> |
---|
310 | |
---|
311 | <A NAME="getCompressOutput(org.apache.hadoop.mapred.JobConf)"><!-- --></A><H3> |
---|
312 | getCompressOutput</H3> |
---|
313 | <PRE> |
---|
314 | public static boolean <B>getCompressOutput</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</PRE> |
---|
315 | <DL> |
---|
316 | <DD>Is the job output compressed? |
---|
317 | <P> |
---|
318 | <DD><DL> |
---|
319 | </DL> |
---|
320 | </DD> |
---|
321 | <DD><DL> |
---|
322 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A> to look in |
---|
323 | <DT><B>Returns:</B><DD><code>true</code> if the job output should be compressed, |
---|
324 | <code>false</code> otherwise</DL> |
---|
325 | </DD> |
---|
326 | </DL> |
---|
327 | <HR> |
---|
328 | |
---|
329 | <A NAME="setOutputCompressorClass(org.apache.hadoop.mapred.JobConf, java.lang.Class)"><!-- --></A><H3> |
---|
330 | setOutputCompressorClass</H3> |
---|
331 | <PRE> |
---|
332 | public static void <B>setOutputCompressorClass</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
333 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>> codecClass)</PRE> |
---|
334 | <DL> |
---|
335 | <DD>Set the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> to be used to compress job outputs. |
---|
336 | <P> |
---|
337 | <DD><DL> |
---|
338 | </DL> |
---|
339 | </DD> |
---|
340 | <DD><DL> |
---|
341 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A> to modify<DD><CODE>codecClass</CODE> - the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> to be used to |
---|
342 | compress the job outputs</DL> |
---|
343 | </DD> |
---|
344 | </DL> |
---|
345 | <HR> |
---|
346 | |
---|
347 | <A NAME="getOutputCompressorClass(org.apache.hadoop.mapred.JobConf, java.lang.Class)"><!-- --></A><H3> |
---|
348 | getOutputCompressorClass</H3> |
---|
349 | <PRE> |
---|
350 | public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>> <B>getOutputCompressorClass</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
351 | <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress">CompressionCodec</A>> defaultValue)</PRE> |
---|
352 | <DL> |
---|
353 | <DD>Get the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> for compressing the job outputs. |
---|
354 | <P> |
---|
355 | <DD><DL> |
---|
356 | </DL> |
---|
357 | </DD> |
---|
358 | <DD><DL> |
---|
359 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A> to look in<DD><CODE>defaultValue</CODE> - the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> to return if not set |
---|
360 | <DT><B>Returns:</B><DD>the <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A> to be used to compress the |
---|
361 | job outputs |
---|
362 | <DT><B>Throws:</B> |
---|
363 | <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the class was specified, but not found</DL> |
---|
364 | </DD> |
---|
365 | </DL> |
---|
366 | <HR> |
---|
367 | |
---|
368 | <A NAME="getRecordWriter(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf, java.lang.String, org.apache.hadoop.util.Progressable)"><!-- --></A><H3> |
---|
369 | getRecordWriter</H3> |
---|
370 | <PRE> |
---|
371 | public abstract <A HREF="../../../../org/apache/hadoop/mapred/RecordWriter.html" title="interface in org.apache.hadoop.mapred">RecordWriter</A><<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</A>,<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</A>> <B>getRecordWriter</B>(<A HREF="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</A> ignored, |
---|
372 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> job, |
---|
373 | <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> name, |
---|
374 | <A HREF="../../../../org/apache/hadoop/util/Progressable.html" title="interface in org.apache.hadoop.util">Progressable</A> progress) |
---|
375 | 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> |
---|
376 | <DL> |
---|
377 | <DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html#getRecordWriter(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf, java.lang.String, org.apache.hadoop.util.Progressable)">OutputFormat</A></CODE></B></DD> |
---|
378 | <DD>Get the <A HREF="../../../../org/apache/hadoop/mapred/RecordWriter.html" title="interface in org.apache.hadoop.mapred"><CODE>RecordWriter</CODE></A> for the given job. |
---|
379 | <P> |
---|
380 | <DD><DL> |
---|
381 | <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html#getRecordWriter(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf, java.lang.String, org.apache.hadoop.util.Progressable)">getRecordWriter</A></CODE> in interface <CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html" title="interface in org.apache.hadoop.mapred">OutputFormat</A><<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</A>,<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</A>></CODE></DL> |
---|
382 | </DD> |
---|
383 | <DD><DL> |
---|
384 | <DD><CODE>job</CODE> - configuration for the job whose output is being written.<DD><CODE>name</CODE> - the unique name for this part of the output.<DD><CODE>progress</CODE> - mechanism for reporting progress while writing to file. |
---|
385 | <DT><B>Returns:</B><DD>a <A HREF="../../../../org/apache/hadoop/mapred/RecordWriter.html" title="interface in org.apache.hadoop.mapred"><CODE>RecordWriter</CODE></A> to write the output for the job. |
---|
386 | <DT><B>Throws:</B> |
---|
387 | <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> |
---|
388 | </DD> |
---|
389 | </DL> |
---|
390 | <HR> |
---|
391 | |
---|
392 | <A NAME="checkOutputSpecs(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf)"><!-- --></A><H3> |
---|
393 | checkOutputSpecs</H3> |
---|
394 | <PRE> |
---|
395 | public void <B>checkOutputSpecs</B>(<A HREF="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</A> ignored, |
---|
396 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> job) |
---|
397 | throws <A HREF="../../../../org/apache/hadoop/mapred/FileAlreadyExistsException.html" title="class in org.apache.hadoop.mapred">FileAlreadyExistsException</A>, |
---|
398 | <A HREF="../../../../org/apache/hadoop/mapred/InvalidJobConfException.html" title="class in org.apache.hadoop.mapred">InvalidJobConfException</A>, |
---|
399 | <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> |
---|
400 | <DL> |
---|
401 | <DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html#checkOutputSpecs(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf)">OutputFormat</A></CODE></B></DD> |
---|
402 | <DD>Check for validity of the output-specification for the job. |
---|
403 | |
---|
404 | <p>This is to validate the output specification for the job when it is |
---|
405 | a job is submitted. Typically checks that it does not already exist, |
---|
406 | throwing an exception when it already exists, so that output is not |
---|
407 | overwritten.</p> |
---|
408 | <P> |
---|
409 | <DD><DL> |
---|
410 | <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html#checkOutputSpecs(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.mapred.JobConf)">checkOutputSpecs</A></CODE> in interface <CODE><A HREF="../../../../org/apache/hadoop/mapred/OutputFormat.html" title="interface in org.apache.hadoop.mapred">OutputFormat</A><<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">K</A>,<A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html" title="type parameter in FileOutputFormat">V</A>></CODE></DL> |
---|
411 | </DD> |
---|
412 | <DD><DL> |
---|
413 | <DD><CODE>job</CODE> - job configuration. |
---|
414 | <DT><B>Throws:</B> |
---|
415 | <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 output should not be attempted |
---|
416 | <DD><CODE><A HREF="../../../../org/apache/hadoop/mapred/FileAlreadyExistsException.html" title="class in org.apache.hadoop.mapred">FileAlreadyExistsException</A></CODE> |
---|
417 | <DD><CODE><A HREF="../../../../org/apache/hadoop/mapred/InvalidJobConfException.html" title="class in org.apache.hadoop.mapred">InvalidJobConfException</A></CODE></DL> |
---|
418 | </DD> |
---|
419 | </DL> |
---|
420 | <HR> |
---|
421 | |
---|
422 | <A NAME="setOutputPath(org.apache.hadoop.mapred.JobConf, org.apache.hadoop.fs.Path)"><!-- --></A><H3> |
---|
423 | setOutputPath</H3> |
---|
424 | <PRE> |
---|
425 | public static void <B>setOutputPath</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
426 | <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> outputDir)</PRE> |
---|
427 | <DL> |
---|
428 | <DD>Set the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> of the output directory for the map-reduce job. |
---|
429 | <P> |
---|
430 | <DD><DL> |
---|
431 | </DL> |
---|
432 | </DD> |
---|
433 | <DD><DL> |
---|
434 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - The configuration of the job.<DD><CODE>outputDir</CODE> - the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> of the output directory for |
---|
435 | the map-reduce job.</DL> |
---|
436 | </DD> |
---|
437 | </DL> |
---|
438 | <HR> |
---|
439 | |
---|
440 | <A NAME="getOutputPath(org.apache.hadoop.mapred.JobConf)"><!-- --></A><H3> |
---|
441 | getOutputPath</H3> |
---|
442 | <PRE> |
---|
443 | public static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> <B>getOutputPath</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</PRE> |
---|
444 | <DL> |
---|
445 | <DD>Get the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the output directory for the map-reduce job. |
---|
446 | <P> |
---|
447 | <DD><DL> |
---|
448 | </DL> |
---|
449 | </DD> |
---|
450 | <DD><DL> |
---|
451 | |
---|
452 | <DT><B>Returns:</B><DD>the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the output directory for the map-reduce job.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getWorkOutputPath(org.apache.hadoop.mapred.JobConf)"><CODE>getWorkOutputPath(JobConf)</CODE></A></DL> |
---|
453 | </DD> |
---|
454 | </DL> |
---|
455 | <HR> |
---|
456 | |
---|
457 | <A NAME="getWorkOutputPath(org.apache.hadoop.mapred.JobConf)"><!-- --></A><H3> |
---|
458 | getWorkOutputPath</H3> |
---|
459 | <PRE> |
---|
460 | public static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> <B>getWorkOutputPath</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf)</PRE> |
---|
461 | <DL> |
---|
462 | <DD>Get the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the task's temporary output directory |
---|
463 | for the map-reduce job |
---|
464 | |
---|
465 | <h4 id="SideEffectFiles">Tasks' Side-Effect Files</h4> |
---|
466 | |
---|
467 | <p><i>Note:</i> The following is valid only if the <A HREF="../../../../org/apache/hadoop/mapred/OutputCommitter.html" title="class in org.apache.hadoop.mapred"><CODE>OutputCommitter</CODE></A> |
---|
468 | is <A HREF="../../../../org/apache/hadoop/mapred/FileOutputCommitter.html" title="class in org.apache.hadoop.mapred"><CODE>FileOutputCommitter</CODE></A>. If <code>OutputCommitter</code> is not |
---|
469 | a <code>FileOutputCommitter</code>, the task's temporary output |
---|
470 | directory is same as <A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getOutputPath(org.apache.hadoop.mapred.JobConf)"><CODE>getOutputPath(JobConf)</CODE></A> i.e. |
---|
471 | <tt>${mapred.output.dir}$</tt></p> |
---|
472 | |
---|
473 | <p>Some applications need to create/write-to side-files, which differ from |
---|
474 | the actual job-outputs. |
---|
475 | |
---|
476 | <p>In such cases there could be issues with 2 instances of the same TIP |
---|
477 | (running simultaneously e.g. speculative tasks) trying to open/write-to the |
---|
478 | same file (path) on HDFS. Hence the application-writer will have to pick |
---|
479 | unique names per task-attempt (e.g. using the attemptid, say |
---|
480 | <tt>attempt_200709221812_0001_m_000000_0</tt>), not just per TIP.</p> |
---|
481 | |
---|
482 | <p>To get around this the Map-Reduce framework helps the application-writer |
---|
483 | out by maintaining a special |
---|
484 | <tt>${mapred.output.dir}/_temporary/_${taskid}</tt> |
---|
485 | sub-directory for each task-attempt on HDFS where the output of the |
---|
486 | task-attempt goes. On successful completion of the task-attempt the files |
---|
487 | in the <tt>${mapred.output.dir}/_temporary/_${taskid}</tt> (only) |
---|
488 | are <i>promoted</i> to <tt>${mapred.output.dir}</tt>. Of course, the |
---|
489 | framework discards the sub-directory of unsuccessful task-attempts. This |
---|
490 | is completely transparent to the application.</p> |
---|
491 | |
---|
492 | <p>The application-writer can take advantage of this by creating any |
---|
493 | side-files required in <tt>${mapred.work.output.dir}</tt> during execution |
---|
494 | of his reduce-task i.e. via <A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getWorkOutputPath(org.apache.hadoop.mapred.JobConf)"><CODE>getWorkOutputPath(JobConf)</CODE></A>, and the |
---|
495 | framework will move them out similarly - thus she doesn't have to pick |
---|
496 | unique paths per task-attempt.</p> |
---|
497 | |
---|
498 | <p><i>Note</i>: the value of <tt>${mapred.work.output.dir}</tt> during |
---|
499 | execution of a particular task-attempt is actually |
---|
500 | <tt>${mapred.output.dir}/_temporary/_{$taskid}</tt>, and this value is |
---|
501 | set by the map-reduce framework. So, just create any side-files in the |
---|
502 | path returned by <A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getWorkOutputPath(org.apache.hadoop.mapred.JobConf)"><CODE>getWorkOutputPath(JobConf)</CODE></A> from map/reduce |
---|
503 | task to take advantage of this feature.</p> |
---|
504 | |
---|
505 | <p>The entire discussion holds true for maps of jobs with |
---|
506 | reducer=NONE (i.e. 0 reduces) since output of the map, in that case, |
---|
507 | goes directly to HDFS.</p> |
---|
508 | <P> |
---|
509 | <DD><DL> |
---|
510 | </DL> |
---|
511 | </DD> |
---|
512 | <DD><DL> |
---|
513 | |
---|
514 | <DT><B>Returns:</B><DD>the <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> to the task's temporary output directory |
---|
515 | for the map-reduce job.</DL> |
---|
516 | </DD> |
---|
517 | </DL> |
---|
518 | <HR> |
---|
519 | |
---|
520 | <A NAME="getTaskOutputPath(org.apache.hadoop.mapred.JobConf, java.lang.String)"><!-- --></A><H3> |
---|
521 | getTaskOutputPath</H3> |
---|
522 | <PRE> |
---|
523 | public static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> <B>getTaskOutputPath</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
524 | <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> name) |
---|
525 | 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> |
---|
526 | <DL> |
---|
527 | <DD>Helper function to create the task's temporary output directory and |
---|
528 | return the path to the task's output file. |
---|
529 | <P> |
---|
530 | <DD><DL> |
---|
531 | </DL> |
---|
532 | </DD> |
---|
533 | <DD><DL> |
---|
534 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - job-configuration<DD><CODE>name</CODE> - temporary task-output filename |
---|
535 | <DT><B>Returns:</B><DD>path to the task's temporary output file |
---|
536 | <DT><B>Throws:</B> |
---|
537 | <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> |
---|
538 | </DD> |
---|
539 | </DL> |
---|
540 | <HR> |
---|
541 | |
---|
542 | <A NAME="getUniqueName(org.apache.hadoop.mapred.JobConf, java.lang.String)"><!-- --></A><H3> |
---|
543 | getUniqueName</H3> |
---|
544 | <PRE> |
---|
545 | public static <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>getUniqueName</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
546 | <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> name)</PRE> |
---|
547 | <DL> |
---|
548 | <DD>Helper function to generate a name that is unique for the task. |
---|
549 | |
---|
550 | <p>The generated name can be used to create custom files from within the |
---|
551 | different tasks for the job, the names for different tasks will not collide |
---|
552 | with each other.</p> |
---|
553 | |
---|
554 | <p>The given name is postfixed with the task type, 'm' for maps, 'r' for |
---|
555 | reduces and the task partition number. For example, give a name 'test' |
---|
556 | running on the first map o the job the generated name will be |
---|
557 | 'test-m-00000'.</p> |
---|
558 | <P> |
---|
559 | <DD><DL> |
---|
560 | </DL> |
---|
561 | </DD> |
---|
562 | <DD><DL> |
---|
563 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration for the job.<DD><CODE>name</CODE> - the name to make unique. |
---|
564 | <DT><B>Returns:</B><DD>a unique name accross all tasks of the job.</DL> |
---|
565 | </DD> |
---|
566 | </DL> |
---|
567 | <HR> |
---|
568 | |
---|
569 | <A NAME="getPathForCustomFile(org.apache.hadoop.mapred.JobConf, java.lang.String)"><!-- --></A><H3> |
---|
570 | getPathForCustomFile</H3> |
---|
571 | <PRE> |
---|
572 | public static <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</A> <B>getPathForCustomFile</B>(<A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred">JobConf</A> conf, |
---|
573 | <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> name)</PRE> |
---|
574 | <DL> |
---|
575 | <DD>Helper function to generate a <A HREF="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs"><CODE>Path</CODE></A> for a file that is unique for |
---|
576 | the task within the job output directory. |
---|
577 | |
---|
578 | <p>The path can be used to create custom files from within the map and |
---|
579 | reduce tasks. The path name will be unique for each task. The path parent |
---|
580 | will be the job output directory.</p>ls |
---|
581 | |
---|
582 | <p>This method uses the <A HREF="../../../../org/apache/hadoop/mapred/FileOutputFormat.html#getUniqueName(org.apache.hadoop.mapred.JobConf, java.lang.String)"><CODE>getUniqueName(org.apache.hadoop.mapred.JobConf, java.lang.String)</CODE></A> method to make the file name |
---|
583 | unique for the task.</p> |
---|
584 | <P> |
---|
585 | <DD><DL> |
---|
586 | </DL> |
---|
587 | </DD> |
---|
588 | <DD><DL> |
---|
589 | <DT><B>Parameters:</B><DD><CODE>conf</CODE> - the configuration for the job.<DD><CODE>name</CODE> - the name for the file. |
---|
590 | <DT><B>Returns:</B><DD>a unique path accross all tasks of the job.</DL> |
---|
591 | </DD> |
---|
592 | </DL> |
---|
593 | <!-- ========= END OF CLASS DATA ========= --> |
---|
594 | <HR> |
---|
595 | |
---|
596 | |
---|
597 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
598 | <A NAME="navbar_bottom"><!-- --></A> |
---|
599 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
600 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
601 | <TR> |
---|
602 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
603 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
604 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
605 | <TR ALIGN="center" VALIGN="top"> |
---|
606 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
607 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
608 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
609 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/FileOutputFormat.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
610 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
611 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
612 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
613 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
614 | </TR> |
---|
615 | </TABLE> |
---|
616 | </TD> |
---|
617 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
618 | </EM> |
---|
619 | </TD> |
---|
620 | </TR> |
---|
621 | |
---|
622 | <TR> |
---|
623 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
624 | <A HREF="../../../../org/apache/hadoop/mapred/FileOutputCommitter.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A> |
---|
625 | <A HREF="../../../../org/apache/hadoop/mapred/FileSplit.html" title="class in org.apache.hadoop.mapred"><B>NEXT CLASS</B></A></FONT></TD> |
---|
626 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
627 | <A HREF="../../../../index.html?org/apache/hadoop/mapred/FileOutputFormat.html" target="_top"><B>FRAMES</B></A> |
---|
628 | <A HREF="FileOutputFormat.html" target="_top"><B>NO FRAMES</B></A> |
---|
629 | <SCRIPT type="text/javascript"> |
---|
630 | <!-- |
---|
631 | if(window==top) { |
---|
632 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
633 | } |
---|
634 | //--> |
---|
635 | </SCRIPT> |
---|
636 | <NOSCRIPT> |
---|
637 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
638 | </NOSCRIPT> |
---|
639 | |
---|
640 | |
---|
641 | </FONT></TD> |
---|
642 | </TR> |
---|
643 | <TR> |
---|
644 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
645 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
646 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
647 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
648 | </TR> |
---|
649 | </TABLE> |
---|
650 | <A NAME="skip-navbar_bottom"></A> |
---|
651 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
652 | |
---|
653 | <HR> |
---|
654 | Copyright © 2009 The Apache Software Foundation |
---|
655 | </BODY> |
---|
656 | </HTML> |
---|