/// <exception cref="System.IO.IOException"/> /// <exception cref="System.TypeLoadException"/> public override void Init(MapOutputCollector.Context context) { this.mapTask = context.GetMapTask(); this.jobConf = context.GetJobConf(); this.reporter = context.GetReporter(); numberOfPartitions = jobConf.GetNumReduceTasks(); keyClass = (Type)jobConf.GetMapOutputKeyClass(); valueClass = (Type)jobConf.GetMapOutputValueClass(); recordWriters = new TestMerge.KeyValueWriter[numberOfPartitions]; outStreams = new ByteArrayOutputStream[numberOfPartitions]; // Create output streams for partitions. for (int i = 0; i < numberOfPartitions; i++) { outStreams[i] = new ByteArrayOutputStream(); recordWriters[i] = new TestMerge.KeyValueWriter <K, V>(jobConf, outStreams[i], keyClass , valueClass); } }
/// <exception cref="System.IO.IOException"/> /// <exception cref="System.TypeLoadException"/> public abstract void Init(MapOutputCollector.Context context);