org.approvaltests.hadoop.version2.ReducerWrapper Maven / Gradle / Ivy
package org.approvaltests.hadoop.version2;
import java.io.IOException;
import java.util.Iterator;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
public class ReducerWrapper
implements
SmartReducer
{
private final Class keyIn;
private final Class valueIn;
private final Class keyOut;
private final Class valueOut;
private final Reducer reducer;
public ReducerWrapper(Reducer reducer, Class keyIn,
Class valueIn, Class keyOut, Class valueOut)
{
this.reducer = reducer;
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 reduce(KeyIn arg0, Iterator arg1, OutputCollector arg2, Reporter arg3)
throws IOException
{
reducer.reduce(arg0, arg1, arg2, arg3);
}
@Override
public void configure(JobConf arg0)
{
reducer.configure(arg0);
}
@Override
public void close() throws IOException
{
reducer.close();
}
}