Revision 57211
Added by Miriam Baglioni over 4 years ago
Utils.java | ||
---|---|---|
78 | 78 |
|
79 | 79 |
final Map<byte[], byte[]> relationMap = value.getFamilyMap(Bytes.toBytes(sem_rel)); |
80 | 80 |
|
81 |
context.getCounter(counter, sem_rel).increment(relationMap.size()); |
|
82 |
|
|
83 |
|
|
84 | 81 |
/* |
85 | 82 |
we could extract the target qualifiers from the familyMap's keyset, but we also need to check the relationship is not deletedbyinference |
86 | 83 |
return relationMap.keySet().stream() |
... | ... | |
88 | 85 |
.collect(Collectors.toCollection(HashSet::new)); |
89 | 86 |
*/ |
90 | 87 |
|
91 |
return relationMap.values().stream()
|
|
88 |
HashSet<String> valid_relation = relationMap.values().stream()
|
|
92 | 89 |
.map(b -> asOaf(b)) |
93 | 90 |
.filter(Objects::nonNull) |
94 | 91 |
.filter(o -> isValid(o)) |
... | ... | |
96 | 93 |
.map(o -> o.getRel().getTarget()) |
97 | 94 |
.collect(Collectors.toCollection(HashSet::new)); |
98 | 95 |
|
96 |
context.getCounter(counter, sem_rel).increment(valid_relation.size()); |
|
97 |
|
|
98 |
return valid_relation; |
|
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
private static OafProtos.Oaf asOaf(byte[] r) { |
Also available in: Unified diff
final logic of propagation of community through organization (products belonging to given organization will be associated to the community)