Revision 53238
Added by Miriam Baglioni over 5 years ago
modules/dnet-mapreduce-jobs/trunk/src/main/java/eu/dnetlib/data/mapreduce/hbase/bulktag/BulkTaggingMapper.java | ||
---|---|---|
22 | 22 |
private CommunityConfiguration cc; |
23 | 23 |
|
24 | 24 |
private ResultTagger tagger; |
25 |
private boolean enabled; |
|
25 | 26 |
|
26 | 27 |
@Override |
27 | 28 |
protected void setup(final Context context) throws IOException, InterruptedException { |
28 | 29 |
super.setup(context); |
29 | 30 |
|
30 | 31 |
final String conf = context.getConfiguration().get("tagging.conf"); |
32 |
enabled = context.getConfiguration().getBoolean("enabled",false); |
|
31 | 33 |
if (StringUtils.isBlank(conf)) { |
32 | 34 |
throw new IllegalArgumentException("missing bulk tagging configuration"); |
33 | 35 |
} |
... | ... | |
63 | 65 |
final Put put = new Put(key.copyBytes()).add(Bytes.toBytes("result"), Bytes.toBytes("body"), oaf.toByteArray()); |
64 | 66 |
|
65 | 67 |
if(tagged > 0){ |
66 |
context.write(key, put); |
|
68 |
if (enabled) |
|
69 |
context.write(key, put); |
|
67 | 70 |
context.getCounter("Bulk Tagging", " write op ").increment(1); |
68 | 71 |
} |
69 | 72 |
|
Also available in: Unified diff
enabling/disabling of writing operation