com.datasalt.pangool.tuplemr
Class TupleMapper<INPUT_KEY,INPUT_VALUE>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<INPUT_KEY,INPUT_VALUE,DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
      extended by com.datasalt.pangool.tuplemr.TupleMapper<INPUT_KEY,INPUT_VALUE>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IdentityTupleMapper

public abstract class TupleMapper<INPUT_KEY,INPUT_VALUE>
extends org.apache.hadoop.mapreduce.Mapper<INPUT_KEY,INPUT_VALUE,DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
implements Serializable

TupleMapper is the Tuple-based Hadoop's Mapper version.

See Also:
Serialized Form

Nested Class Summary
static class TupleMapper.Collector
          Class for collecting data inside a TupleMapper.
static class TupleMapper.StaticTupleMRContext<INPUT_KEY,INPUT_VALUE>
           
 class TupleMapper.TupleMRContext
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
TupleMapper()
           
 
Method Summary
 void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
          Do not override.
 void cleanup(TupleMapper.TupleMRContext context, TupleMapper.Collector collector)
          Called once at the end of the task.
 void map(INPUT_KEY key, INPUT_VALUE value, org.apache.hadoop.mapreduce.Mapper.Context context)
          Do not override! Override map(Object, Object, TupleMRContext, Collector) instead.
abstract  void map(INPUT_KEY key, INPUT_VALUE value, TupleMapper.TupleMRContext context, TupleMapper.Collector collector)
          Called once per each input pair of key/values.
 void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
          Do not override.
 void setup(TupleMapper.TupleMRContext context, TupleMapper.Collector collector)
          Called once at the start of the task.
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleMapper

public TupleMapper()
Method Detail

setup

public void setup(TupleMapper.TupleMRContext context,
                  TupleMapper.Collector collector)
           throws IOException,
                  InterruptedException
Called once at the start of the task. Override it to implement your custom logic.

Throws:
IOException
InterruptedException

cleanup

public void cleanup(TupleMapper.TupleMRContext context,
                    TupleMapper.Collector collector)
             throws IOException,
                    InterruptedException
Called once at the end of the task. Override it to implement your custom logic.

Throws:
IOException
InterruptedException

map

public abstract void map(INPUT_KEY key,
                         INPUT_VALUE value,
                         TupleMapper.TupleMRContext context,
                         TupleMapper.Collector collector)
                  throws IOException,
                         InterruptedException
Called once per each input pair of key/values. Override it to implement your custom logic.

Throws:
IOException
InterruptedException

setup

public final void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
                 throws IOException,
                        InterruptedException
Do not override. Override setup(TupleMRContext, Collector) instead.

Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<INPUT_KEY,INPUT_VALUE,DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException

cleanup

public final void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
                   throws IOException,
                          InterruptedException
Do not override. Override cleanup(TupleMRContext, Collector) instead.

Overrides:
cleanup in class org.apache.hadoop.mapreduce.Mapper<INPUT_KEY,INPUT_VALUE,DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException

map

public final void map(INPUT_KEY key,
                      INPUT_VALUE value,
                      org.apache.hadoop.mapreduce.Mapper.Context context)
               throws IOException,
                      InterruptedException
Do not override! Override map(Object, Object, TupleMRContext, Collector) instead.

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<INPUT_KEY,INPUT_VALUE,DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.