I have this Java code:
public class TestMapper extends AppEngineMapper<Key, Entity, NullWritable, NullWritable> {
public TestMapper() {
}
@Override
public void setup(Context context) {
log.warning("Doing per-worker setup");
}
}
... which I converted to:
class TestMapper extends AppEngineMapper[Key, Entity, NullWritable, NullWritable] {
override def setup(context: Context) {
log.warning("Doing per-worker setup")
}
}
Now the actual problem:
Context is defined as a nested class in the class org.apache.hadoop.mapreduce.Mapper :
public static class Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
protected void setup(org.apache.hadoop.mapreduce.Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>.Context context) throws java.io.IOException, java.lang.InterruptedException { }
public class Context extends org.apache.hadoop.mapreduce.MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> {
public Context(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.mapreduce.TaskAttemptID conf, org.apache.hadoop.mapreduce.RecordReader<KEYIN,VALUEIN> taskid, org.apache.hadoop.mapreduce.RecordWriter<KEYOUT,VALUEOUT> reader, org.apache.hadoop.mapreduce.OutputCommitter writer, org.apache.hadoop.mapreduce.StatusReporter committer, org.apache.hadoop.mapreduce.InputSplit reporter) throws java.io.IOException, java.lang.InterruptedException { }
}
So, I can not describe the Scala class, where / what is the Context . If the mapper did not have any generics, I could reference the Context via
Mapper
but how can I say that mapper has generics?
Mapper[_,_,_,_]#Context
... does not work.