/// <summary> /// Create a map context that is based on ChainMapContext and the given record /// reader and record writer /// </summary> private Mapper.Context CreateMapContext <Keyin, Valuein, Keyout, Valueout>(RecordReader <KEYIN, VALUEIN> rr, RecordWriter <KEYOUT, VALUEOUT> rw, TaskInputOutputContext <KEYIN , VALUEIN, KEYOUT, VALUEOUT> context, Configuration conf) { MapContext <KEYIN, VALUEIN, KEYOUT, VALUEOUT> mapContext = new ChainMapContextImpl <KEYIN, VALUEIN, KEYOUT, VALUEOUT>(context, rr, rw, conf); Mapper.Context mapperContext = new WrappedMapper <KEYIN, VALUEIN, KEYOUT, VALUEOUT >().GetMapContext(mapContext); return(mapperContext); }
public virtual void TestCloneMapContext() { TaskID taskId = new TaskID(jobId, TaskType.Map, 0); TaskAttemptID taskAttemptid = new TaskAttemptID(taskId, 0); MapContext <IntWritable, IntWritable, IntWritable, IntWritable> mapContext = new MapContextImpl <IntWritable, IntWritable, IntWritable, IntWritable>(conf, taskAttemptid, null, null, null, null, null); Mapper.Context mapperContext = new WrappedMapper <IntWritable, IntWritable, IntWritable , IntWritable>().GetMapContext(mapContext); ContextFactory.CloneMapContext(mapperContext, conf, null, null); }