org.htuple
Class ShuffleUtils.ConfigBuilder

java.lang.Object
  extended by org.htuple.ShuffleUtils.ConfigBuilder
Enclosing class:
ShuffleUtils

public static class ShuffleUtils.ConfigBuilder
extends Object

A builder that allows you to tune how partitioning, sorting and grouping should work for a given MapReduce job using your Tuple instances.


Constructor Summary
ShuffleUtils.ConfigBuilder()
           
 
Method Summary
 void configure(org.apache.hadoop.conf.Configuration conf)
          Configure the supplied configuration object with any partitioner, sorting and grouping configs that were setup prior to calling this method.
static int[] enumOrdinalsToArray(Enum<?>... enums)
           
 ShuffleUtils.ConfigBuilder setGroupIndices(Enum<?>... indices)
          Set the tuple indexes that will be used by the TupleComparator for grouping.
 ShuffleUtils.ConfigBuilder setGroupIndices(int... indices)
          Set the tuple indexes that will be used by the TupleComparator for grouping.
 ShuffleUtils.ConfigBuilder setPartitionerIndices(Enum<?>... indices)
          Set the tuple indexes that will be used by the Partitioner.
 ShuffleUtils.ConfigBuilder setPartitionerIndices(int... indices)
          Set the tuple indexes that will be used by the Partitioner.
 ShuffleUtils.ConfigBuilder setSortIndices(Enum<?>... indices)
          Set the tuple indexes that will be used by the TupleComparator for sorting.
 ShuffleUtils.ConfigBuilder setSortIndices(int... indices)
          Set the tuple indexes that will be used by the TupleComparator for sorting.
 ShuffleUtils.ConfigBuilder useNewApi()
          Indicate that the new org.apache.hadoop.mapreduce API should be used when configuring the job.
 ShuffleUtils.ConfigBuilder useOldApi()
          Indicate that the old org.apache.hadoop.mapred API should be used when configuring the job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShuffleUtils.ConfigBuilder

public ShuffleUtils.ConfigBuilder()
Method Detail

useOldApi

public ShuffleUtils.ConfigBuilder useOldApi()
Indicate that the old org.apache.hadoop.mapred API should be used when configuring the job.

Returns:
a handle to this object to enable builder operations

useNewApi

public ShuffleUtils.ConfigBuilder useNewApi()
Indicate that the new org.apache.hadoop.mapreduce API should be used when configuring the job.

Returns:
a handle to this object to enable builder operations

setPartitionerIndices

public ShuffleUtils.ConfigBuilder setPartitionerIndices(int... indices)
Set the tuple indexes that will be used by the Partitioner.

Returns:
a handle to this object to enable builder operations

setPartitionerIndices

public ShuffleUtils.ConfigBuilder setPartitionerIndices(Enum<?>... indices)
Set the tuple indexes that will be used by the Partitioner. The ordinal values of the supplied arguments are used to determine the indexes.

Returns:
a handle to this object to enable builder operations

setSortIndices

public ShuffleUtils.ConfigBuilder setSortIndices(int... indices)
Set the tuple indexes that will be used by the TupleComparator for sorting.

These indexes are used according to the order that they are supplied to this method. In other words, if you call setSortIndices(2, 1);, then the 3rd element will be used for sorting followed by the second element.

Returns:
a handle to this object to enable builder operations

setSortIndices

public ShuffleUtils.ConfigBuilder setSortIndices(Enum<?>... indices)
Set the tuple indexes that will be used by the TupleComparator for sorting. The ordinal values of the supplied arguments are used to determine the indexes.

These indexes are used according to the order that they are supplied to this method. In other words, if you call setSortIndices(2, 1);, then the 3rd element will be used for sorting followed by the second element.

Returns:
a handle to this object to enable builder operations

setGroupIndices

public ShuffleUtils.ConfigBuilder setGroupIndices(int... indices)
Set the tuple indexes that will be used by the TupleComparator for grouping.

These indexes are used according to the order that they are supplied to this method. In other words, if you call setGroupIndices(2, 1);, then the 3rd element will be used for grouping followed by the second element.

Returns:
a handle to this object to enable builder operations

setGroupIndices

public ShuffleUtils.ConfigBuilder setGroupIndices(Enum<?>... indices)
Set the tuple indexes that will be used by the TupleComparator for grouping. The ordinal values of the supplied arguments are used to determine the indexes.

These indexes are used according to the order that they are supplied to this method. In other words, if you call setGroupIndices(2, 1);, then the 3rd element will be used for grouping followed by the second element.

Returns:
a handle to this object to enable builder operations

configure

public void configure(org.apache.hadoop.conf.Configuration conf)
Configure the supplied configuration object with any partitioner, sorting and grouping configs that were setup prior to calling this method.

Parameters:
conf - the Hadoop configuration to be populated

enumOrdinalsToArray

public static int[] enumOrdinalsToArray(Enum<?>... enums)


Copyright © 2013. All Rights Reserved.