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 | Mapper (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="Mapper (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/Mapper.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/MapFileOutputFormat.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A> |
---|
59 | <A HREF="../../../../org/apache/hadoop/mapred/MapReduceBase.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/Mapper.html" target="_top"><B>FRAMES</B></A> |
---|
62 | <A HREF="Mapper.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 | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
81 | DETAIL: FIELD | CONSTR | <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 | Interface Mapper<K1,V1,K2,V2></H2> |
---|
94 | <DL> |
---|
95 | <DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A>, <A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html" title="interface in org.apache.hadoop.mapred">JobConfigurable</A></DD> |
---|
96 | </DL> |
---|
97 | <DL> |
---|
98 | <DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/apache/hadoop/contrib/index/mapred/ILocalAnalysis.html" title="interface in org.apache.hadoop.contrib.index.mapred">ILocalAnalysis</A><K,V></DD> |
---|
99 | </DL> |
---|
100 | <DL> |
---|
101 | <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/hadoop/mapred/lib/ChainMapper.html" title="class in org.apache.hadoop.mapred.lib">ChainMapper</A>, <A HREF="../../../../org/apache/hadoop/contrib/utils/join/DataJoinMapperBase.html" title="class in org.apache.hadoop.contrib.utils.join">DataJoinMapperBase</A>, <A HREF="../../../../org/apache/hadoop/contrib/utils/join/DataJoinReducerBase.html" title="class in org.apache.hadoop.contrib.utils.join">DataJoinReducerBase</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/DelegatingMapper.html" title="class in org.apache.hadoop.mapred.lib">DelegatingMapper</A>, <A HREF="../../../../org/apache/hadoop/examples/dancing/DistributedPentomino.PentMap.html" title="class in org.apache.hadoop.examples.dancing">DistributedPentomino.PentMap</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/FieldSelectionMapReduce.html" title="class in org.apache.hadoop.mapred.lib">FieldSelectionMapReduce</A>, <A HREF="../../../../org/apache/hadoop/contrib/index/example/IdentityLocalAnalysis.html" title="class in org.apache.hadoop.contrib.index.example">IdentityLocalAnalysis</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/IdentityMapper.html" title="class in org.apache.hadoop.mapred.lib">IdentityMapper</A>, <A HREF="../../../../org/apache/hadoop/contrib/index/mapred/IndexUpdateMapper.html" title="class in org.apache.hadoop.contrib.index.mapred">IndexUpdateMapper</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/InverseMapper.html" title="class in org.apache.hadoop.mapred.lib">InverseMapper</A>, <A HREF="../../../../org/apache/hadoop/contrib/utils/join/JobBase.html" title="class in org.apache.hadoop.contrib.utils.join">JobBase</A>, <A HREF="../../../../org/apache/hadoop/contrib/index/example/LineDocLocalAnalysis.html" title="class in org.apache.hadoop.contrib.index.example">LineDocLocalAnalysis</A>, <A HREF="../../../../org/apache/hadoop/examples/MultiFileWordCount.MapClass.html" title="class in org.apache.hadoop.examples">MultiFileWordCount.MapClass</A>, <A HREF="../../../../org/apache/hadoop/examples/PiEstimator.PiMapper.html" title="class in org.apache.hadoop.examples">PiEstimator.PiMapper</A>, <A HREF="../../../../org/apache/hadoop/streaming/PipeMapper.html" title="class in org.apache.hadoop.streaming">PipeMapper</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/RegexMapper.html" title="class in org.apache.hadoop.mapred.lib">RegexMapper</A>, <A HREF="../../../../org/apache/hadoop/examples/SleepJob.html" title="class in org.apache.hadoop.examples">SleepJob</A>, <A HREF="../../../../org/apache/hadoop/examples/terasort/TeraGen.SortGenMapper.html" title="class in org.apache.hadoop.examples.terasort">TeraGen.SortGenMapper</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/TokenCountMapper.html" title="class in org.apache.hadoop.mapred.lib">TokenCountMapper</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorCombiner.html" title="class in org.apache.hadoop.mapred.lib.aggregate">ValueAggregatorCombiner</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorJobBase.html" title="class in org.apache.hadoop.mapred.lib.aggregate">ValueAggregatorJobBase</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorMapper.html" title="class in org.apache.hadoop.mapred.lib.aggregate">ValueAggregatorMapper</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorReducer.html" title="class in org.apache.hadoop.mapred.lib.aggregate">ValueAggregatorReducer</A></DD> |
---|
102 | </DL> |
---|
103 | <HR> |
---|
104 | <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/hadoop/mapreduce/Mapper.html" title="class in org.apache.hadoop.mapreduce"><CODE>Mapper</CODE></A> instead.</I> |
---|
105 | <P> |
---|
106 | <DL> |
---|
107 | <DT><PRE><FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A> |
---|
108 | </FONT>public interface <B>Mapper<K1,V1,K2,V2></B><DT>extends <A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html" title="interface in org.apache.hadoop.mapred">JobConfigurable</A>, <A HREF="../../../../org/apache/hadoop/io/Closeable.html" title="interface in org.apache.hadoop.io">Closeable</A></DL> |
---|
109 | </PRE> |
---|
110 | |
---|
111 | <P> |
---|
112 | Maps input key/value pairs to a set of intermediate key/value pairs. |
---|
113 | |
---|
114 | <p>Maps are the individual tasks which transform input records into a |
---|
115 | intermediate records. The transformed intermediate records need not be of |
---|
116 | the same type as the input records. A given input pair may map to zero or |
---|
117 | many output pairs.</p> |
---|
118 | |
---|
119 | <p>The Hadoop Map-Reduce framework spawns one map task for each |
---|
120 | <A HREF="../../../../org/apache/hadoop/mapred/InputSplit.html" title="interface in org.apache.hadoop.mapred"><CODE>InputSplit</CODE></A> generated by the <A HREF="../../../../org/apache/hadoop/mapred/InputFormat.html" title="interface in org.apache.hadoop.mapred"><CODE>InputFormat</CODE></A> for the job. |
---|
121 | <code>Mapper</code> implementations can access the <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A> for the |
---|
122 | job via the <A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html#configure(org.apache.hadoop.mapred.JobConf)"><CODE>JobConfigurable.configure(JobConf)</CODE></A> and initialize |
---|
123 | themselves. Similarly they can use the <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io"><CODE>Closeable.close()</CODE></A> method for |
---|
124 | de-initialization.</p> |
---|
125 | |
---|
126 | <p>The framework then calls |
---|
127 | <A HREF="../../../../org/apache/hadoop/mapred/Mapper.html#map(K1, V1, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)"><CODE>map(Object, Object, OutputCollector, Reporter)</CODE></A> |
---|
128 | for each key/value pair in the <code>InputSplit</code> for that task.</p> |
---|
129 | |
---|
130 | <p>All intermediate values associated with a given output key are |
---|
131 | subsequently grouped by the framework, and passed to a <A HREF="../../../../org/apache/hadoop/mapred/Reducer.html" title="interface in org.apache.hadoop.mapred"><CODE>Reducer</CODE></A> to |
---|
132 | determine the final output. Users can control the grouping by specifying |
---|
133 | a <code>Comparator</code> via |
---|
134 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html#setOutputKeyComparatorClass(java.lang.Class)"><CODE>JobConf.setOutputKeyComparatorClass(Class)</CODE></A>.</p> |
---|
135 | |
---|
136 | <p>The grouped <code>Mapper</code> outputs are partitioned per |
---|
137 | <code>Reducer</code>. Users can control which keys (and hence records) go to |
---|
138 | which <code>Reducer</code> by implementing a custom <A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="interface in org.apache.hadoop.mapred"><CODE>Partitioner</CODE></A>. |
---|
139 | |
---|
140 | <p>Users can optionally specify a <code>combiner</code>, via |
---|
141 | <A HREF="../../../../org/apache/hadoop/mapred/JobConf.html#setCombinerClass(java.lang.Class)"><CODE>JobConf.setCombinerClass(Class)</CODE></A>, to perform local aggregation of the |
---|
142 | intermediate outputs, which helps to cut down the amount of data transferred |
---|
143 | from the <code>Mapper</code> to the <code>Reducer</code>. |
---|
144 | |
---|
145 | <p>The intermediate, grouped outputs are always stored in |
---|
146 | <A HREF="../../../../org/apache/hadoop/io/SequenceFile.html" title="class in org.apache.hadoop.io"><CODE>SequenceFile</CODE></A>s. Applications can specify if and how the intermediate |
---|
147 | outputs are to be compressed and which <A HREF="../../../../org/apache/hadoop/io/compress/CompressionCodec.html" title="interface in org.apache.hadoop.io.compress"><CODE>CompressionCodec</CODE></A>s are to be |
---|
148 | used via the <code>JobConf</code>.</p> |
---|
149 | |
---|
150 | <p>If the job has |
---|
151 | <a href="../../../../org/apache/hadoop/mapred/JobConf.html#ReducerNone">zero |
---|
152 | reduces</a> then the output of the <code>Mapper</code> is directly written |
---|
153 | to the <A HREF="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs"><CODE>FileSystem</CODE></A> without grouping by keys.</p> |
---|
154 | |
---|
155 | <p>Example:</p> |
---|
156 | <p><blockquote><pre> |
---|
157 | public class MyMapper<K extends WritableComparable, V extends Writable> |
---|
158 | extends MapReduceBase implements Mapper<K, V, K, V> { |
---|
159 | |
---|
160 | static enum MyCounters { NUM_RECORDS } |
---|
161 | |
---|
162 | private String mapTaskId; |
---|
163 | private String inputFile; |
---|
164 | private int noRecords = 0; |
---|
165 | |
---|
166 | public void configure(JobConf job) { |
---|
167 | mapTaskId = job.get("mapred.task.id"); |
---|
168 | inputFile = job.get("map.input.file"); |
---|
169 | } |
---|
170 | |
---|
171 | public void map(K key, V val, |
---|
172 | OutputCollector<K, V> output, Reporter reporter) |
---|
173 | throws IOException { |
---|
174 | // Process the <key, value> pair (assume this takes a while) |
---|
175 | // ... |
---|
176 | // ... |
---|
177 | |
---|
178 | // Let the framework know that we are alive, and kicking! |
---|
179 | // reporter.progress(); |
---|
180 | |
---|
181 | // Process some more |
---|
182 | // ... |
---|
183 | // ... |
---|
184 | |
---|
185 | // Increment the no. of <key, value> pairs processed |
---|
186 | ++noRecords; |
---|
187 | |
---|
188 | // Increment counters |
---|
189 | reporter.incrCounter(NUM_RECORDS, 1); |
---|
190 | |
---|
191 | // Every 100 records update application-level status |
---|
192 | if ((noRecords%100) == 0) { |
---|
193 | reporter.setStatus(mapTaskId + " processed " + noRecords + |
---|
194 | " from input-file: " + inputFile); |
---|
195 | } |
---|
196 | |
---|
197 | // Output the result |
---|
198 | output.collect(key, val); |
---|
199 | } |
---|
200 | } |
---|
201 | </pre></blockquote></p> |
---|
202 | |
---|
203 | <p>Applications may write a custom <A HREF="../../../../org/apache/hadoop/mapred/MapRunnable.html" title="interface in org.apache.hadoop.mapred"><CODE>MapRunnable</CODE></A> to exert greater |
---|
204 | control on map processing e.g. multi-threaded <code>Mapper</code>s etc.</p> |
---|
205 | <P> |
---|
206 | |
---|
207 | <P> |
---|
208 | <DL> |
---|
209 | <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/mapred/JobConf.html" title="class in org.apache.hadoop.mapred"><CODE>JobConf</CODE></A>, |
---|
210 | <A HREF="../../../../org/apache/hadoop/mapred/InputFormat.html" title="interface in org.apache.hadoop.mapred"><CODE>InputFormat</CODE></A>, |
---|
211 | <A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="interface in org.apache.hadoop.mapred"><CODE>Partitioner</CODE></A>, |
---|
212 | <A HREF="../../../../org/apache/hadoop/mapred/Reducer.html" title="interface in org.apache.hadoop.mapred"><CODE>Reducer</CODE></A>, |
---|
213 | <A HREF="../../../../org/apache/hadoop/mapred/MapReduceBase.html" title="class in org.apache.hadoop.mapred"><CODE>MapReduceBase</CODE></A>, |
---|
214 | <A HREF="../../../../org/apache/hadoop/mapred/MapRunnable.html" title="interface in org.apache.hadoop.mapred"><CODE>MapRunnable</CODE></A>, |
---|
215 | <A HREF="../../../../org/apache/hadoop/io/SequenceFile.html" title="class in org.apache.hadoop.io"><CODE>SequenceFile</CODE></A></DL> |
---|
216 | <HR> |
---|
217 | |
---|
218 | <P> |
---|
219 | |
---|
220 | <!-- ========== METHOD SUMMARY =========== --> |
---|
221 | |
---|
222 | <A NAME="method_summary"><!-- --></A> |
---|
223 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
224 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
225 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
226 | <B>Method Summary</B></FONT></TH> |
---|
227 | </TR> |
---|
228 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
229 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
230 | <CODE> void</CODE></FONT></TD> |
---|
231 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/Mapper.html#map(K1, V1, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)">map</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">K1</A> key, |
---|
232 | <A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">V1</A> value, |
---|
233 | <A HREF="../../../../org/apache/hadoop/mapred/OutputCollector.html" title="interface in org.apache.hadoop.mapred">OutputCollector</A><<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">K2</A>,<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">V2</A>> output, |
---|
234 | <A HREF="../../../../org/apache/hadoop/mapred/Reporter.html" title="interface in org.apache.hadoop.mapred">Reporter</A> reporter)</CODE> |
---|
235 | |
---|
236 | <BR> |
---|
237 | <B>Deprecated.</B> Maps a single input key/value pair into an intermediate key/value pair.</TD> |
---|
238 | </TR> |
---|
239 | </TABLE> |
---|
240 | <A NAME="methods_inherited_from_class_org.apache.hadoop.mapred.JobConfigurable"><!-- --></A> |
---|
241 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
242 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
243 | <TH ALIGN="left"><B>Methods inherited from interface org.apache.hadoop.mapred.<A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html" title="interface in org.apache.hadoop.mapred">JobConfigurable</A></B></TH> |
---|
244 | </TR> |
---|
245 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
246 | <TD><CODE><A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html#configure(org.apache.hadoop.mapred.JobConf)">configure</A></CODE></TD> |
---|
247 | </TR> |
---|
248 | </TABLE> |
---|
249 | <A NAME="methods_inherited_from_class_java.io.Closeable"><!-- --></A> |
---|
250 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
251 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
252 | <TH ALIGN="left"><B>Methods inherited from interface java.io.<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></B></TH> |
---|
253 | </TR> |
---|
254 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
255 | <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE></TD> |
---|
256 | </TR> |
---|
257 | </TABLE> |
---|
258 | |
---|
259 | <P> |
---|
260 | |
---|
261 | <!-- ============ METHOD DETAIL ========== --> |
---|
262 | |
---|
263 | <A NAME="method_detail"><!-- --></A> |
---|
264 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
265 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
266 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
267 | <B>Method Detail</B></FONT></TH> |
---|
268 | </TR> |
---|
269 | </TABLE> |
---|
270 | |
---|
271 | <A NAME="map(java.lang.Object,java.lang.Object,org.apache.hadoop.mapred.OutputCollector,org.apache.hadoop.mapred.Reporter)"><!-- --></A><A NAME="map(K1, V1, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)"><!-- --></A><H3> |
---|
272 | map</H3> |
---|
273 | <PRE> |
---|
274 | void <B>map</B>(<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">K1</A> key, |
---|
275 | <A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">V1</A> value, |
---|
276 | <A HREF="../../../../org/apache/hadoop/mapred/OutputCollector.html" title="interface in org.apache.hadoop.mapred">OutputCollector</A><<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">K2</A>,<A HREF="../../../../org/apache/hadoop/mapred/Mapper.html" title="type parameter in Mapper">V2</A>> output, |
---|
277 | <A HREF="../../../../org/apache/hadoop/mapred/Reporter.html" title="interface in org.apache.hadoop.mapred">Reporter</A> reporter) |
---|
278 | 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> |
---|
279 | <DL> |
---|
280 | <DD><B>Deprecated.</B> <DD>Maps a single input key/value pair into an intermediate key/value pair. |
---|
281 | |
---|
282 | <p>Output pairs need not be of the same types as input pairs. A given |
---|
283 | input pair may map to zero or many output pairs. Output pairs are |
---|
284 | collected with calls to |
---|
285 | <A HREF="../../../../org/apache/hadoop/mapred/OutputCollector.html#collect(K, V)"><CODE>OutputCollector.collect(Object,Object)</CODE></A>.</p> |
---|
286 | |
---|
287 | <p>Applications can use the <A HREF="../../../../org/apache/hadoop/mapred/Reporter.html" title="interface in org.apache.hadoop.mapred"><CODE>Reporter</CODE></A> provided to report progress |
---|
288 | or just indicate that they are alive. In scenarios where the application |
---|
289 | takes an insignificant amount of time to process individual key/value |
---|
290 | pairs, this is crucial since the framework might assume that the task has |
---|
291 | timed-out and kill that task. The other way of avoiding this is to set |
---|
292 | <a href="../../../../../mapred-default.html#mapred.task.timeout"> |
---|
293 | mapred.task.timeout</a> to a high-enough value (or even zero for no |
---|
294 | time-outs).</p> |
---|
295 | <P> |
---|
296 | <DD><DL> |
---|
297 | </DL> |
---|
298 | </DD> |
---|
299 | <DD><DL> |
---|
300 | <DT><B>Parameters:</B><DD><CODE>key</CODE> - the input key.<DD><CODE>value</CODE> - the input value.<DD><CODE>output</CODE> - collects mapped keys and values.<DD><CODE>reporter</CODE> - facility to report progress. |
---|
301 | <DT><B>Throws:</B> |
---|
302 | <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> |
---|
303 | </DD> |
---|
304 | </DL> |
---|
305 | <!-- ========= END OF CLASS DATA ========= --> |
---|
306 | <HR> |
---|
307 | |
---|
308 | |
---|
309 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
310 | <A NAME="navbar_bottom"><!-- --></A> |
---|
311 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
312 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
313 | <TR> |
---|
314 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
315 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
316 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
317 | <TR ALIGN="center" VALIGN="top"> |
---|
318 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
319 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
320 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
321 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Mapper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
322 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
323 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
324 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
325 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
326 | </TR> |
---|
327 | </TABLE> |
---|
328 | </TD> |
---|
329 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
330 | </EM> |
---|
331 | </TD> |
---|
332 | </TR> |
---|
333 | |
---|
334 | <TR> |
---|
335 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
336 | <A HREF="../../../../org/apache/hadoop/mapred/MapFileOutputFormat.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A> |
---|
337 | <A HREF="../../../../org/apache/hadoop/mapred/MapReduceBase.html" title="class in org.apache.hadoop.mapred"><B>NEXT CLASS</B></A></FONT></TD> |
---|
338 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
339 | <A HREF="../../../../index.html?org/apache/hadoop/mapred/Mapper.html" target="_top"><B>FRAMES</B></A> |
---|
340 | <A HREF="Mapper.html" target="_top"><B>NO FRAMES</B></A> |
---|
341 | <SCRIPT type="text/javascript"> |
---|
342 | <!-- |
---|
343 | if(window==top) { |
---|
344 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
345 | } |
---|
346 | //--> |
---|
347 | </SCRIPT> |
---|
348 | <NOSCRIPT> |
---|
349 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
350 | </NOSCRIPT> |
---|
351 | |
---|
352 | |
---|
353 | </FONT></TD> |
---|
354 | </TR> |
---|
355 | <TR> |
---|
356 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
357 | SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
358 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
359 | DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
360 | </TR> |
---|
361 | </TABLE> |
---|
362 | <A NAME="skip-navbar_bottom"></A> |
---|
363 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
364 | |
---|
365 | <HR> |
---|
366 | Copyright © 2009 The Apache Software Foundation |
---|
367 | </BODY> |
---|
368 | </HTML> |
---|