forked from D-Net/dnet-hadoop
changed the way info is produced for the patch. If no interesting refereed info is present, the association result info is not produced
This commit is contained in:
parent
a4f9052623
commit
8d1c12bd18
|
@ -140,21 +140,19 @@ public class SparkPatchRefereed implements Serializable {
|
||||||
// ri.getHostedby().equals(i.getHostedby()) &&
|
// ri.getHostedby().equals(i.getHostedby()) &&
|
||||||
// ri.getInstancetype().equals(i.getInstancetype()) &&
|
// ri.getInstancetype().equals(i.getInstancetype()) &&
|
||||||
equals(ri.getUrl(), i.getUrl())) {
|
equals(ri.getUrl(), i.getUrl())) {
|
||||||
Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed());
|
// Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed());
|
||||||
if (!oRefereed.isPresent()) {
|
// if (!oRefereed.isPresent()) {
|
||||||
if (ri.getRefereed().getClassid().equals("")) {
|
// if (!(ri.getRefereed().getClassid().equals("") ||
|
||||||
i.setRefereed(Constants.DEFAULT_REFEREED);
|
// ri.getRefereed().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()))) {
|
||||||
} else {
|
i.setRefereed(ri.getRefereed());
|
||||||
i.setRefereed(ri.getRefereed());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO verify the reason of the NullPointerException fired at line 167
|
// TODO verify the reason of the NullPointerException fired at line 167
|
||||||
private static boolean equals(List<String> url, List<String> url1) {
|
public static boolean equals(List<String> url, List<String> url1) {
|
||||||
try {
|
try {
|
||||||
if (url == null && url1 == null) {
|
if (url == null && url1 == null) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -97,10 +97,13 @@ public class SparkPrepareResultInstanceList implements Serializable {
|
||||||
.map(instance -> {
|
.map(instance -> {
|
||||||
Optional<Qualifier> oRefereed = Optional.ofNullable(instance.getRefereed());
|
Optional<Qualifier> oRefereed = Optional.ofNullable(instance.getRefereed());
|
||||||
if (oRefereed.isPresent()) {
|
if (oRefereed.isPresent()) {
|
||||||
return instance;
|
if (!(oRefereed.get().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()) ||
|
||||||
} else {
|
oRefereed.get().getClassid().equals("UNKNOWN") ||
|
||||||
return null;
|
oRefereed.get().getClassid().equals(""))) {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
})
|
})
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toList()))
|
.collect(Collectors.toList()))
|
||||||
|
|
Loading…
Reference in New Issue