com.bigdata.service.mapred
Interface IHashFunction

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultHashFunction

public interface IHashFunction
extends Serializable

Interface for a hash function to be applied to the keys generated by an IMapTask. The hash function (modulo the #of reduce tasks) is used to assign the key-value pairs generated by an IMapTask to a reduce task.

Version:
$Id: IHashFunction.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 int hashCode(byte[] key)
          The hash function used to assign map output keys to reduce tasks.
 

Method Detail

hashCode

int hashCode(byte[] key)
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.

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.