org.apache.tez.runtime.library.api
Interface Partitioner


public interface Partitioner

Partitioner is used by the TEZ framework to partition output key/value pairs. Partitioner Initialization

The Partitioner class is picked up using the TEZ_RUNTIME_PARTITIONER_CLASS attribute in TezJobConfig TODO NEWTEZ Change construction to first check for a Constructor with a bytep[] payload Partitioners need to provide a single argument (Configuration) constructor or a 0 argument constructor. If both exist, preference is given to the single argument constructor. This is primarily for MR support. If using the configuration constructor, TEZ_RUNTIME_NUM_EXPECTED_PARTITIONS will be set in the configuration, to indicate the max number of expected partitions.


Method Summary
 int getPartition(Object key, Object value, int numPartitions)
          Get partition for given key/value.
 

Method Detail

getPartition

int getPartition(Object key,
                 Object value,
                 int numPartitions)
Get partition for given key/value.

Parameters:
key - key
value - value
numPartitions - number of partitions
Returns:
partition for the given key/value


Copyright © 2014 Apache Software Foundation. All rights reserved.