com.bigdata.service.mapred
Class DefaultHashFunction
java.lang.Object
com.bigdata.service.mapred.DefaultHashFunction
- All Implemented Interfaces:
- IHashFunction, Serializable
public class DefaultHashFunction
- extends Object
- implements IHashFunction
This is default implementation of IHashFunction - it is based on
Arrays.hashCode(byte[]).
- Version:
- $Id: DefaultHashFunction.java 2265 2009-10-26 12:51:06Z thompsonbry $
- Author:
- Bryan Thompson
- See Also:
- Serialized Form
|
Method Summary |
int |
hashCode(byte[] key)
The hash function used to assign map output keys to reduce tasks. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final transient IHashFunction INSTANCE
hashCode
public int hashCode(byte[] key)
- Description copied from interface:
IHashFunction
- The hash function used to assign map output keys to reduce tasks.
This is normally
hash(key) mod R, where hash(key) is
Arrays.hashCode(byte[]) and R is the #of reduce tasks.
- Specified by:
hashCode in interface IHashFunction
- Parameters:
key - The key produced by an IMapTask.
- Returns:
- The index of the reduce service on which the key-value pair
will be written.
Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.