public void reduce(final InputStream in, final OutputStream out, final Reducer reducer) throws Exception { reduce(new InputStreamReader(in), new OutputStreamWriter(out), reducer); }
public static void main(final String[] args) throws Exception { new GenericMR().reduce(System.in, System.out, new Reducer() { public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } }); } }
public void reduce(final InputStream in, final OutputStream out, final Reducer reducer) throws Exception { reduce(new InputStreamReader(in), new OutputStreamWriter(out), reducer); }
public void reduce(final InputStream in, final OutputStream out, final Reducer reducer) throws Exception { reduce(new InputStreamReader(in), new OutputStreamWriter(out), reducer); }
public void reduce(final InputStream in, final OutputStream out, final Reducer reducer) throws Exception { reduce(new InputStreamReader(in), new OutputStreamWriter(out), reducer); }
public void reduce(final InputStream in, final OutputStream out, final Reducer reducer) throws Exception { reduce(new InputStreamReader(in), new OutputStreamWriter(out), reducer); }
public static void main(final String[] args) throws Exception { new GenericMR().reduce(System.in, System.out, new Reducer() { public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } }); } }
public static void main(final String[] args) throws Exception { new GenericMR().reduce(System.in, System.out, new Reducer() { public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } }); } }
public static void main(final String[] args) throws Exception { new GenericMR().reduce(System.in, System.out, new Reducer() { public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } }); } }
public static void main(final String[] args) throws Exception { new GenericMR().reduce(System.in, System.out, new Reducer() { public void reduce(String key, Iterator<String[]> records, Output output) throws Exception { int count = 0; while (records.hasNext()) { // note we use col[1] -- the key is provided again as col[0] count += Integer.parseInt(records.next()[1]); } output.collect(new String[] {key, String.valueOf(count)}); } }); } }