Revision 45892
Added by Eri Katsari about 7 years ago
VerificationReducer.java | ||
---|---|---|
8 | 8 |
import java.io.IOException; |
9 | 9 |
import java.util.Iterator; |
10 | 10 |
|
11 |
public class VerificationReducer extends Reducer<LongWritable, Text, Text, Text> {
|
|
11 |
public class VerificationReducer extends Reducer<Text, Text, Text, Text> {
|
|
12 | 12 |
private static String ERROR_KEY = ""; |
13 | 13 |
|
14 | 14 |
public static enum VERIFICATION_REDUCER_COUNTER { |
... | ... | |
23 | 23 |
|
24 | 24 |
|
25 | 25 |
@Override |
26 |
protected void reduce(final LongWritable key, final Iterable<Text> values, final Context context) throws IOException, InterruptedException {
|
|
26 |
protected void reduce(final Text key, final Iterable<Text> values, final Context context) throws IOException, InterruptedException {
|
|
27 | 27 |
Iterator<Text> it = values.iterator(); |
28 | 28 |
|
29 | 29 |
try { |
30 | 30 |
while (it.hasNext()) { |
31 |
context.write(new Text(key.toString()), it.next()); |
|
31 |
String output = it.next().toString(); |
|
32 |
// log.info(output); |
|
33 |
// System.out.println("output" + output); |
|
34 |
context.write(key, new Text(output)); |
|
32 | 35 |
context.getCounter(VERIFICATION_REDUCER_COUNTER.WRITTEN_PAIRS).increment(1); |
33 | 36 |
} |
34 | 37 |
} catch (Exception e) { |
Also available in: Unified diff
A