source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/contrib/index/mapred/IDistributionPolicy.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.8 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:59 UTC 2009 -->
6<TITLE>
7IDistributionPolicy (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="IDistributionPolicy (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/IDistributionPolicy.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/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/IIndexUpdater.html" title="interface in org.apache.hadoop.contrib.index.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/contrib/index/mapred/IDistributionPolicy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="IDistributionPolicy.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.contrib.index.mapred</FONT>
92<BR>
93Interface IDistributionPolicy</H2>
94<DL>
95<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../org/apache/hadoop/contrib/index/example/HashingDistributionPolicy.html" title="class in org.apache.hadoop.contrib.index.example">HashingDistributionPolicy</A>, <A HREF="../../../../../../org/apache/hadoop/contrib/index/example/RoundRobinDistributionPolicy.html" title="class in org.apache.hadoop.contrib.index.example">RoundRobinDistributionPolicy</A></DD>
96</DL>
97<HR>
98<DL>
99<DT><PRE>public interface <B>IDistributionPolicy</B></DL>
100</PRE>
101
102<P>
103A distribution policy decides, given a document with a document id, which
104 one shard the request should be sent to if the request is an insert, and
105 which shard(s) the request should be sent to if the request is a delete.
106<P>
107
108<P>
109<HR>
110
111<P>
112
113<!-- ========== METHOD SUMMARY =========== -->
114
115<A NAME="method_summary"><!-- --></A>
116<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
117<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
118<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
119<B>Method Summary</B></FONT></TH>
120</TR>
121<TR BGCOLOR="white" CLASS="TableRowColor">
122<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
123<CODE>&nbsp;int</CODE></FONT></TD>
124<TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/IDistributionPolicy.html#chooseShardForDelete(org.apache.hadoop.contrib.index.mapred.DocumentID)">chooseShardForDelete</A></B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred">DocumentID</A>&nbsp;key)</CODE>
125
126<BR>
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Choose a shard or all shards to send a delete request.</TD>
128</TR>
129<TR BGCOLOR="white" CLASS="TableRowColor">
130<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
131<CODE>&nbsp;int</CODE></FONT></TD>
132<TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/IDistributionPolicy.html#chooseShardForInsert(org.apache.hadoop.contrib.index.mapred.DocumentID)">chooseShardForInsert</A></B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred">DocumentID</A>&nbsp;key)</CODE>
133
134<BR>
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Choose a shard to send an insert request.</TD>
136</TR>
137<TR BGCOLOR="white" CLASS="TableRowColor">
138<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
139<CODE>&nbsp;void</CODE></FONT></TD>
140<TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/IDistributionPolicy.html#init(org.apache.hadoop.contrib.index.mapred.Shard[])">init</A></B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/Shard.html" title="class in org.apache.hadoop.contrib.index.mapred">Shard</A>[]&nbsp;shards)</CODE>
141
142<BR>
143&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialization.</TD>
144</TR>
145</TABLE>
146&nbsp;
147<P>
148
149<!-- ============ METHOD DETAIL ========== -->
150
151<A NAME="method_detail"><!-- --></A>
152<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
153<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
154<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
155<B>Method Detail</B></FONT></TH>
156</TR>
157</TABLE>
158
159<A NAME="init(org.apache.hadoop.contrib.index.mapred.Shard[])"><!-- --></A><H3>
160init</H3>
161<PRE>
162void <B>init</B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/Shard.html" title="class in org.apache.hadoop.contrib.index.mapred">Shard</A>[]&nbsp;shards)</PRE>
163<DL>
164<DD>Initialization. It must be called before any chooseShard() is called.
165<P>
166<DD><DL>
167<DT><B>Parameters:</B><DD><CODE>shards</CODE> - </DL>
168</DD>
169</DL>
170<HR>
171
172<A NAME="chooseShardForInsert(org.apache.hadoop.contrib.index.mapred.DocumentID)"><!-- --></A><H3>
173chooseShardForInsert</H3>
174<PRE>
175int <B>chooseShardForInsert</B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred">DocumentID</A>&nbsp;key)</PRE>
176<DL>
177<DD>Choose a shard to send an insert request.
178<P>
179<DD><DL>
180<DT><B>Parameters:</B><DD><CODE>key</CODE> -
181<DT><B>Returns:</B><DD>the index of the chosen shard</DL>
182</DD>
183</DL>
184<HR>
185
186<A NAME="chooseShardForDelete(org.apache.hadoop.contrib.index.mapred.DocumentID)"><!-- --></A><H3>
187chooseShardForDelete</H3>
188<PRE>
189int <B>chooseShardForDelete</B>(<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred">DocumentID</A>&nbsp;key)</PRE>
190<DL>
191<DD>Choose a shard or all shards to send a delete request. E.g. a round-robin
192 distribution policy would send a delete request to all the shards.
193 -1 represents all the shards.
194<P>
195<DD><DL>
196<DT><B>Parameters:</B><DD><CODE>key</CODE> -
197<DT><B>Returns:</B><DD>the index of the chosen shard, -1 if all the shards are chosen</DL>
198</DD>
199</DL>
200<!-- ========= END OF CLASS DATA ========= -->
201<HR>
202
203
204<!-- ======= START OF BOTTOM NAVBAR ====== -->
205<A NAME="navbar_bottom"><!-- --></A>
206<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
207<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
208<TR>
209<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
210<A NAME="navbar_bottom_firstrow"><!-- --></A>
211<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
212  <TR ALIGN="center" VALIGN="top">
213  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
214  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
215  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
216  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/IDistributionPolicy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
217  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
218  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
219  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
220  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
221  </TR>
222</TABLE>
223</TD>
224<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
225</EM>
226</TD>
227</TR>
228
229<TR>
230<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
231&nbsp;<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/DocumentID.html" title="class in org.apache.hadoop.contrib.index.mapred"><B>PREV CLASS</B></A>&nbsp;
232&nbsp;<A HREF="../../../../../../org/apache/hadoop/contrib/index/mapred/IIndexUpdater.html" title="interface in org.apache.hadoop.contrib.index.mapred"><B>NEXT CLASS</B></A></FONT></TD>
233<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
234  <A HREF="../../../../../../index.html?org/apache/hadoop/contrib/index/mapred/IDistributionPolicy.html" target="_top"><B>FRAMES</B></A>  &nbsp;
235&nbsp;<A HREF="IDistributionPolicy.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
236&nbsp;<SCRIPT type="text/javascript">
237  <!--
238  if(window==top) {
239    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
240  }
241  //-->
242</SCRIPT>
243<NOSCRIPT>
244  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
245</NOSCRIPT>
246
247
248</FONT></TD>
249</TR>
250<TR>
251<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
252  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
253<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
254DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
255</TR>
256</TABLE>
257<A NAME="skip-navbar_bottom"></A>
258<!-- ======== END OF BOTTOM NAVBAR ======= -->
259
260<HR>
261Copyright &copy; 2009 The Apache Software Foundation
262</BODY>
263</HTML>
Note: See TracBrowser for help on using the repository browser.