Project

General

Profile

1
package eu.dnetlib.data.mapreduce.hbase.dedup.kv;
2

    
3
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
4
import org.apache.hadoop.mapreduce.Partitioner;
5

    
6
/**
7
 * Created by claudio on 13/03/2017.
8
 */
9
public class DNGFKeyPartitioner extends Partitioner<DNGFKey, ImmutableBytesWritable > {
10

    
11
	@Override
12
	public int getPartition(DNGFKey key, ImmutableBytesWritable  val, int numPartitions) {
13
        final int res = Math.abs(key.getId().hashCode() % numPartitions);
14

    
15
        return res;
16

    
17

    
18
	}
19

    
20
}
(3-3/3)