Пожалуйста, мне нужна помощь в этом коде:Как построить метод buildOutputValue
public class ThirdQueryReducer extends
Reducer<IntWritable, Text, NullWritable, Text> {
private NullWritable nullWritableKey = NullWritable.get();
private Text outputValue = new Text();
private StringBuilder buildOutputValue(IntWritable key,
StringBuilder reduceValueBuilder, Text value) {
}
@Override
public void reduce(IntWritable key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
}}
Как я Коула реализовать buildOutputValue? зная, что выход в картографа, как это: mapDriver.withOutput(new IntWritable(1981), new Text("Mercurey"));
И в buildOutputValue() должен обрабатывать даты, как это:
List<Text> values = new ArrayList<Text>(); values.add(new Text("Pommard")); values.add(new Text("Gentil")); reduceDriver.withInput(new IntWritable(1980), values);
И выход в редукторе, как это:
reduceDriver.withOutput(NullWritable.get(), new Text("Pommard\nGentil"));
заранее спасибо
Спасибо, это отличная альтернатива! –