Project

General

Profile

« Previous | Next » 

Revision 29727

Added by Eri Katsari over 10 years ago

View differences:

modules/dnet-openaire-stats/trunk/src/main/java/eu/dnetlib/data/mapreduce/hbase/statsExport/StatsMapper.java
28 28
import eu.dnetlib.data.proto.OafProtos.Oaf;
29 29
import eu.dnetlib.data.proto.OafProtos.OafRel;
30 30
import eu.dnetlib.data.proto.OafProtos.OafRelOrBuilder;
31
import eu.dnetlib.data.proto.RelTypeProtos.RelType;
32 31
import eu.dnetlib.data.proto.RelTypeProtos.SubRelType;
33 32
import eu.dnetlib.data.proto.TypeProtos.Type;
34 33

  
......
53 52
	};
54 53

  
55 54
	public static enum PROTOS_COUNTER {
56
		RESULT, PROJECT, DATASOURCE, ORGANIZATION, DATASOURCEORGANIZATION, DATASOURCETOPIC, DATASOURCELANGUAGE, PROJECTORGANIZATION, RESULTCLAIM, RESULTCLASSIFICATION, RESULTCONCEPT, RESULTLANGUAGE, RESULTORGANIZATION, RESULTRESULT, RESULTPROJECT, RESULTTOPIC, RESULTDATASOURCE
55
		RESULT, PROJECT, DATASOURCE, ORGANIZATION, DATASOURCEORGANIZATION, DATASOURCETOPIC, DATASOURCELANGUAGE,
56
		PROJECTORGANIZATION, RESULTCLAIM, RESULTCLASSIFICATION, RESULTCONCEPT, 
57
		RESULTLANGUAGE, RESULTORGANIZATION, RESULTRESULT, RESULTPROJECT, RESULTTOPIC, RESULTDATASOURCE
57 58

  
58 59
	};
59 60

  
......
84 85
		if (isValid(oaf, context))
85 86

  
86 87
		{
87

  
88 88
			context.getCounter(STATS_COUNTER.VALID_RECS).increment(1);
89 89
			// if (!deletedByInference(oaf) ||
90 90
			// entityConfigTable.includeDuplicates(type))
......
165 165
					for (String relVals : rel.getValue()) {
166 166

  
167 167
						if (relVals != null && !relVals.isEmpty()) {
168
//							context.getCounter(PROTOS_COUNTER.valueOf(rel.getKey())).increment(1);
169 168

  
170 169
							context.getCounter(STATS_COUNTER.OUTPUT_DERIVED_RELATIONS).increment(1);
171 170
							context.write((TextKeyOut), new ImmutableBytesWritable(relVals.getBytes()));
......
206 205
								Text TextKeyOut = new Text(ld.getRelDescriptor().getRelType().toString() + "," + serializer.getId(rel));
207 206
								String buff = serializer.serialize(rel);
208 207
								context.getCounter(STATS_COUNTER.WRITTEN_RELATIONS).increment(1);
209
								context.getCounter(PROTOS_COUNTER.valueOf(ld.getRelDescriptor().getRelType().toString().toUpperCase())).increment(1);
208
//								context.getCounter(PROTOS_COUNTER.valueOf(ld.getRelDescriptor().getRelType().toString().toUpperCase())).increment(1);
210 209

  
211 210
								context.write((TextKeyOut), new ImmutableBytesWritable(buff.getBytes()));
212 211

  

Also available in: Unified diff