forked from D-Net/dnet-hadoop
[BIP! Scores integration] Create updates as Result rather than subclasses; Result considers also metrics in the mergeFrom operation
This commit is contained in:
parent
2e503ee101
commit
1361c9eb0c
|
@ -243,7 +243,7 @@ public class Result extends OafEntity implements Serializable {
|
||||||
|
|
||||||
Result r = (Result) e;
|
Result r = (Result) e;
|
||||||
|
|
||||||
// TODO consider merging also Measures
|
measures = mergeLists(measures, r.getMeasures());
|
||||||
|
|
||||||
instance = mergeLists(instance, r.getInstance());
|
instance = mergeLists(instance, r.getInstance());
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class SparkAtomicActionScoreJob implements Serializable {
|
||||||
}, Encoders.bean(BipScore.class))
|
}, Encoders.bean(BipScore.class))
|
||||||
.groupByKey((MapFunction<BipScore, String>) value -> value.getId(), Encoders.STRING())
|
.groupByKey((MapFunction<BipScore, String>) value -> value.getId(), Encoders.STRING())
|
||||||
.mapGroups((MapGroupsFunction<String, BipScore, I>) (k, it) -> {
|
.mapGroups((MapGroupsFunction<String, BipScore, I>) (k, it) -> {
|
||||||
Result ret = inputClazz.newInstance();
|
Result ret = new Result();
|
||||||
BipScore first = it.next();
|
BipScore first = it.next();
|
||||||
ret.setId(first.getId());
|
ret.setId(first.getId());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue