public void reduce(Text key, Iterator<IntWritable> values,
OutputCollector<Text, IntWritable> output, Reporter reporter)
throws IOException {
// invoke "reduce" method in ruby
JRubyEvaluator evaluator = getJRubyEvaluator();
try {
evaluator.invoke("wrap_reduce", key, values, output, reporter);
} catch (ScriptException e) {
reporter.setStatus(e.getMessage());
} finally {
evaluator.checkResource();
}
}