All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.approvaltests.hadoop.version2.MapperWrapper Maven / Gradle / Ivy

package org.approvaltests.hadoop.version2;

import java.io.IOException;

import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

public class MapperWrapper
    implements
      SmartMapper
{
  private final Class                             keyIn;
  private final Class                           valueIn;
  private final Class                            keyOut;
  private final Class                          valueOut;
  private final Mapper mapper;
  public MapperWrapper(Mapper mapper, Class keyIn,
      Class valueIn, Class keyOut, Class valueOut)
  {
    this.mapper = mapper;
    this.keyIn = keyIn;
    this.valueIn = valueIn;
    this.keyOut = keyOut;
    this.valueOut = valueOut;
  }
  @Override
  public Class getKeyInType()
  {
    return keyIn;
  }
  @Override
  public Class getValueInType()
  {
    return valueIn;
  }
  @Override
  public Class getKeyOutType()
  {
    return keyOut;
  }
  @Override
  public Class getValueOutType()
  {
    return valueOut;
  }
  @Override
  public void map(KeyIn arg0, ValueIn arg1, OutputCollector arg2, Reporter arg3)
      throws IOException
  {
    mapper.map(arg0, arg1, arg2, arg3);
  }
  @Override
  public void configure(JobConf arg0)
  {
    mapper.configure(arg0);
  }
  @Override
  public void close() throws IOException
  {
    mapper.close();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy