/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @param values * the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @value the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @param values * the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @value the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @value the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @param values * the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }
/** * @param key * the key is expected to be a Text object, whose prefix indicates * the type of aggregation to aggregate the values. In effect, data * driven computing is achieved. It is assumed that each aggregator's * getReport method emits appropriate output for the aggregator. This * may be further customiized. * @param values * the values to be aggregated */ public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { String keyStr = key.toString(); int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR); String type = keyStr.substring(0, pos); keyStr = keyStr.substring(pos + ValueAggregatorDescriptor.TYPE_SEPARATOR.length()); ValueAggregator aggregator = ValueAggregatorBaseDescriptor .generateValueAggregator(type); while (values.hasNext()) { aggregator.addNextValue(values.next()); } String val = aggregator.getReport(); key = new Text(keyStr); output.collect(key, new Text(val)); }