Search in sources :

Example 1 with GroupedRow

use of org.apache.rya.accumulo.mr.merge.util.GroupedRow in project incubator-rya by apache.

the class MultipleFileReducer method reduce.

/**
 * Writes <{@link Key}, {@link Value}> pairs to a file, where the path to the output file is determined by the group.
 * @param   group   Contains the group name (a String) which is used to route output to the appropriate subdirectory
 * @param   rows    Contain the actual Accumulo rows to be written
 * @param   context Context for writing
 */
@Override
protected void reduce(final GroupedRow group, final Iterable<GroupedRow> rows, final Context context) throws IOException, InterruptedException {
    final String groupName = group.getGroup().toString();
    final String destination = groupName + "/files/part";
    for (final GroupedRow row : rows) {
        mos.write(row.getKey(), row.getValue(), destination);
    }
}
Also used : GroupedRow(org.apache.rya.accumulo.mr.merge.util.GroupedRow)

Aggregations

GroupedRow (org.apache.rya.accumulo.mr.merge.util.GroupedRow)1