org.approvaltests.hadoop.version1.MapperWrapper Maven / Gradle / Ivy
package org.approvaltests.hadoop.version1;
import java.io.IOException;
import org.apache.hadoop.mapreduce.Mapper;
public class MapperWrapper extends 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;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public void run(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException
{
mapper.run(context);
}
}