org.apache.blur.manager
Class BlurPartitioner

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Partitioner<org.apache.hadoop.io.Text,org.apache.hadoop.io.Writable>
      extended by org.apache.blur.manager.BlurPartitioner

public class BlurPartitioner
extends org.apache.hadoop.mapreduce.Partitioner<org.apache.hadoop.io.Text,org.apache.hadoop.io.Writable>

The BlurPartitioner class is a Hadoop Partitioner implementation for Blur. Simple hashing class used to guide the rows to the correct shards during MapReduce jobs as well as during normal runtime operations.


Constructor Summary
BlurPartitioner()
           
 
Method Summary
 int getPartition(org.apache.hadoop.io.Text key, org.apache.hadoop.io.Writable value, int numReduceTasks)
          Gets the partition or reducer from the the rowId, based on the number of shards in the table.
 int getShard(String rowId, int numberOfShardsInTable)
          Gets the shard from the the rowId, based on the number of shards in the table.
 int getShard(org.apache.hadoop.io.Text rowId, int numberOfShardsInTable)
          Gets the shard from the the rowId, based on the number of shards in the table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlurPartitioner

public BlurPartitioner()
Method Detail

getShard

public int getShard(String rowId,
                    int numberOfShardsInTable)
Gets the shard from the the rowId, based on the number of shards in the table.

Parameters:
rowId - the rowId
numberOfShardsInTable - the number of shards in the table.
Returns:
the shard where this rowId should be stored.

getShard

public int getShard(org.apache.hadoop.io.Text rowId,
                    int numberOfShardsInTable)
Gets the shard from the the rowId, based on the number of shards in the table.

Parameters:
rowId - the rowId
numberOfShardsInTable - the number of shards in the table.
Returns:
the shard where this rowId should be stored.

getPartition

public int getPartition(org.apache.hadoop.io.Text key,
                        org.apache.hadoop.io.Writable value,
                        int numReduceTasks)
Gets the partition or reducer from the the rowId, based on the number of shards in the table.

Specified by:
getPartition in class org.apache.hadoop.mapreduce.Partitioner<org.apache.hadoop.io.Text,org.apache.hadoop.io.Writable>
Parameters:
rowId - the rowId
numberOfShardsInTable - the number of shards in the table.
Returns:
the partition where this rowId should be processed.


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.