Project

General

Profile

« Previous | Next » 

Revision 46454

added counters

View differences:

modules/dnet-mapreduce-jobs/trunk/src/main/java/eu/dnetlib/data/mapreduce/hbase/dedup/DedupFixRelationMapper.java
19 19
 */
20 20
public class DedupFixRelationMapper extends TableMapper<DNGFKey, ImmutableBytesWritable> {
21 21

  
22
    public static final String COUNTER_GROUP = "Fix relations";
23

  
22 24
    private DedupConfig dedupConf;
23 25

  
24 26
    private ImmutableBytesWritable ibw;
......
53 55

  
54 56
    private void emit(final Context context, final DNGFKey key, final byte[] value) {
55 57
        ibw.set(value);
58
        switch (key.getKeyType().get()) {
59
        case DNGFKey.MERGES_REL:
60
            context.getCounter(COUNTER_GROUP, "Merges Relationship").increment(1);
61
            break;
62
        case DNGFKey.OTHER_REL:
63
            context.getCounter(COUNTER_GROUP, "Other Relationship").increment(1);
64
            break;
65
        }
56 66
        try {
57 67
            context.write(key, ibw);
58 68
        } catch (Exception e) {

Also available in: Unified diff