MapReduceDriver mapReduceDriver = new MapReduceDriver();
mapReduceDriver.setMapper(mapper);
Object writableKey = createWritable(key, mapper.getKeyInType());
Object writableValue = createWritable(input, mapper.getValueInType());
mapDriver.withInput(writableKey, writableValue);
List results = mapDriver.run();
Collections.sort(results, PairComparer.INSTANCE);
mapReduceDriver = new MapReduceDriver<LongWritable, Text, Text, LongWritable, Text, LongWritable>();
writableKey = createWritable(key, mapper.getKeyInType());
writableValue = createWritable(input, mapper.getValueInType());
mapReduceDriver.withInput(writableKey, writableValue);