forked from D-Net/dnet-hadoop
[CountryPropagation] refactoring
This commit is contained in:
parent
c298c148cb
commit
5e0b8f9b5f
|
@ -114,11 +114,12 @@ public class SparkCountryPropagationJob {
|
||||||
private static List<Country> merge(List<Country> c1, List<CountrySbs> c2) {
|
private static List<Country> merge(List<Country> c1, List<CountrySbs> c2) {
|
||||||
HashSet<String> countries = new HashSet<>();
|
HashSet<String> countries = new HashSet<>();
|
||||||
if (Optional.ofNullable(c1).isPresent()) {
|
if (Optional.ofNullable(c1).isPresent()) {
|
||||||
countries = c1.stream().map(Qualifier::getClassid)
|
countries = c1
|
||||||
|
.stream()
|
||||||
|
.map(Qualifier::getClassid)
|
||||||
.collect(Collectors.toCollection(HashSet::new));
|
.collect(Collectors.toCollection(HashSet::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HashSet<String> finalCountries = countries;
|
HashSet<String> finalCountries = countries;
|
||||||
return c2
|
return c2
|
||||||
.stream()
|
.stream()
|
||||||
|
|
Loading…
Reference in New Issue