@Override
public void reduce(Integer key, Iterable<WeatherRecord> values,
AvroCollector<Pair<Integer, WeatherRecord>> collector,
Reporter reporter) throws IOException {
WeatherRecord max = null;
for (WeatherRecord value : values) {
if (max == null || value.temperature > max.temperature) {
max = newWeatherRecord(value);
}
}