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

org.apache.crunch.types.avro
Class AvroGroupedTableType<K,V>

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

public class AvroGroupedTableType<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
AvroGroupedTableType(AvroTableType<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.
 void initialize(org.apache.hadoop.conf.Configuration conf)
          Initialize this PType for use within a DoFn.
 
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

AvroGroupedTableType

public AvroGroupedTableType(AvroTableType<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()

initialize

public void initialize(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: PType
Initialize this PType for use within a DoFn. This generally only needs to be called when using a PType for PType.getDetachedValue(Object).

Parameters:
conf - Configuration object
See Also:
PType.getDetachedValue(Object)

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.