Project

General

Profile

« Previous | Next » 

Revision 57634

[broker] factored out method to obtain the key to be emitted by the enrichment map phase

View differences:

EnrichmentMapper.java
53 53
		emit(context, outKey, body.toByteArray(), type);
54 54
	}
55 55

  
56
	private byte[] getEmitKey(final Context context, final ImmutableBytesWritable key, final Map<byte[], byte[]> mergedIn) {
57
		if (MapUtils.isNotEmpty(mergedIn)) {
58
			context.getCounter(Type.result.name(), RelName.isMergedIn.name()).increment(1);
59

  
60
			//TODO a duplicate should be merged into only one representative object, but we noticed some cases where
61
			// a duplicate is merged in two different representative objects
62
			return mergedIn.keySet().iterator().next();
63
		} else {
64
			return key.copyBytes();
65
		}
66
	}
67

  
68 56
}

Also available in: Unified diff