Revision 53191
Added by Claudio Atzori over 5 years ago
modules/dnet-mapreduce-jobs/branches/beta/src/main/java/eu/dnetlib/data/mapreduce/hbase/broker/PIDEventFactory.java | ||
---|---|---|
27 | 27 |
*/ |
28 | 28 |
public class PIDEventFactory { |
29 | 29 |
|
30 |
public static List<EventWrapper> process(final Oaf current, final Oaf other, final float trust) |
|
31 |
throws IOException, InterruptedException, DocumentException { |
|
30 |
public static List<EventWrapper> process(final Oaf current, final Oaf other, final float trust) { |
|
32 | 31 |
return new PIDEventFactory().processPID(current, other, trust); |
33 | 32 |
} |
34 | 33 |
|
35 |
public List<EventWrapper> processPID(final Oaf current, final Oaf other, final float trust) |
|
36 |
throws IOException, InterruptedException, DocumentException { |
|
34 |
public List<EventWrapper> processPID(final Oaf current, final Oaf other, final float trust) { |
|
37 | 35 |
|
38 | 36 |
final Collection<StructuredProperty> pids = other.getEntity().getPidList() |
39 | 37 |
.stream() |
40 | 38 |
.collect(Collectors.toMap( |
41 |
p -> StringUtils.lowerCase(p.getValue()), |
|
42 |
Function.identity())) |
|
39 |
p -> StringUtils.lowerCase(p.getQualifier().getClassid()) + ":" +StringUtils.lowerCase(p.getValue()), |
|
40 |
Function.identity(), |
|
41 |
(p1, p2) -> p1)) |
|
43 | 42 |
.values(); |
44 | 43 |
|
45 | 44 |
final Stream<EventWrapper> more = pids.stream() |
Also available in: Unified diff
avoid collisions when hashing pids by value