datafu.hourglass.mapreduce
Class CollapsingMapper

java.lang.Object
  extended by datafu.hourglass.mapreduce.ObjectProcessor
      extended by datafu.hourglass.mapreduce.ObjectMapper
          extended by datafu.hourglass.mapreduce.CollapsingMapper
All Implemented Interfaces:
java.io.Serializable

public class CollapsingMapper
extends ObjectMapper
implements java.io.Serializable

The mapper used by AbstractPartitionCollapsingIncrementalJob and its derived classes.

An implementation of Mapper is used for the map operation, which produces key and intermediate value pairs from the input.

Author:
"Matthew Hayes"
See Also:
Serialized Form

Constructor Summary
CollapsingMapper()
           
 
Method Summary
 Mapper<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> getMapper()
          Gets the mapper.
 boolean getReuseOutput()
          Gets whether previous output is being reused.
 PartitionCollapsingSchemas getSchemas()
          Gets the Avro schemas.
 void map(java.lang.Object inputObj, org.apache.hadoop.mapreduce.MapContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context)
           
 void setContext(org.apache.hadoop.mapreduce.TaskInputOutputContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context)
           
 void setMapper(Mapper<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> mapper)
          Sets the mapper.
 void setReuseOutput(boolean reuseOutput)
          Sets whether previous output is being reused.
 void setSchemas(PartitionCollapsingSchemas schemas)
          Sets the Avro schemas.
 
Methods inherited from class datafu.hourglass.mapreduce.ObjectProcessor
close, getContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollapsingMapper

public CollapsingMapper()
Method Detail

map

public void map(java.lang.Object inputObj,
                org.apache.hadoop.mapreduce.MapContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context)
         throws java.io.IOException,
                java.lang.InterruptedException
Specified by:
map in class ObjectMapper
Throws:
java.io.IOException
java.lang.InterruptedException

getReuseOutput

public boolean getReuseOutput()
Gets whether previous output is being reused.

Returns:
true if previous output is reused

setReuseOutput

public void setReuseOutput(boolean reuseOutput)
Sets whether previous output is being reused.

Parameters:
reuseOutput - true if previous output is reused

setContext

public void setContext(org.apache.hadoop.mapreduce.TaskInputOutputContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context)
Overrides:
setContext in class ObjectProcessor

getMapper

public Mapper<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> getMapper()
Gets the mapper.

Returns:
mapper

setMapper

public void setMapper(Mapper<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> mapper)
Sets the mapper.

Parameters:
mapper -

setSchemas

public void setSchemas(PartitionCollapsingSchemas schemas)
Sets the Avro schemas.

Parameters:
schemas -

getSchemas

public PartitionCollapsingSchemas getSchemas()
Gets the Avro schemas.

Returns:
schemas


Matthew Hayes