source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/util/hash/Hash.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: 21.6 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>
7Hash (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="Hash (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/Hash.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;PREV CLASS&nbsp;
59&nbsp;<A HREF="../../../../../org/apache/hadoop/util/hash/JenkinsHash.html" title="class in org.apache.hadoop.util.hash"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../../index.html?org/apache/hadoop/util/hash/Hash.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Hash.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&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.util.hash</FONT>
92<BR>
93Class Hash</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.util.hash.Hash</B>
97</PRE>
98<DL>
99<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/hadoop/util/hash/JenkinsHash.html" title="class in org.apache.hadoop.util.hash">JenkinsHash</A>, <A HREF="../../../../../org/apache/hadoop/util/hash/MurmurHash.html" title="class in org.apache.hadoop.util.hash">MurmurHash</A></DD>
100</DL>
101<HR>
102<DL>
103<DT><PRE>public abstract class <B>Hash</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></DL>
104</PRE>
105
106<P>
107This class represents a common API for hashing functions.
108<P>
109
110<P>
111<HR>
112
113<P>
114<!-- =========== FIELD SUMMARY =========== -->
115
116<A NAME="field_summary"><!-- --></A>
117<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
118<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
119<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
120<B>Field Summary</B></FONT></TH>
121</TR>
122<TR BGCOLOR="white" CLASS="TableRowColor">
123<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
124<CODE>static&nbsp;int</CODE></FONT></TD>
125<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#INVALID_HASH">INVALID_HASH</A></B></CODE>
126
127<BR>
128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant to denote invalid hash type.</TD>
129</TR>
130<TR BGCOLOR="white" CLASS="TableRowColor">
131<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
132<CODE>static&nbsp;int</CODE></FONT></TD>
133<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#JENKINS_HASH">JENKINS_HASH</A></B></CODE>
134
135<BR>
136&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant to denote <A HREF="../../../../../org/apache/hadoop/util/hash/JenkinsHash.html" title="class in org.apache.hadoop.util.hash"><CODE>JenkinsHash</CODE></A>.</TD>
137</TR>
138<TR BGCOLOR="white" CLASS="TableRowColor">
139<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
140<CODE>static&nbsp;int</CODE></FONT></TD>
141<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#MURMUR_HASH">MURMUR_HASH</A></B></CODE>
142
143<BR>
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant to denote <A HREF="../../../../../org/apache/hadoop/util/hash/MurmurHash.html" title="class in org.apache.hadoop.util.hash"><CODE>MurmurHash</CODE></A>.</TD>
145</TR>
146</TABLE>
147&nbsp;
148<!-- ======== CONSTRUCTOR SUMMARY ======== -->
149
150<A NAME="constructor_summary"><!-- --></A>
151<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
152<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
153<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
154<B>Constructor Summary</B></FONT></TH>
155</TR>
156<TR BGCOLOR="white" CLASS="TableRowColor">
157<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#Hash()">Hash</A></B>()</CODE>
158
159<BR>
160&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
161</TR>
162</TABLE>
163&nbsp;
164<!-- ========== METHOD SUMMARY =========== -->
165
166<A NAME="method_summary"><!-- --></A>
167<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
168<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
169<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
170<B>Method Summary</B></FONT></TH>
171</TR>
172<TR BGCOLOR="white" CLASS="TableRowColor">
173<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
174<CODE>static&nbsp;int</CODE></FONT></TD>
175<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#getHashType(org.apache.hadoop.conf.Configuration)">getHashType</A></B>(<A HREF="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</CODE>
176
177<BR>
178&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This utility method converts the name of the configured
179 hash type to a symbolic constant.</TD>
180</TR>
181<TR BGCOLOR="white" CLASS="TableRowColor">
182<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
183<CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html" title="class in org.apache.hadoop.util.hash">Hash</A></CODE></FONT></TD>
184<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#getInstance(org.apache.hadoop.conf.Configuration)">getInstance</A></B>(<A HREF="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</CODE>
185
186<BR>
187&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a singleton instance of hash function of a type
188 defined in the configuration.</TD>
189</TR>
190<TR BGCOLOR="white" CLASS="TableRowColor">
191<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
192<CODE>static&nbsp;<A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html" title="class in org.apache.hadoop.util.hash">Hash</A></CODE></FONT></TD>
193<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#getInstance(int)">getInstance</A></B>(int&nbsp;type)</CODE>
194
195<BR>
196&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a singleton instance of hash function of a given type.</TD>
197</TR>
198<TR BGCOLOR="white" CLASS="TableRowColor">
199<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
200<CODE>&nbsp;int</CODE></FONT></TD>
201<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#hash(byte[])">hash</A></B>(byte[]&nbsp;bytes)</CODE>
202
203<BR>
204&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate a hash using all bytes from the input argument, and
205 a seed of -1.</TD>
206</TR>
207<TR BGCOLOR="white" CLASS="TableRowColor">
208<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
209<CODE>&nbsp;int</CODE></FONT></TD>
210<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#hash(byte[], int)">hash</A></B>(byte[]&nbsp;bytes,
211     int&nbsp;initval)</CODE>
212
213<BR>
214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate a hash using all bytes from the input argument,
215 and a provided seed value.</TD>
216</TR>
217<TR BGCOLOR="white" CLASS="TableRowColor">
218<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
219<CODE>abstract &nbsp;int</CODE></FONT></TD>
220<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#hash(byte[], int, int)">hash</A></B>(byte[]&nbsp;bytes,
221     int&nbsp;length,
222     int&nbsp;initval)</CODE>
223
224<BR>
225&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate a hash using bytes from 0 to <code>length</code>, and
226 the provided seed value</TD>
227</TR>
228<TR BGCOLOR="white" CLASS="TableRowColor">
229<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
230<CODE>static&nbsp;int</CODE></FONT></TD>
231<TD><CODE><B><A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html#parseHashType(java.lang.String)">parseHashType</A></B>(<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>&nbsp;name)</CODE>
232
233<BR>
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This utility method converts String representation of hash function name
235 to a symbolic constant.</TD>
236</TR>
237</TABLE>
238&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
239<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
240<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
241<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>
242</TR>
243<TR BGCOLOR="white" CLASS="TableRowColor">
244<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>
245</TR>
246</TABLE>
247&nbsp;
248<P>
249
250<!-- ============ FIELD DETAIL =========== -->
251
252<A NAME="field_detail"><!-- --></A>
253<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
254<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
255<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
256<B>Field Detail</B></FONT></TH>
257</TR>
258</TABLE>
259
260<A NAME="INVALID_HASH"><!-- --></A><H3>
261INVALID_HASH</H3>
262<PRE>
263public static final int <B>INVALID_HASH</B></PRE>
264<DL>
265<DD>Constant to denote invalid hash type.
266<P>
267<DL>
268<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.hadoop.util.hash.Hash.INVALID_HASH">Constant Field Values</A></DL>
269</DL>
270<HR>
271
272<A NAME="JENKINS_HASH"><!-- --></A><H3>
273JENKINS_HASH</H3>
274<PRE>
275public static final int <B>JENKINS_HASH</B></PRE>
276<DL>
277<DD>Constant to denote <A HREF="../../../../../org/apache/hadoop/util/hash/JenkinsHash.html" title="class in org.apache.hadoop.util.hash"><CODE>JenkinsHash</CODE></A>.
278<P>
279<DL>
280<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.hadoop.util.hash.Hash.JENKINS_HASH">Constant Field Values</A></DL>
281</DL>
282<HR>
283
284<A NAME="MURMUR_HASH"><!-- --></A><H3>
285MURMUR_HASH</H3>
286<PRE>
287public static final int <B>MURMUR_HASH</B></PRE>
288<DL>
289<DD>Constant to denote <A HREF="../../../../../org/apache/hadoop/util/hash/MurmurHash.html" title="class in org.apache.hadoop.util.hash"><CODE>MurmurHash</CODE></A>.
290<P>
291<DL>
292<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.hadoop.util.hash.Hash.MURMUR_HASH">Constant Field Values</A></DL>
293</DL>
294
295<!-- ========= CONSTRUCTOR DETAIL ======== -->
296
297<A NAME="constructor_detail"><!-- --></A>
298<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
299<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
300<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
301<B>Constructor Detail</B></FONT></TH>
302</TR>
303</TABLE>
304
305<A NAME="Hash()"><!-- --></A><H3>
306Hash</H3>
307<PRE>
308public <B>Hash</B>()</PRE>
309<DL>
310</DL>
311
312<!-- ============ METHOD DETAIL ========== -->
313
314<A NAME="method_detail"><!-- --></A>
315<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
316<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
317<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
318<B>Method Detail</B></FONT></TH>
319</TR>
320</TABLE>
321
322<A NAME="parseHashType(java.lang.String)"><!-- --></A><H3>
323parseHashType</H3>
324<PRE>
325public static int <B>parseHashType</B>(<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>&nbsp;name)</PRE>
326<DL>
327<DD>This utility method converts String representation of hash function name
328 to a symbolic constant. Currently two function types are supported,
329 "jenkins" and "murmur".
330<P>
331<DD><DL>
332<DT><B>Parameters:</B><DD><CODE>name</CODE> - hash function name
333<DT><B>Returns:</B><DD>one of the predefined constants</DL>
334</DD>
335</DL>
336<HR>
337
338<A NAME="getHashType(org.apache.hadoop.conf.Configuration)"><!-- --></A><H3>
339getHashType</H3>
340<PRE>
341public static int <B>getHashType</B>(<A HREF="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</PRE>
342<DL>
343<DD>This utility method converts the name of the configured
344 hash type to a symbolic constant.
345<P>
346<DD><DL>
347<DT><B>Parameters:</B><DD><CODE>conf</CODE> - configuration
348<DT><B>Returns:</B><DD>one of the predefined constants</DL>
349</DD>
350</DL>
351<HR>
352
353<A NAME="getInstance(int)"><!-- --></A><H3>
354getInstance</H3>
355<PRE>
356public static <A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html" title="class in org.apache.hadoop.util.hash">Hash</A> <B>getInstance</B>(int&nbsp;type)</PRE>
357<DL>
358<DD>Get a singleton instance of hash function of a given type.
359<P>
360<DD><DL>
361<DT><B>Parameters:</B><DD><CODE>type</CODE> - predefined hash type
362<DT><B>Returns:</B><DD>hash function instance, or null if type is invalid</DL>
363</DD>
364</DL>
365<HR>
366
367<A NAME="getInstance(org.apache.hadoop.conf.Configuration)"><!-- --></A><H3>
368getInstance</H3>
369<PRE>
370public static <A HREF="../../../../../org/apache/hadoop/util/hash/Hash.html" title="class in org.apache.hadoop.util.hash">Hash</A> <B>getInstance</B>(<A HREF="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</A>&nbsp;conf)</PRE>
371<DL>
372<DD>Get a singleton instance of hash function of a type
373 defined in the configuration.
374<P>
375<DD><DL>
376<DT><B>Parameters:</B><DD><CODE>conf</CODE> - current configuration
377<DT><B>Returns:</B><DD>defined hash type, or null if type is invalid</DL>
378</DD>
379</DL>
380<HR>
381
382<A NAME="hash(byte[])"><!-- --></A><H3>
383hash</H3>
384<PRE>
385public int <B>hash</B>(byte[]&nbsp;bytes)</PRE>
386<DL>
387<DD>Calculate a hash using all bytes from the input argument, and
388 a seed of -1.
389<P>
390<DD><DL>
391<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - input bytes
392<DT><B>Returns:</B><DD>hash value</DL>
393</DD>
394</DL>
395<HR>
396
397<A NAME="hash(byte[], int)"><!-- --></A><H3>
398hash</H3>
399<PRE>
400public int <B>hash</B>(byte[]&nbsp;bytes,
401                int&nbsp;initval)</PRE>
402<DL>
403<DD>Calculate a hash using all bytes from the input argument,
404 and a provided seed value.
405<P>
406<DD><DL>
407<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - input bytes<DD><CODE>initval</CODE> - seed value
408<DT><B>Returns:</B><DD>hash value</DL>
409</DD>
410</DL>
411<HR>
412
413<A NAME="hash(byte[], int, int)"><!-- --></A><H3>
414hash</H3>
415<PRE>
416public abstract int <B>hash</B>(byte[]&nbsp;bytes,
417                         int&nbsp;length,
418                         int&nbsp;initval)</PRE>
419<DL>
420<DD>Calculate a hash using bytes from 0 to <code>length</code>, and
421 the provided seed value
422<P>
423<DD><DL>
424<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - input bytes<DD><CODE>length</CODE> - length of the valid bytes to consider<DD><CODE>initval</CODE> - seed value
425<DT><B>Returns:</B><DD>hash value</DL>
426</DD>
427</DL>
428<!-- ========= END OF CLASS DATA ========= -->
429<HR>
430
431
432<!-- ======= START OF BOTTOM NAVBAR ====== -->
433<A NAME="navbar_bottom"><!-- --></A>
434<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
435<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
436<TR>
437<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
438<A NAME="navbar_bottom_firstrow"><!-- --></A>
439<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
440  <TR ALIGN="center" VALIGN="top">
441  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
442  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
443  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
444  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Hash.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
445  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
446  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
447  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
448  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
449  </TR>
450</TABLE>
451</TD>
452<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
453</EM>
454</TD>
455</TR>
456
457<TR>
458<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
459&nbsp;PREV CLASS&nbsp;
460&nbsp;<A HREF="../../../../../org/apache/hadoop/util/hash/JenkinsHash.html" title="class in org.apache.hadoop.util.hash"><B>NEXT CLASS</B></A></FONT></TD>
461<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
462  <A HREF="../../../../../index.html?org/apache/hadoop/util/hash/Hash.html" target="_top"><B>FRAMES</B></A>  &nbsp;
463&nbsp;<A HREF="Hash.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
464&nbsp;<SCRIPT type="text/javascript">
465  <!--
466  if(window==top) {
467    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
468  }
469  //-->
470</SCRIPT>
471<NOSCRIPT>
472  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
473</NOSCRIPT>
474
475
476</FONT></TD>
477</TR>
478<TR>
479<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
480  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
481<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
482DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
483</TR>
484</TABLE>
485<A NAME="skip-navbar_bottom"></A>
486<!-- ======== END OF BOTTOM NAVBAR ======= -->
487
488<HR>
489Copyright &copy; 2009 The Apache Software Foundation
490</BODY>
491</HTML>
Note: See TracBrowser for help on using the repository browser.