source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/mapred/Partitioner.html @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 11.9 KB
Line 
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>
7Partitioner (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">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="Partitioner (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>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Partitioner.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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&nbsp;<A HREF="../../../../org/apache/hadoop/mapred/OutputLogFilter.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../org/apache/hadoop/mapred/RawKeyValueIterator.html" title="interface 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/Partitioner.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Partitioner.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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">
91org.apache.hadoop.mapred</FONT>
92<BR>
93Interface Partitioner&lt;K2,V2&gt;</H2>
94<DL>
95<DT><B>All Superinterfaces:</B> <DD><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 Implementing Classes:</B> <DD><A HREF="../../../../org/apache/hadoop/mapred/lib/HashPartitioner.html" title="class in org.apache.hadoop.mapred.lib">HashPartitioner</A>, <A HREF="../../../../org/apache/hadoop/contrib/index/mapred/IndexUpdatePartitioner.html" title="class in org.apache.hadoop.contrib.index.mapred">IndexUpdatePartitioner</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/KeyFieldBasedPartitioner.html" title="class in org.apache.hadoop.mapred.lib">KeyFieldBasedPartitioner</A>, <A HREF="../../../../org/apache/hadoop/examples/SleepJob.html" title="class in org.apache.hadoop.examples">SleepJob</A>, <A HREF="../../../../org/apache/hadoop/mapred/lib/TotalOrderPartitioner.html" title="class in org.apache.hadoop.mapred.lib">TotalOrderPartitioner</A></DD>
99</DL>
100<HR>
101<B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../../org/apache/hadoop/mapreduce/Partitioner.html" title="class in org.apache.hadoop.mapreduce"><CODE>Partitioner</CODE></A> instead.</I>
102<P>
103<DL>
104<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>
105</FONT>public interface <B>Partitioner&lt;K2,V2&gt;</B><DT>extends <A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html" title="interface in org.apache.hadoop.mapred">JobConfigurable</A></DL>
106</PRE>
107
108<P>
109Partitions the key space.
110 
111 <p><code>Partitioner</code> controls the partitioning of the keys of the
112 intermediate map-outputs. The key (or a subset of the key) is used to derive
113 the partition, typically by a hash function. The total number of partitions
114 is the same as the number of reduce tasks for the job. Hence this controls
115 which of the <code>m</code> reduce tasks the intermediate key (and hence the
116 record) is sent for reduction.</p>
117<P>
118
119<P>
120<DL>
121<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/mapred/Reducer.html" title="interface in org.apache.hadoop.mapred"><CODE>Reducer</CODE></A></DL>
122<HR>
123
124<P>
125
126<!-- ========== METHOD SUMMARY =========== -->
127
128<A NAME="method_summary"><!-- --></A>
129<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
130<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
131<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
132<B>Method Summary</B></FONT></TH>
133</TR>
134<TR BGCOLOR="white" CLASS="TableRowColor">
135<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
136<CODE>&nbsp;int</CODE></FONT></TD>
137<TD><CODE><B><A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html#getPartition(K2, V2, int)">getPartition</A></B>(<A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="type parameter in Partitioner">K2</A>&nbsp;key,
138             <A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="type parameter in Partitioner">V2</A>&nbsp;value,
139             int&nbsp;numPartitions)</CODE>
140
141<BR>
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;Get the paritition number for a given key (hence record) given the total
143 number of partitions i.e.</TD>
144</TR>
145</TABLE>
146&nbsp;<A NAME="methods_inherited_from_class_org.apache.hadoop.mapred.JobConfigurable"><!-- --></A>
147<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
148<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
149<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>
150</TR>
151<TR BGCOLOR="white" CLASS="TableRowColor">
152<TD><CODE><A HREF="../../../../org/apache/hadoop/mapred/JobConfigurable.html#configure(org.apache.hadoop.mapred.JobConf)">configure</A></CODE></TD>
153</TR>
154</TABLE>
155&nbsp;
156<P>
157
158<!-- ============ METHOD DETAIL ========== -->
159
160<A NAME="method_detail"><!-- --></A>
161<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
162<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
163<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
164<B>Method Detail</B></FONT></TH>
165</TR>
166</TABLE>
167
168<A NAME="getPartition(java.lang.Object,java.lang.Object,int)"><!-- --></A><A NAME="getPartition(K2, V2, int)"><!-- --></A><H3>
169getPartition</H3>
170<PRE>
171int <B>getPartition</B>(<A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="type parameter in Partitioner">K2</A>&nbsp;key,
172                 <A HREF="../../../../org/apache/hadoop/mapred/Partitioner.html" title="type parameter in Partitioner">V2</A>&nbsp;value,
173                 int&nbsp;numPartitions)</PRE>
174<DL>
175<DD><B>Deprecated.</B>&nbsp;<DD>Get the paritition number for a given key (hence record) given the total
176 number of partitions i.e. number of reduce-tasks for the job.
177   
178 <p>Typically a hash function on a all or a subset of the key.</p>
179<P>
180<DD><DL>
181</DL>
182</DD>
183<DD><DL>
184<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to be paritioned.<DD><CODE>value</CODE> - the entry value.<DD><CODE>numPartitions</CODE> - the total number of partitions.
185<DT><B>Returns:</B><DD>the partition number for the <code>key</code>.</DL>
186</DD>
187</DL>
188<!-- ========= END OF CLASS DATA ========= -->
189<HR>
190
191
192<!-- ======= START OF BOTTOM NAVBAR ====== -->
193<A NAME="navbar_bottom"><!-- --></A>
194<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
195<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
196<TR>
197<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
198<A NAME="navbar_bottom_firstrow"><!-- --></A>
199<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
200  <TR ALIGN="center" VALIGN="top">
201  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
202  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
203  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
204  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Partitioner.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
205  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
206  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
207  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
208  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
209  </TR>
210</TABLE>
211</TD>
212<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
213</EM>
214</TD>
215</TR>
216
217<TR>
218<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
219&nbsp;<A HREF="../../../../org/apache/hadoop/mapred/OutputLogFilter.html" title="class in org.apache.hadoop.mapred"><B>PREV CLASS</B></A>&nbsp;
220&nbsp;<A HREF="../../../../org/apache/hadoop/mapred/RawKeyValueIterator.html" title="interface in org.apache.hadoop.mapred"><B>NEXT CLASS</B></A></FONT></TD>
221<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
222  <A HREF="../../../../index.html?org/apache/hadoop/mapred/Partitioner.html" target="_top"><B>FRAMES</B></A>  &nbsp;
223&nbsp;<A HREF="Partitioner.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
224&nbsp;<SCRIPT type="text/javascript">
225  <!--
226  if(window==top) {
227    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
228  }
229  //-->
230</SCRIPT>
231<NOSCRIPT>
232  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
233</NOSCRIPT>
234
235
236</FONT></TD>
237</TR>
238<TR>
239<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
240  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
241<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
242DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
243</TR>
244</TABLE>
245<A NAME="skip-navbar_bottom"></A>
246<!-- ======== END OF BOTTOM NAVBAR ======= -->
247
248<HR>
249Copyright &copy; 2009 The Apache Software Foundation
250</BODY>
251</HTML>
Note: See TracBrowser for help on using the repository browser.