com.datasalt.pangool.tuplemr.mapred
Class TupleHashPartitioner

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Partitioner<DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
      extended by com.datasalt.pangool.tuplemr.mapred.TupleHashPartitioner
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable

public class TupleHashPartitioner
extends org.apache.hadoop.mapreduce.Partitioner<DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
implements org.apache.hadoop.conf.Configurable


Constructor Summary
TupleHashPartitioner()
           
 
Method Summary
 org.apache.hadoop.conf.Configuration getConf()
           
 int getPartition(DatumWrapper<ITuple> key, org.apache.hadoop.io.NullWritable value, int numPartitions)
           
static int hashBytes(byte[] array, int offset, int length)
           
 int partialHashCode(ITuple tuple, int[] fields)
          Calculates a combinated hashCode using the specified number of fields.
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleHashPartitioner

public TupleHashPartitioner()
Method Detail

getPartition

public int getPartition(DatumWrapper<ITuple> key,
                        org.apache.hadoop.io.NullWritable value,
                        int numPartitions)
Specified by:
getPartition in class org.apache.hadoop.mapreduce.Partitioner<DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

partialHashCode

public int partialHashCode(ITuple tuple,
                           int[] fields)
Calculates a combinated hashCode using the specified number of fields.


hashBytes

public static int hashBytes(byte[] array,
                            int offset,
                            int length)


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.