This project has retired. For details please refer to its Attic page.
WritableGroupedTableType (Apache Crunch 0.3.0-incubating API)

org.apache.crunch.types.writable
Class WritableGroupedTableType<K,V>

java.lang.Object
  extended by org.apache.crunch.types.PGroupedTableType<K,V>
      extended by org.apache.crunch.types.writable.WritableGroupedTableType<K,V>
All Implemented Interfaces:
Serializable, PType<Pair<K,Iterable<V>>>

public class WritableGroupedTableType<K,V>
extends PGroupedTableType<K,V>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.crunch.types.PGroupedTableType
PGroupedTableType.PairIterableMapFn<K,V>
 
Constructor Summary
WritableGroupedTableType(org.apache.crunch.types.writable.WritableTableType<K,V> tableType)
           
 
Method Summary
 void configureShuffle(org.apache.hadoop.mapreduce.Job job, GroupingOptions options)
           
 Pair<K,Iterable<V>> getDetachedValue(Pair<K,Iterable<V>> value)
          Returns a copy of a value (or the value itself) that can safely be retained.
 Converter getGroupingConverter()
           
 MapFn getInputMapFn()
           
 MapFn getOutputMapFn()
           
 Class<Pair<K,Iterable<V>>> getTypeClass()
          Returns the Java type represented by this PType.
 
Methods inherited from class org.apache.crunch.types.PGroupedTableType
getConverter, getDefaultFileSource, getFamily, getSubTypes, getTableType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritableGroupedTableType

public WritableGroupedTableType(org.apache.crunch.types.writable.WritableTableType<K,V> tableType)
Method Detail

getTypeClass

public Class<Pair<K,Iterable<V>>> getTypeClass()
Description copied from interface: PType
Returns the Java type represented by this PType.


getGroupingConverter

public Converter getGroupingConverter()
Specified by:
getGroupingConverter in class PGroupedTableType<K,V>

getInputMapFn

public MapFn getInputMapFn()

getOutputMapFn

public MapFn getOutputMapFn()

getDetachedValue

public Pair<K,Iterable<V>> getDetachedValue(Pair<K,Iterable<V>> value)
Description copied from interface: PType
Returns a copy of a value (or the value itself) that can safely be retained.

This is useful when iterable values being processed in a DoFn (via a reducer) need to be held on to for more than the scope of a single iteration, as a reducer (and therefore also a DoFn that has an Iterable as input) re-use deserialized values. More information on object reuse is available in the DoFn class documentation.

Parameters:
value - The value to be deep-copied
Returns:
A deep copy of the input value

configureShuffle

public void configureShuffle(org.apache.hadoop.mapreduce.Job job,
                             GroupingOptions options)
Specified by:
configureShuffle in class PGroupedTableType<K,V>


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